how to install shapado on amazon ec2?
Wayne Price
This was put together from multiple sources and may contain redundant or bogus commands but it did work when I put it together. :) Assuming that you are already set up on ec2 and know how to run an instances, here are the steps that I took:
I am using ami-bb709dd2 . See http://alestic.com/ It is Ubuntu 9.10 server 32-bit.
If this is for development, make sure that you set up the security group to allow port 3000 for network 0.0.0.0/0
After it is up and running, connect with putty and type the following: (these can probably be scripted later)
sudo apt-get -y update
sudo apt-get -y dist-upgrade
sudo apt-get -y install git-core
sudo apt-get -y install rake
echo Installing tools...
sudo apt-get -y install ruby rails rubygems libopenssl-ruby ruby-dev
sudo apt-get -y install apache2 libapache2-mod-fcgid libfcgi-ruby1.8
sudo a2enmod ssl
sudo a2enmod rewrite
sudo a2enmod suexec
sudo a2enmod include
sudo /etc/init.d/apache2 force-reload
sudo gem install haml faker --no-rdoc --no-ri
sudo gem install rails --no-rdoc --no-ri
echo Installing mongo...
cd /opt
sudo mkdir -p /var/lib/mongodb/data
sudo wget http://downloads.mongodb.org/linux/mongodb-linux-i686-latest.tgz
sudo tar xfz mongodb-linux-i686-latest.tgz
The next command will change depending on the version you downloaded.
sudo mv mongodb-linux-i686-2010-03-25/ mongodb/
sudo useradd -M -s /bin/false mongodb
sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo -u mongodb nohup mongodb/bin/mongod --dbpath /var/lib/mongodb/data > /dev/null &
echo Installing shapado...
sudo mkdir /var/rails
sudo chown -R www-data:www-data /var/rails
cd /var/rails
sudo su -m www-data
Sometimes the next command would error and you have to run it twice.
git clone git://gitorious.org/shapado/shapado.git shapado
exit
sudo cp shapado/config/shapado.sample.yml shapado/config/shapado.yml
Edit shapado.yml so that the development domain is your ec2 server name.
cd /var/rails/shapado
sudo rake gems:install
sudo rake asset:packager:build_all
sudo script/update_geoip
sudo rake bootstrap
sudo script/server
go to your ec2 server in your browser. something like: http://ec2-184-73-12-110.compute-1.amazonaws.com:3000/ login in as admin/admins
enjoy!!
