Still use Apache Server? .. is outdated.

Use Nginx, especially if one package with PHP-FPM for PHP Handler is guaranteed perfect. Web will feel light, although thousands of visitors will not feel anything. Coupled with module memchache + cloudflare getting more light again.

nginx performanceNginx is widely used by large webs that have thousands of visitors. The reliability is unquestionable. Nginx is able to work with low RAM memory support and does not spent high CPU power. However, the common Nginx problem is not working on the Rewrite module. That’s because Nginx does not read .htaccess, unlike Apache which has the Rewrite facility through .htaccess. Nginx has a special code in order to rewrite.

Joomla and WordPress will fail loading while reading the rewrite code on nginx. The message “Error 502” will appear. Well, how do I get Joomla and WordPress running on Nginx? I will share it here.

Here I am using Nginx Web Server from Centmin Mod, which has active development and extensive forum support. Many other modules, such as VPSSIM, or LEMP Stack, which provides Nginx installation facilities. But, I’ve tried everything, and finally dropped the option on Centmin Mod.

Nginx Install

The OS I use is Linux Centos 6 64 bit. For installation of Centmin Mod (Nginx Stack) is as follows:

1. Login to root with Putty or Bitvise SSH.
2. Enter the command to install Centmin:

cd /usr/local/src

curl -sL | bash

The system will automatically download and install Centmin Mod (Nginx + PHP-FPM and various other modules, such as Memcache, APC, and more.) Wait until it’s done (pretty old approx 30 minutes).
(After install centmin, to install wordpress, step by step can be seen completely in this link And, for phpmyadmin in this link).

3. Once done, open the igbinary.ini file that is on


or you can use

nano /etc/centminmod/php.d/igbinary.ini

4. Edit line session.serialize_handler = igbinary, add mark; (semicolon) in front of it, becomes like this:




Save with CTRL + O command and exit with CTRL + X command.
The function of this command is that Joomla and WordPress can go to Backed or Administrator. Without edit igbinary.ini Joomla and WordPress will not be able to login to the backend.

5. Find the Nginx vhost file for the domain you entered, for example in the /usr/local/nginx/conf/conf.d folder

Coding Section

6. Edit and enter the following code, so the full code will look like this:

server {


server_name_in_redirect off;


# ngx_pagespeed & ngx_pagespeed handler

#include /usr/local/nginx/conf/pagespeed.conf;

#include /usr/local/nginx/conf/pagespeedhandler.conf;

#include /usr/local/nginx/conf/pagespeedstatslog.conf;


# limit_conn limit_per_ip 16;

#ssi  on;


access_log /home/nginx/domains/ combined buffer=32k;

error_log /home/nginx/domains/;


root /home/nginx/domains/;


location / {


#block common exploits, sql injections etc

#include /usr/local/nginx/conf/block.conf;


# Enables directory listings when index file not found

#autoindex  on;


# Shows file listing times as local time

#autoindex_localtime on;


# Enable for vBulletin usage WITHOUT vbSEO installed

#try_files         / /index.php;

try_files $uri $uri/ /index.php?q=$request_uri;


#pass php files to fastcgi

location ~ \.php$



fastcgi_index index.php;

include /usr/local/nginx/conf/fastcgi_params;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

#set expires to 0 to stop caching of php files

expires 0;


location ~ ^/


#set expires to 30d to cache static files

expires 30d;

#file doesn’t exist, will need to be sent to php

if (!-e $request_filename)


rewrite ^/(.*)$ /index.php?q=$1 last;



# caching of files

location ~* \.(ico|pdf|flv)$ {

expires 1y;


location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ {

expires 14d;


include /usr/local/nginx/conf/staticfiles.conf;

include /usr/local/nginx/conf/php.conf;

include /usr/local/nginx/conf/drop.conf;

#include /usr/local/nginx/conf/errorpage.conf;



Note: replace with the domain name you entered.

7. Finally, enter the comment Chown -R, Folder Permission 755.

cd  /home/nginx/domains/

chown -R nginx:nginx public

Already completed. Your Joomla or WordPress will run seamlessly on Nginx web server and can rewrite as in Apache. So for the SEO problem there will be no problem.

read also page not found error with nginx

Speed Comparrison

between using Apache Web Server with the following Nginx this is result revealed:

Apache Web Server and Cpanel

comparrison nginx and apache

With Nginx without Cpanel

After using Nginx without the Control Panel, the speed becomes under 2 seconds ..wooow, and without the errors “Internal Server Error” is very disturbing if using Apache Web Server:

nginx vs apache


4/5 (1 Review)


  1. I’ve been surfing online more than 3 hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. Personally, if all website owners and bloggers made good content as you did, the web will be a lot more useful than ever before.

  2. I like this post, enjoyed this one appreciate it for posting. “To affect the quality of the day that is the art of life.” by Henry David Thoreau.

  3. When I originally commented I seem to have clicked on the -Notify me when new comments are added- checkbox and now whenever a comment is added I receive 4 emails with the exact same comment. Is there a way you can remove me from that service? Appreciate it!

  4. I love reading through a post that will make men and women think. Also, many thanks for allowing me to comment!


Please enter your comment!
Please enter your name here