User Tools

Site Tools


A brain-dump for setting up a Amazon AWS micro server for various uses.

Initial setup will be a build environment for various applications:

    • SMF
    • Magento
    • OpenCart
    • General Development
  • FreeSwitch


ami-6fa27506 - micro edition 0.02/hr  ~ 15-20/mo
8GB EBS (0.10/GB/mo + transactions)
x86_64 ubuntu
592MB Ram

apt-get update
apt-get upgrade
apt-get install php5-cli php5-common php5-gd php5-mysql php5-pgsql php5-sqlite sqlite3 php5-cgi spawn-fcgi

apt-get install postgresql-9.1 postgresql-client-9.1 postgresql-common postgresql-plpython-9.1 postgresql-server-dev-9.1 postgresql-plperl-9.1 postgresql-pltcl-9.1 libpq-dev

#if errors like
#PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/' - /usr/lib/php5/20090626/ cannot open shared object file: No such file or directory in Unknown on line 0
rm /etc/php5/cli/conf.d/sqlite.ini 

# for building nginx / freeswitch
apt-get install build-essential subversion git-core
apt-get install libpcre3 libpcre3-dev libpcrecpp0 zlib1g-dev libssl-dev

tar -zxf nginx-1.2.0.tar.gz
cd nginx-1.2.0
./configure --sbin-path=/usr/local/sbin --with-http_ssl_module
make; make install

# create a user for nginx
adduser nginx

#change ownership of the nginx directory 
chown -R nginx.nginx /usr/local/nginx
chmod -R 750 /usr/local/nginx
chown -R nginx.nginx /usr/local/bin/nginx
chmod -R 750 /usr/local/bin/nginx

#edit /usr/local/nginx/conf/nginx.conf
# edit user to run as
user nginx;
# add to server->location
        location ~ \.php$ {
            root           html;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/html/$fastcgi_script_name;
            include        fastcgi_params;
PID: /usr/local/nginx/logs/
kill `cat /usr/local/nginx/logs/`



apt-get install libncurses5 libncurses5-dev libjpeg-dev unixodbc unixodbc-dev autoconf automake libtool make pkg-config
apt-get install libcurl4-openssl-dev libexpat1-dev libgnutls-dev libtiff4-dev libx11-dev unixodbc-dev libssl-dev python2.6-dev zlib1g-dev libzrtpcpp-dev libasound2-dev libogg-dev libvorbis-dev libperl-dev libgdbm-dev libdb-dev python-dev uuid-dev bison snmp libsnmp-dev

# 224M checkout
git clone git://
cd freeswitch
# edit modules.conf, needs postgres if you enable pg_csv

./configure; make; make all install cd-sounds-install cd-moh-install
# !!! virtual memory exhausted: Cannot allocate memory !!!
# we need to make more temporary swap space!!!
dd if=/dev/zero of=/root/fakeswap bs=1024 count=1048576 
mkswap /root/fakeswap 
swapon /root/fakeswap 

swapoff /root/fakeswap
rm /root/fakeswap

# rerun config/make/make install


# Magento

apt-get install mysql-server mysql-client curl unzip
cloudhosting/amazonaws.txt · Last modified: 2012.10.13 18:51 (external edit)