Skip to content

Server Config and debugging

Saurabh Kumar edited this page Nov 25, 2014 · 1 revision

Debugging:

Nginx

Nginx is the proxy server that routes HTTP traffic. It should start automatically if the EC2 server restarts.

If you need to start/restart nginx, log in to the webserver and do:

sudo service nginx restart

If nginx misbehaves, logs are at:

/var/log/nginx/

If, for some reason, you need to look at the nginx conf it's at:

sudo vi /etc/nginx/sites-available/<APP_NAME>.conf

Memcached

Memcached is also a service and starts automatically if the EC2 node restarts. Unless you've designed a monstrosity, your site should also continue to function if it dies (just be slow). Caching issues can sometimes cause weird page content, so if something seems unusually bizarre try flushing the cache by restarting memcached:

sudo service restart memcached

Memcached is pretty fire and forget...since it's in memory it's theoretically possible it could fill up and exhaust the memory on the webserver (I don't have a size cap and I make my TTL's very long) but that has never happened so far. If it does, just reset memcached and it will clear itself out.

Glossary

AMI -- An "AMI" is an Amazon Machine Image, i.e. a re-loadable snapshot of a configured system.

CLI -- command line interface. Amazon gives us a set of new command line "verbs" to control AWS.

EC2 -- Elastic Compute Cloud, Amazon's virtual server farm.

AWS -- Amazon Web Services, the umbrella of the many individual cloud services Amazon offers

DSL -- Domain specific language. Aka a crazy mangled version of Ruby customized to describe service configuration.

VCS -- Version control system, e.g. git or SVN or mercurial