Installing WordPress on nginx is a bit tricky. The major advantage over Apache is with lower RAM WordPress runs faster on nginx.We will install nginx on Debian Linux. Previously we have published about nginx HTTP Server and most important side guide of this guide on Installing WordPress on nginx on Rackspace Cloud Server is our previous guide how to install WordPress on Rackspace Cloud Server. We used Apache HTTP server in that tutorial.
Installing WordPress on nginx on Rackspace Cloud Server : FAQs
- In this tutorial on Installing WordPress on nginx on Rackspace Cloud Server why we have used Debian 6.0 (Squeeze) ? The reason is we believe Debian performs better.
- Is there any difference in commands with Cent OS / Red Hat ? Basically the commands are almost same but quite obviously you need to modify to suite for other Linux distro.
- What is the minimum RAM needed to Installing WordPress using nginx ? 256 MB will work. We usually start with higher RAM to make the process faster while Installing WordPress, then scale it down. 512 MB will be better in our opinion.
- Will the process differ if I use other than Rackspace ? For Media Template it will almost the same. Others is at your own modification and risk.
Steps for Installing WordPress Installing WordPress on nginx on Rackspace Cloud Server
Please read the things written previously on installing WordPress on Rackspace Cloud Server (Apache one), stop where the paragraph with subheader “The actual command steps to install WordPress on Rackspace Cloud Server” is starting. Before this paragraph, everything is same for Installing WordPress on nginx except, choose Debian 6.0 as OS :
Proper Steps for Installing WordPress on nginx on Rackspace Cloud Server
We will install MySQL first. Some prefers to install FastCGI first for Installing WordPress on nginx with other distro. You can follow that method too, but please do not mix up steps of these two methods for Installing WordPress.
Install MySQL :
apt-get install mysql-server mysql-client
It will ask to set password. Use some password and write it in notepad or some text editor.
Install nginx on Debian :
Simple process as for Debian nginx is a package :
apt-get install nginx
Quite obviously start the server :
Create www folder :
Followed by :
chown www-data:www-data /var/www
Install PHP 5 :
I have said before, some prefers to install FastCGI first. So type this very big one to install everything needed. The advantage with
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
Please note with pear there is no 5. i.e. its php-pear.
So our work is almost done. Open php.ini file and Edit in vi Editor :
Delete the things before the line cgi.fix_pathinfo=1 ; we have made it truly active direction now. Search with vi Cheat in Google to get the commands to change / edit in vi editor.
Install lighttpd :
apt-get install lighttpd
Install php-apc :
apt-get install php-apc
Less than 5 minutes for Installing WordPress :
If your domain’s name is arpitasarkar.com, then the first thing needed is to create a suitable web folder :
mkdir -p /var/www/www.arpitasarkar.com/web
Quite obviously you have to change the domain name and extension. You can open that domain name and you will get error. Fine. Because there is nothing.
As like our previous tutorial, first go to some other place, like tmp :
Download WordPress :
Uncompress it :
tar xvfz latest.tar.gz
Move it to public folder :
Change where you are :
Move it :
mv * /var/www/www.arpitasarkar.com/web/
Create MySQL database :
The typical syntax is :
mysqladmin -u root -p create databasename
datbasename is your desired database name. It will ask for password. It is that password which we said to keep at hand while installing MySQL.
Go to MySQL :
mysql -u root -p
GRANT ALL PRIVILEGES ON databasename.* TO ‘databaseusername‘@’localhost’ IDENTIFIED BY ‘databaseuser-password‘;
Done. Type quit; to quit from MySQL.
So everything is ready. Simply run the WordPress installation script on browser like : arpitasarkar.com/wp-admin/install.php and it will say that there is no wp-config file. As we have the needed data, simply add them and run the installation script.