Nginx and PHP on Ubuntu 10.10

Taken from the steps at http://www.howtoforge.com/installing-nginx-with-php5-and-mysql-support-on-ubuntu-9.04, but with some modifications.

To install Nginx in Linux

$sudo apt-get install nginx

Also install PHP at the mean time

$sudo apt-get install php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

add the line cgi.fix_pathinfo = 1 right at the end of the file php.ini

$vim /etc/php5/cgi/php.ini

Then install lighttpd

$sudo apt-get install lighttpd

$sudp update-rc.d -f lighttpd remove

$sudo /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php5-cgi

add the above line to for next boot up

$sudo vim /etc/rc.local

 

After that make changes to the conf files at /etc/nginx/nginx.conf and related files in site-available folder. Steps are similar to the pointed link.

Advertisements