Nginx install script, PHP 5.3.6 (php-fpm), MariaDB 5.2.6, Xcache v1.3.1, Memcached server, CSF firewall, Siege Benchmark

Centmin Nginx install script for CentOS servers by BTCentral was mentioned previously here. I’ve modified the script to suit my needs for Nginx v1.0.2 web server installations on CentOS 5.5 64bit environments, adding MariaDB 5.2.6 MySQL, Xcache v1.3.1, Memcached 1.4.5 servers, CSF Firewall as well as Siege benchmark script support. Note this modified version is for CentOS 5.x 64bit environments and you can update the version numbers in script itself when new versions come out i.e. Nginx v1.0.3, PHP 5.3.7, MariaDB 5.2.7 etc.  Update: Centmin modified version has been updated and is now available here.


June 5th, 2011

  • updated to Nginx v1.0.4

June 6th, 2011

  • My modified version v0.4.2 released to update url download link.
  • Official Centmin v1.2.0 has been released incorporating alot of my modifications minus Memcached server though. Official Centmin v1.2.0 cleaned up my code so it works with both CentOS 32bit and 64bit OS systems so I recommend you use that version when you can from here. I’ll be basing future modifications and additions on official Centmin v1.2.0 script 🙂

June 9th, 2011


Note: that Centmin script is meant for freshly installed virgin CentOS 5.x 64bit based servers and has only been tested on such. If you try this script on existing server, it’s unknown what the effects are.

Please test the script on a test server before using on a live production server. There’s no support for the modified Centmin script. Script is provided as is.


I made 5 sets of changes grouped below:

v1.1.0mod3.2 eva2000 custom based on v1.1.0 – 06/06/2011

  • Updated download link as no longer maintained at address but at

v1.1.0mod3.1 eva2000 custom based on v1.1.0 05/06/2011

  • Updated for Nginx v1.04
  • Added PCRE 8.12
  • Fixed nginx init.d script path for chmod +x
  • Added Siege Sproxy
  • Updated some wget lines to original v1.1.0 centmin and nginx custom modules to check for existing file to determine if downloading is needed

v1.1.0mod3 eva2000 custom based on v1.1.0  19/05/2011

  • Added Siege benchmark script  simple 10 concurrency with 10 rep test with default 1 second delay between: siege c 10 r 10 d 1 localhost/index.html
  • check history of seige benchmark runs: tail 25 /usr/local/var/siege.log
  • Tweaked nginx.conf settings some more


v1.1.0mod2 eva2000 custom based on v1.1.0  18/05/2011

  • Modified script end deletion routine to ask if user wants to delete script after installation. Might be useful to leave script contents intact to be able to rerun compile options etc to troubleshoot and diagnose errors after installation
  • Added CSF firewall script
  • Added libevent v2.0.10, memcached v1.4.5 and memcache v3.0.6 install routine
  • Added config/memcached/memcached startup script
    2x memcached servers each with 16MB memory on ports 11211 and 11212
  • Added memcache.php admin page default username/password = user/pass to /usr/local/nginx/html/memcache.php
  • Fixed php.ini date.timezone defaults to Australia/Brisbane via sed replacement
  • Altered nginx.conf and virtual.conf to use drop.conf, php.conf and staticfiles.conf inclusions to clean up config files


v1.1.0mod eva2000 custom based on v1.1.0  16/05/2011

  • Changed script to install MariaDB 5.2.6 MySQL 64bit instead of MySQL standard versions
  • Changed Nginx configure options with addition options and Google Perftool tcmalloc support
  • Changed PHP 5.3.6 phpfpm installation to compile from source with additional options
  • Both Nginx and PHP compiled with OpenSSL 1.0.0d support instead of OpenSSL 0.9.8e
  • Changed config/phpfpm/www.conf to config/phpfpm/phpfpm.conf with adjusted options
  • Added xcache v1.3.1 installation option
  • Added config/mysql/my.cnf tuned for MariaDB 5.2.6
  • Added config/xcache/xcache.ini settings for Xcache v1.3.1
  • Added config/nginx/fastcgi_params with buffer tuning
  • Added php support to default server in config/nginx/nginx.conf
  • Removed fastcgi_intercept_errors on; options in virtual.conf as already added to fastcgi_params include file
  • Added additional checks in php containers in virtual.conf
    try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$;


             total       used       free     shared    buffers     cached
Mem:          3270        838       2431          0         29        602
-/+ buffers/cache:        206       3063
Swap:         5279          0       5279
top - 17:18:21 up 1 min,  2 users,  load average: 0.73, 0.29, 0.10
Tasks: 144 total,   1 running, 143 sleeping,   0 stopped,   0 zombie
Cpu(s):  4.1%us,  2.6%sy,  0.0%ni, 69.7%id, 21.6%wa,  0.5%hi,  1.5%si,  0.0%st
Mem:   3348500k total,   858560k used,  2489940k free,    30440k buffers
Swap:  5406712k total,        0k used,  5406712k free,   616896k cached
nginx: nginx version: nginx/1.0.2
nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50)
nginx: TLS SNI support enabled
nginx: configure arguments: --sbin-path=/usr/local/sbin --conf-path=/usr/local/nginx/conf/nginx.conf --with-http_ssl_module
--with-http_gzip_static_module --with-http_stub_status_module --with-http_sub_module --with-http_addition_module
--with-http_secure_link_module --with-http_flv_module --with-http_realip_module --add-module=../ngx-fancyindex-0.3.1
--add-module=../ngx_cache_purge-1.3 --add-module=../nginx-accesskey-2.0.3 --with-google_perftools_module
--with-openssl=../openssl-1.0.0d --with-ld-opt=-ltcmalloc_minimal
PHP 5.3.6 (cli) (built: May 19 2011 16:54:07)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
    with XCache v1.3.1, Copyright (c) 2005-2010, by mOo
Configure Command =>  '../configure'  '--enable-cgi' '--enable-fpm'
'--with-mcrypt' '--with-mhash' '--with-zlib' '--with-gettext' '--enable-exif' '--enable-zip' '--with-bz2' '--enable-soap' '--enable-sockets' '--enable-sysvmsg'
'--enable-sysvsem' '--enable-sysvshm' '--enable-shmop' '--with-pear' '--enable-mbstring' '--with-openssl=/usr/local' '--with-mysql=/usr/bin/'
'--with-libdir=lib64' '--with-mysqli=/usr/bin/mysql_config' '--with-mysql-sock' '--with-curl' '--with-gd' '--with-xmlrpc' '--enable-bcmath' '--enable-calendar'
'--enable-ftp' '--enable-gd-native-ttf' '--without-sqlite'
'--disable-pdo' '--with-fpm-user=nginx' '--with-fpm-group=nginx'
Client API version => 5.2.6-MariaDB
Client API library version => 5.2.6-MariaDB
Client API header version => 5.2.6-MariaDB
mysqladmin  Ver 9.0 Distrib 5.2.6-MariaDB, for unknown-linux-gnu on x86_64
Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc,
2009 Monty Program Ab
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Server version          5.2.6-MariaDB-mariadb101
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/lib/mysql/mysql.sock
Uptime:                 49 sec
Threads: 1  Questions: 1  Slow queries: 0  Opens: 15  Flush tables: 1  Open tables: 8  Queries per second avg: 0.20
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 26623
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 63536
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) unlimited
cpu time               (seconds, -t) unlimited
max user processes              (-u) 26623
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
/usr/local/bin/memcached -d -m 16 -l -p 11211 -c 2048 -t 4 -n 48 -f 1.05 -u nobody
/usr/local/bin/memcached -d -m 16 -l -p 11212 -c 2048 -t 4 -n 48 -f 1.05 -u nobody


MaxCDN Site Acceleration

Get Cost Effective Content Delivery
Unbeatable speed, stats, & price


  1. Hi George

    Thanks for this customised version of centmin, I tried the “original” but much prefer your version. As I run a 32-bit CentOS server I modified the script to work with i386 packages instead of 64 bit and have successfully setup my small VPS. The only thing I need to get working os CSF on my Virtuozzo based server, it is a little more invloved than just installing through this script

    Once thing is not clear in all this though is how to use the “additional” bits added to the script, such as memcache and siege – any pointers? Oh, at the xcache admin side, where does one find that now this script installed all the goodies?


  2. Hey Bruce 🙂

    Memcached server was setup for vB databasestore cache usage in mind As to other apps using memcached server would have to take it up with those script authors and if they coded their scripts to use memcached. For example following script in one way or another support memcached server caching, wordpress and wordpress plugins like W3 Total Cache, vBulletin datastore caching, Xenforo forums, OpenX ad server, Drupal via drupal modules etc. You’d need to read the script’s documentations to see how to utilise Memcached server.

    As to xcache admin side instructions same as listed at but I’m working on Centmin v1.2.0-eva2000 modified script based on new v1.2.0 to do this during installation. Just testing the modifications right now.

    Currently list of changes to my modified version I am testing based on Centmin v1.2.0 new release:

    v1.2.0-eva2000.01 – 09/06/2011
    – Set MariaDB 5.2.x as default MySQL server installation
    – Updated download link
    – Added Memcached server, libevent
    – Added Memcache PHP extension – please leave at v3.0.5, v3.0.6 doesn’t seem to work
    – Added Python 2.7.1 installed /opt/python2.7.1 leaving CentOS Python 2.4.3-43 intact
    – Updated Nginx FancyIndex module download link to Gitorious archive tarball
    – Changed APC Cache from YUM based install to compiled from source
    – Added APC cache myapc.php admin page at /usr/local/nginx/html/myapc.php
    – Added config/apc/apc.ini APC cache settings file
    – Added xcache admin directory to /usr/local/nginx/html/myxcacheadmin/ you need to read config/xcache/xcache_admin_setup_instructions.txt for xcache admin user/pass changes procedure
    – Added xcache admin password setup routine
    – Fixed PHP configure error: Cannot find OpenSSL’s libraries
    – Fixed Xcache compile error: Cannot find autoconf
    – Fixed Extras/ nginx version read variable ${ngver}

    As to Siege benchmark, read manual at

    Heads up: first release of my modified Centmin v1.2.0 released

  3. Hi George

    Thanks for the info on memcache etc, very helpful. I also like what I see in your revised version of the script. I downloaded it and tried it out, works perfectly on my 32 bit test CentOS install. I am currently trying to create a very custom script using your version of centmin combined with parts of the iRedMail script.

    I intend to replace my cpanel based server with whats results from the script…. if it all works!

    Keep up the great work, I am suitably impressed with what you continually come up with!


  4. Bruce, glad to see it working for you 🙂

    Working on an experimental version to add manual upgrade options for nginx, php, xcache and apc.


    To Install – JUST RUN chmod +x ./ && ./ install
    To Upgrade Nginx – RUN ./ nginxupgrade
    To Upgrade PHP – Run ./ phpupgrade
    To Reinstall Xcache – Run ./ xcachereinstall
    To Reinstall APC – Run ./ apcreinstall
    To Standalone install Xcache – Run ./ installxcache
    To Standalone install APC – Run ./ installapc

    As when you upgrade PHP, you may need to recompile Xcache or APC.

  5. When you say a “virgin” Centos what do you choose for the packages at install?

  6. StrayDawg, well really what i mean is don’t select apache or mysql installation related packages if possible or don’t re-run a 2nd time after already using it to install software a first time.

  7. Hi,

    I have installed a new version of centmin. Unfortunately I am having a annoying problem after the installation. The server is btw. the same as my other one in terms of specifications.

    The problem is, is that after installation only content of user nginx:nginx can be shown. I tried adding my user to the group nginx, but still same problem. I get a 404 error..

    When chown it back to nginx:nginx it works again.


  8. xda, that’s how it’s meant to work as far as i know with nginx:nginx for all content. I think what you’re looking for is setting up nginx with chroot environment where each user is within their own environment. Never setup nginx in chroot environment before and certainly not how original or my modded version is setup.


  1. Nginx install script, PHP 5.3.6 (php-fpm), MariaDB 5.2.6, Xcache v1.3.2, Memcached server, CSF firewall, Siege Benchmark, Python 2.71 | - [...] has been updated and released incorporating alot of my modifications which were made to Centmin v1.1.0 base here. I’ve…

Leave a Comment