Skip to content

Instantly share code, notes, and snippets.

@yllus
Created August 16, 2013 19:30
Show Gist options
  • Save yllus/6252803 to your computer and use it in GitHub Desktop.
Save yllus/6252803 to your computer and use it in GitHub Desktop.

GRAMMY.ca (WordPress 3)

GRAMMY.ca (WordPress 3) was a project undertaken in 2013 to set create a Canadian website similar to grammy.com. The project was headed by project manager James Wood ( James.Wood@rci.rogers.com ).

Site Environment

Basic site environment:

  • Nginx 1.2.1
  • PHP 5.3.x
  • MySQL 5.x

Production Environment

http://www.grammy.ca/ is currently served from the following load balanced front-end webservers:

  • ?

Webservers running the caching proxy Squid ( http://www.squid-cache.org/ ) are utilized to serve static content (images, JavaScript, CSS):

  • gc01.rcsin.sde.rogersdigitalmedia.com
  • gc02.rcsin.sde.rogersdigitalmedia.com
  • ... continues sequentially ...
  • gc06.rcsin.sde.rogersdigitalmedia.com

In order to SSH/SFTP to the machines listed above, first SSH (or create a tunnel via) noc.sde.rogersdigitalmedia.com:22 or jump.rdmi.ca:8222 .

Files

The production website has a root folder of:

/clients/broadcast/grammy.ca/current/webroot/

MySQL Database

The production website connects to the MySQL database:

Host: ? (?)
Username: ?
Password: [contact Infrastructure department]
Database: ?

Memcached

Memcached is utilized as an object cache, and is available in this environment at the location:

memcache01:?

Logs

In the production environment, PHP error logs can be found at this location:

/logs/php-fpm/?

Nginx server error logs can be found at the location:

/var/log/nginx/?

Finally, Nginx server access logs can be found at:

/var/log/nginx/?

Staging Environment

http://www.grammy.ca/ is currently served from the following front-end webservers:

  • stgnginx01.rcsin.sde.rogersdigitalmedia.com

Webservers running the caching proxy Squid ( http://www.squid-cache.org/ ) are utilized to serve static content (images, JavaScript, CSS):

  • stggc01.rcsin.sde.rogersdigitalmedia.com
  • stggc02.rcsin.sde.rogersdigitalmedia.com
  • stggc03.rcsin.sde.rogersdigitalmedia.com

In order to SSH/SFTP to the machines listed above, first SSH (or create a tunnel via) noc.sde.rogersdigitalmedia.com:22 or jump.rdmi.ca:8222 .

Files

The staging website has a root folder of:

/clients/broadcast/grammy.ca/current/webroot/

MySQL Database

The staging website connects to the MySQL database:

Host: stgdb01.nfs.sde.rogersdigitalmedia.com (192.168.122.26)
Username: ?
Password: ?
Database: ?

Memcached

Memcached is utilized as an object cache, and is available in this environment at the location:

stgmemcache01:?

Logs

In the staging environment, PHP error logs can be found at this location:

/logs/php-fpm/?

Nginx server error logs can be found at the location:

/var/log/nginx/?

Finally, Nginx server access logs can be found at:

/var/log/nginx/?

Development Environment

http://int-www.grammy.ca/ is currently served from the following load balanced front-end webservers:

  • devnginx01.rcsin.sde.rogersdigitalmedia.com

Webservers running the caching proxy Squid ( http://www.squid-cache.org/ ) are utilized to serve static content (images, JavaScript, CSS):

  • devgc01.rcsin.sde.rogersdigitalmedia.com
  • devgc02.rcsin.sde.rogersdigitalmedia.com
  • devgc03.rcsin.sde.rogersdigitalmedia.com

In order to SSH/SFTP to the machines listed above, first SSH (or create a tunnel via) noc.sde.rogersdigitalmedia.com:22 or jump.rdmi.ca:8222 .

Files

The development website has a root folder of:

/clients/broadcast/grammy.ca/current/webroot/

MySQL Database

The development website connects to the database:

Host: devdb01.nfs.sde.rogersdigitalmedia.com (192.168.120.213)
Username: ?
Password: ?
Database: ?

Memcached

Memcached is utilized as an object cache, and is available in this environment at the location:

devmemcache01:?

Logs

In the development environment, PHP error logs can be found at this location:

/logs/php-fpm/?

Nginx server error logs can be found at the location:

/var/log/nginx/?

Finally, Nginx server access logs can be found at:

/var/log/nginx/?

Deploying The Site

Deployment of this website is done via the Capistrano deployment scripts found in the continuous_integration project. If the project has been set up on the jump.rdmi.ca server for your SSH user, do the following to deploy to the chosen environment:

cd nextissue
bundle exec cap [environment] deploy

Where [environment] is found, use integration, staging or production.

Common Issues

I Need To Reset The Site URL

If you're (for instance) attempting to run a non-local copy of the website on your workstation, you may need to reset the URL the site believes it is located at by executing the query found below:

UPDATE wp_options SET option_value = 'http://localhost' WHERE option_name = 'siteurl' LIMIT 1;
UPDATE wp_options SET option_value = 'http://localhost' WHERE option_name = 'home' LIMIT 1;

I Need To Clear Memcache

Clearing memcached for the site by doing the following:

  1. Look up the server IP and port for the memcached server being used in that environment in the /config/ folder:

     // Enable object caching through Batcache and memcached.
     define('WP_CACHE', true);
     $memcached_servers = array(
     	'default' => array(
     		'192.168.220.250:11963'
     	)
     );
    
  2. Telnet to that memcached server:

     telnet 192.168.220.250 11963
    
  3. Once connected, type the following to flush the server:

     flush_all
    

The server should respond with "OK". You can now disconnect from the server (press ^] ) and the issue should be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment