To start with I used a clean version of Ubuntu 10.10 (Desktop). Adjust if needed for Ubuntu Server but the steps should really work the same with the exception you most likely won’t be running a browser on Ubuntu Server.
The first step is to update and install Aptitude if you don’t have it already. From there I’ll install Nginx and get it running.
$ sudo apt-get update $ sudo apt-get install aptitude $ sudo aptitude install nginx $ sudo /etc/init.d/nginx start
Open a browser to this address and verify Nginx is working.
Next I’ll install PHP-FPM:
$ sudo aptitude install php5-fpm
Note: The configuration file for Nginx is located at: /etc/nginx/nginx.conf
Now we need to edit the vhost file:
$ sudo pico /etc/nginx/sites-available/default
Use the following screenshots to see what I’ve done.
Save the file and exit pico (or whatever editor your using).
Next we can add some PHP modules (modify as you wish) and create an info.php file to test with.
$ sudo aptitude install php5-cgi php5-dev php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ps php5-pspell php5-recode php5-snmp php5-tidy php5-xmlrpc php5-xsl php5-common php5-mysql $ sudo pico /var/www/info.php
The contents of php.info as as follows:
<?php phpinfo(); ?>
Restart Nginx and PHP-FPM:
$ sudo /etc/init.d/nginx restart $ sudo /etc/init.d/php5-fpm restart
Load the info.php file located here.