Site go live

From GLMWiki
Revision as of 12:00, 6 February 2017 by Cscott (Talk | contribs)

Jump to: navigation, search
  • Secure pages if applicable (make sure they are setup in .htaccess to force https)
  • Move the client development copy (likely dev5[3/4/5]) into backup directory, and move whatever was in backup already into org.sitename.com
This should be done before you start moving the database to the production server
move the dev copy out of the way
!! If there was nothing on ws6 yet the website probably yet needs a virtual server set up. Give a task to Dennis under "DNS, Vmail & VS"
After that, move whatever is left there into backups, do the git clone as normal, and copy the backup/www.site.com/admin/logs into the new dir
  • Check on email addresses to make sure they're set in .htaccess
  • Make sure meta description and title in templates/template.html
<meta name="description" content="{metaTags:h}">
<title>{pageTitle:h}</title>
  • Remove the index.html, client files, Phing folder file also from version control, if applicable.
  • Ensure that search is enabled. Task Chuck with indexing as soon as the site is live.
  • Ensure Google Analytics Tracking code is migrated, if applicable.
  • Ensure that all calls to the mobile template are removed, if applicable.
  • Ensure that Event Management data is migrated, if old site was ours.
  • Ensure that debug code is removed. In particular: Grep or Netbeans Find for "console.log" and remove or at least comment all instances.
  • Update the description field in the toolbox.pages table:
psql -U postgres -h devdb {whateverSiteName}
----------
for dev52
----------
update toolbox.paragraphs set description = replace(description, 'dev52.gaslightmedia.com/', '');

update rotatingimages.rotating_images set url = replace(url, 'dev52.gaslightmedia.com/', '');

----------
for dev53
----------
update toolbox.paragraphs set description = replace(description, 'dev53.gaslightmedia.com/', '');

update rotatingimages.rotating_images set url = replace(url, 'dev53.gaslightmedia.com/', '');

update blocks.blocks set description = replace(description, 'dev53.gaslightmedia.com/', '');
  • Update the url field in the rotating images table so the url reference is not dev52
 set search_path to rotatingimages;
 begin work;
 update rotating_images set url = replace(url, 'dev52.gaslightmedia.com/', '');
 commit work;
  • Make sure the database used matches the one in the config/server.ini now using ds4 not ds3
  • Move the database to production server. It will be good to have a databases folder in your home directory
when you do a dump you may have to use full column insert and not a tar file 
as grabbing database from ds3 from a different psql version
If you go from the same version you can use the -Fc for a compressed file dump which will be much faster to reload 
a huge database copy.
pg_dump -Fc -h devdb -f {dbName}.tar {dbName}
createdb -h ds4 {dbName}
pg_restore -d {dbName} -h ds4 {dbName}.tar
  • Subversion
  • Move svn copy into prod
svn mv [url] [url]
example:
svn mv -m "move to production" http://cvs2.gaslightmedia.com/svn/dev/www.sitename.com \
http://cvs2.gaslightmedia.com/svn/prod/www.sitename.com
  • Check out the site to production server (subversion)
When you checkout the site to the live server first check it out as a different folder name
svn co http://cvs2.gaslightmedia.com/svn/prod/www.sitename.com new.sitename.com
then move in the needed folders like admin/logs and move the original out of the way to hte backup
directory and  move in your new copy.
  • Git (git-flow)
  • From your git repo (local)
!! before you start a release, do a git pull origin develop !! 
git flow release start {version} ##remember that we commonly already have V as our Version tag!
git flow release finish {version}
git push --all
git push --tags
  • From ws6
git clone git@cvs2:web/SiteName.git new.sitename.com
mv www.sitename.com backup/. && mv new.sitename.com www.sitename.com
  • make sure that the directory for www.sitename.com is group writable
chmod g+w www.sitename.com (We'll have to fix this in git)


Set the git repo so it is shared

git config core.sharedRepository true
  • Update .htaccess file on server and commit
Should look like this: 
#RewriteBase /www.keweenaw.info/
# Redirect non-www to www
#RewriteCond %{ENV:GLM_HOST_ID} PRODUCTION
#RewriteCond %{HTTP_HOST} !^www\. [NC]
#RewriteCond %{HTTP_HOST} !^demo\. [NC]
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

When the site has gone live, this second section may be uncommented again, but keep the Rewritebase commented out.


  • Verify that the GLM_site_check.phtml file exists on production checkout. It will be created once the site is visited.
Verify not only that it exists but is setup to pull in the setup.phtml file and get the correct database connection.
New sites should be using version 2.0 of this file
Also check that the file has correct db host name (ds4)
  • CKEditor folders must be present, but should be created when the admin image editor is accessed and used
These folders need to be there
Toolkit/CKImages/
  editedImages 
Toolkit/PHPImageEditor/
  editimagesoriginal
  editimagespng
  editimagesworkwith


  • Move the old database (if there was one) so no connections are made to old data
  • Once live empty the cache directory (or make a new one if it doesn't exist) and update .htaccess file for redirect if nothing before domain name (no www)
  • If the flexy option forceCompile is turned off you'll have to set it to on then run the site at the url to get rid of any ip address in the flexy templates. then remember to turn it back off.

For member databases check that there's no dev53 or dev52 references in the members.member table. they may stick in those as links. also member files are still stored in files so you'll have to upload them to the live server.

WooCommerce

  • E-Mail Addresses
 Check main WooCommerce "From" Email Address in "WooCommerce" -> "Settings" -> "Emails" -> "Email Options".
 If any E-Mail messages to the shop administrator go to someone other than the main "WordPress" E-Mail contact address, add them in the various E-Mail types tabs on the same page.


  • Payment Processing
 Check if any payment processing requires production credentials.
 Check all active payment processing to make sure they are set for production.
 Check that all E-Mail address settings for any payment processor are set for production.

Google Maps JavaScript API Keys

NOTE: Required for any GLM Associate install that does front-end mapping.

 E-Mail:     glmfrontoffice@gmail.com
 Password:   Keep16Glm

For each site...

  • Next to "Google APIs" there's a picklist with "My Project" (or something) - Select "Create a Project"
  • Enter the name of the project (i.e. the Website name)
  • Click "Create" (this may take some time, just wait)
  • When that's done, the page will re-display with the "Library" list
  • Click "Credentials" in the left menu then click "Create credentials" then select "API key"
  • Copy the API key then select "Restrict key"
  • Optionally give the key a Name
  • Select "HTTP referrers (web sites) and enter the site URL as shown in the example and click "Save"
 *.gaslightmedia.com/*
  • Click on "Dashboard" at left then "+ ENABLE API" at top
  • Click on "Google Maps JavaScript API" under "Google Maps APIs"
  • Click "ENABLE" at top
  • Also enable "Geolocation" and "Geocode" (please update this step when doing this next time)
  • Enter key in GLM Associate at "Management" -> "Misc. Settings" -> "Google Maps API Key:" field.

Add a site to OpenSearchServer

Note that you may have to wait for DNS to propagate to the OSS server. The first step below is to verify that this has happened.

  • Log into oss.gaslightmedia.com by ssh and make sure that the site hostname is resolving with the expected IP address (use "host {site}" to get that). If not, wait for DNS to propagate to IS0.
  • Log into the OpenSearchServer management interface at "http://oss.gaslightmedia.com:9090".
  • Go to "Indices:..." (might be "Index" with an already selected index) tab at the top left
  • If the old site has been indexed by the OpenSearchServer - Remove the old site from its index
 * Select that index the old site is in
 * Select "Crawler" tab at the top
 * Check the box next to the site in the list below and click the "delete" list at the bottom (NOT THE "delete all" link!)
  • Select the desired Index (Index2 currently for Angelia sites)
  • Select the "Crawler" tab at the top
  • Select the "Pattern list" tab
  • Enter the base URL in the edit window, end with "/*"
  • Select "Add"

Exclusion Review - Need to review all areas that are not to be indexed by the OpenSearchServer. If an area to be excluded is not covered by one of the entries below, the site either needs to be changed to comply with these standard exclusions or a new exclusion needs to be added to the OpenSearchServer.

ID's excluded

 gallery
 footer
 page-header
 left-off-canvas-menu
 head-img
 reservation
 breadcrumbs
 copyright
 wu-copyright
 wu-wrapper
 mid
 blog-feed-front
 footer_address

HTML tags excluded

 head
 header
 footer
 form
 nav
 aside

If there are non-standard tags with contents that need to be excluded the tag can be excluded by adding the following class.

 opensearchserver.ignore

Use the following procedure to update or add excluded IDs and HTML tags.

  • Click "Schema" tab
  • Click "Parser list" sub-tab
  • Click "Edit" to the right of "HTML parser" line.
  • At the bottom of the page edit the "XPATH Exclusions" to update or add the desired exclusion.
  • When done, click "Save" at the bottom of the page.

Forcing OpenSearchServer to Re-Index a Site

If it becomes necessary to re-index (re-crawl) a site due to areas that should be excluded not having been properly excluded, you can follow the proceedure below.

  • Log into OpenSearchServer
  • Select the desired index (normally INDEX_2)
  • Select the "Crawler" tab then "Crawl process" sub-tab
  • Click the "Running - Click to stop" button and wait for the sever to stop crawling.
  • Select the "URL browser" sub-tab
  • Enter the base URL of the site in the "Url" input field. Use wildcard to specify entire site (i.e. "http://www.gaslightmedia.com/*").
  • Click the "Search" button and review the list of URLs produced to make sure you have your URL selection correct.
  • In the "Commands:" pick-list, select "Set selected URLs to Unfetched" then click the "Go" button.
  • Optionally (may be required) - In the "Commands:" pick-list, select "Delete selected URLs" then click the "Go" button.
  • When that is done, select the "Crawl process" tab again and click the "Not running - Click to run" button.
  • Just to make sure things get kicked off again, click on "Manual crawl", enter the URL for the base of the site (i.e. "http://www.gaslightmedia.com/"), then click the "Crawl" button.

This should start the OpenSearchServer re-crawling the specified site. It's also possible to crawl any specific part of a site by specifying the base URL to that area of the site followed by "/*", or to otherwise use wildcard characters to specify the desired URLs. Be sure to check your URL selection by reviewing the generated URL list.