easyengine auto-installer script for Nginx, MySql, PHP and WordPress and Wp-Super Cache

I am a fan of the CentminMod auto installer. This script auto-installs Nginx, PHP, MariaDB, NSD (DNS server) and several other necessities. Also, the author (eva2000) is a very helpful person and answers most questions promptly at WHT.

The Centmin Mod script works well and uses very less RAM. This comes very handy at times of traffic surges. On one of my sites with 1 GB RAM, I had 900+ concurrent visitors downloading a 2MB+ pdf files. However, my RAM usage did not cross 300MB and the VPS remained cool as a cucumber.

However, I gave up on the script and went back to apache because I couldn’t get any of the caching plugins like Quick Cache, WP Super Cache or Wp-Total Cache to work with Centmin Mod despite several attempts. Also, tweaking the configuration file for the WordPress permalinks to work is a bit of work (though it is not very difficult).

The way I see it, RAM is not such a problem nowadays, thanks to the falling prices. You can get a 512MB RAM SSD disk for just about $5 per month from reputed providers.

On the other hand, caching is very important and I find it makes a difference to the way the pages are served to the visitor. The pages are converted to html and fly out even at low internet speeds.

So, not able to get the cache plugins to work with nginx and Centmin Mod was a huge problem for me.

In the latest version of Centmin Mod, you can install the WP-FFPC Plugin Setup and ngx_pagespeed. Well, it is quite an effort (for a lay person like me). I did all that and found that there was no caching happening. The headers of the page show this:


[root@centminmod ~]# curl -I http://mydoamin.com
HTTP/1.1 200 OK
Server: nginx centminmod
Date: Sat, 19 Oct 2013 14:48:21 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
Cache-Control: no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0
Pragma: no-cache
Expires: Sat, 19 Oct 2013 14:48:21 GMT
X-Pingback: http://mydomain.com/xmlrpc.php
X-Page-Speed: 1.6.29.5-3346
You have new mail in /var/spool/mail/root
[root@centminmod ~]#

I am not convinced that there is any caching happening because it says


Cache-Control: no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0
Pragma: no-cache

Anyway, today, I stumbled on easyengine, an auto-installer script which loads nginx, php, mysql, postfix.

The installation was described to be so easy that I thought I was missing something or that there was a catch somewhere.

I couldn’t wait to try it and so I grabbed a 512 MB RAM VPS from Digital Ocean (you can get one for just a few hours).

Well, to my astonishment, just a few clicks later, I had a fully functional web server running nginx, php, mysql, postfix and wordpress.

The best thing is that the easyengine script even creates a vhost configuration file with the changes required for the WordPress permalinks to work.

Just go to your domain registrar and point the A address to the IP address and you are done.

Also, it auto-installs the nginx helper plugin which takes care of the incompatibilities between nginx and wordpress.

The biggest surprise was that when I installed the WP Super cache plugin, it worked without a hitch. If you peer at the html source of the page, you see the much-awaited






I never saw this with Centmin Mod.

Also, if you check the headers of the page you will see this:


root@easyengine:~# curl -I http://mydomain.com
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 19 Oct 2013 15:15:12 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
Vary: Accept-Encoding, Cookie
Cache-Control: max-age=3, must-revalidate
WP-Super-Cache: Served supercache file from PHP
X-Powered-By: EasyEngine
root@easyengine:~#

This proves that WP-Super Cache is working.

Anyway, so I fired up another Digital Ocean 512 MB VPS to load Centmin Mod (with WordPress) to see whether there were any differences in RAM usage between the two.

RAM usage with Centmin Mod


[root@centminmod ~]# free -m
total used free shared buffers cached
Mem: 499 356 142 0 99 173
-/+ buffers/cache: 83 415
Swap: 0 0 0
[root@centminmod ~]#

RAM usage with easyengine


root@easyengine:~# free -m
total used free shared buffers cached
Mem: 495 486 9 0 31 300
-/+ buffers/cache: 154 341
Swap: 0 0 0
root@easyengine:~#

I can’t see much difference. Both are low consumers of RAM.

In both Centmin Mod and easyengine, if you want to install wordpress in a folder (apart from the root), you have to add a location block to the vhost configuration file.

I Centmin Mod, the vhost file is to be found in /usr/local/nginx/conf/conf.d/mydomain.conf

In easyengine, the vhost file is at /etc/nginx/sites-available/mydomain.com

Just add the following location block


location /WP1 {
try_files $uri $uri/ /WP1/index.php?q=$uri$is_args$args;

}

for each wordpress folder. Change WP1 with the folder name.

reload nginx with the command


service nginx restart

(Centminmod) and


nginx -t && service nginx reload

(easyengine) and the permalinks work perfectly.

I have decided to go back from apache to nginx with the help of easyengine. Lets see how it goes in practice.

UPDATE:

When I loaded easyengine onto a 1GB RAM VPS, I ran into a peculiar problem that I have not had in the 512 MB VPS:


root@easyengine:~# nginx -t && service nginx reload
nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
nginx: configuration file /etc/nginx/nginx.conf test failed

Well, thanks to mariusv.com, the problem is solved by going to


nano /etc/nginx/nginx.conf

Find the line


# server_names_hash_bucket_size 64;

Remove the # sign and increase the size to 128

Now when you reload


root@easyengine:~# nginx -t && service nginx reload
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Reloading nginx configuration: nginx.
root@easyengine:~#

It works!!

2 thoughts on “easyengine auto-installer script for Nginx, MySql, PHP and WordPress and Wp-Super Cache

  1. Binh Nguyen

    I'm looking for comparison of EasyEngine vs Centmin and found this very detailed article. Thank you!

    But just 1 notice: 356 vs 486 RAM usage between the 2 are at 25% difference. So you can't just say both are the same. Hope to reconsider that statement.

    Other than that: thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *