Thursday, January 5, 2012

Setup Ubuntu server for PHP-MongoDB on Amazon AWS

This is a record of all the steps that I did to setup a Ubuntu server on Amazon AWS, primarily for PHP-Mongo setup with Apache2. I may consider nginx and fastcgi sometime later, but for now, will go ahead with Apache2.

AMI

AMI used is alestic-git-server-ubuntu-11.10-oneiric-amd64-20111017 (ami-dd73bfb4)


Packages Installed

Base Packages:

sudo apt-get -y install language-pack-en-base
sudo apt-get -y install unzip
sudo apt-get -y install python-setuptools
sudo apt-get install build-essential

PHP and Apache2:

sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5 php5-curl php5-gd php5-imap
sudo apt-get install php-pear php5-dev






MongoDB Install:

Steps as per http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10

Append the following line to /etc/apt/sources.list:
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

sudo apt-get update
sudo apt-get install mongodb-10gen

PHP and Python Drivers for MongoDB:

sudo pecl install mongo
Add "extension=mongo.so" in /etc/php5/apache2/php.ini and /etc/php5/cli/php.ini


sudo apt-get install python-dev
sudo easy_install pymongo

SunJava Install:

As per this link:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk

SVN and other Tools:

sudo apt-get install subversion
sudo apt-get install libapache2-svn
sudo apt-get install mpack              # For MIME Pack/unpack


Specific Packages/Modules for my App:


sudo a2enmod rewrite
sudo a2enmod actions
sudo pear install --alldeps Mail
sudo pear channel-discover pear.pearplex.net
sudo pear install pearplex/PHPExcel

wkhtmltopdf:
Install http://code.google.com/p/wkhtmltopdf/  including wkhtmltopdf, wkhtmltoimage and libwkhtmltox  to /usr/local/bin, /usr/local/lib and /usr/local/include

PHP and Python bindings for libwkhtmltox:
git clone git://github.com/mreiferson/php-wkhtmltox.git   and follow README
git clone git://github.com/mreiferson/py-wkhtmltox.git    and sudo python setup.py install


Misc:

sudo apt-get -y install fontconfig xfs
sudo pecl install uuid




No comments:

Post a Comment