Installing Nginx With PHP5, MySQL on Rackspace Cloud Server using Debian Sqeeeze needs only few steps. This guide is for Next Generation Cloud Servers. If you need for WordPress, you can follow this guide keeping in mind it is for old generation Cloud, so the screenshots are different from this one. And you can read about nginx HTTP Server Basics if you are relatively new to follow this guide for installing Nginx With PHP5, MySQL.
Factors those are considered as taken in this guide on Installing Nginx With PHP5, MySQL on Rackspace Cloud Server
On this guide for installing Nginx With PHP5, MySQL on Rackspace Cloud Server, we are taking that you are not a beginner and know about Command Line Interface and basics of how to use PuTTY on Windows. This is actually for the developers who want use and configure the server for other usages.
Its obvious that, you can install WordPress or Magento like CMS with few extra steps.
Steps for Installing Nginx With PHP5, MySQL on Rackspace Cloud Server
Spin up a server from your new generation Rackspace Cloud Control Panel, we will use Debian Squeeze :
Copy Paste the password on any text editor like notepad. Please use PuTTY for Windows OS and terminal for the others. Login as root and use that password and in case of PuTTY it will look like this :
Perform an update :
Within few minutes it will be updated. I will suggest to do an restart from Control Panel. It is not mandatory.
Install the MySQL parts :
apt-get install mysql-server mysql-client
You will be prompted for an password. Use your own password.
Next install nginx :
apt-get install nginx
After nginx is installed, start it :
Create www folder and assign as public folder :
chown www-data:www-data /var/www
Install PHP packages :
apt-get install php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
Open php.ini :
And, make cgi.fix_pathinfo=1 as active :
You can now login via SFTP software like WinSCP and go to /var/www/ and create an file named index.html to test with your IP :
You can open that index.ligttpd.html file and paste its content in the index.html file. Open your IP on your Browser, ot should show what you have done with index.html file. In our case it is the content of index.ligttpd.html file :
We have not done few configurations on this guide for Installing Nginx With PHP5, MySQL on Rackspace Cloud Server as the guide is nonspecific and is dependent on your usage. PHP FastCGI daemon is not listening on port 9000 – keep it in mind.
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid
This will make it listening. But you need to add it to rc.local to make it automated after reboot process.