-
Notifications
You must be signed in to change notification settings - Fork 6
EC2 Server Setup
Ronald Bradford edited this page Jul 8, 2013
·
19 revisions
Current Running server is at http://ec2-54-225-105-243.compute-1.amazonaws.com
Built on Ubuntu 12.10 with AMI: ami-0cdf4965 http://cloud-images.ubuntu.com/locator/ec2/
# OS Upgrade $ sudo apt-get update $ sudo apt-get upgrade -y
# OS Utilities $ sudo apt-get install -y git-core imagemagick
# LAMP Stack/ Dev Stack $ sudo apt-get install -y python-dev python-pip ruby1.9.1 bundler $ sudo apt-get install -y memcached libmemcached-tools python-pylibmc ruby-memcache-client
# Mongo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | sudo tee -a /etc/apt/sources.list.d/10gen.list sudo apt-get update sudo apt-get install -y mongodb
# Specific Libraries sudo apt-get install -y python-numpy python-scipy python-networkx sudo pip install astropysics pymongo requests BeautifulSoup tweepy
# Rails sudo gem install passenger sudo apt-get install -y libcurl4-openssl-dev # Has cursors prompts sudo passenger-install-nginx-module # Press Enter to continue, or Ctrl-C to abort. # sudo dd if=/dev/zero of=/swap bs=1M count=1024 # sudo mkswap /swap # sudo swapon /swap # Press Enter if you want to continue with installation anyway. # Enter your choice (1 or 2) or press Ctrl-C to abort: # Please specify a prefix directory [/opt/nginx]: # Press ENTER to continue.
cd /tmp wget -O init-deb.sh http://library.linode.com/assets/1139-init-deb.sh sudo mv init-deb.sh /etc/init.d/nginx sudo chmod +x /etc/init.d/nginx sudo /usr/sbin/update-rc.d -f nginx defaults sudo /etc/init.d/nginx start
NGINX Configuration
$ vi /opt/nginx/conf/nginx.conf ... server { listen 80; server_name _; root /home/spacecalnyc/betterspacecal/public; passenger_enabled on; ...
Error Management
$ tail -f /opt/nginx/logs/error.log $ tail ~spacecalnyc/betterspacecal/log/production.log
Code Deployment
$ cd $ git pull $ cd betterspacecal $ bundle $ rake assets:precompile $ sudo /opt/nginx/sbin/nginx -s reload