Nginx install script, PHP 5.3.17 (php-fpm), MariaDB 5.2.12, Xcache v2.0.1, APC 3.1.13, Memcached server, CSF firewall, Siege Benchmark, Python 2.72

Centmin v1.2.0 – Nginx install script for CentOS servers by BTCentral has been updated and released incorporating alot of my modifications which were made to Centmin v1.1.0 base here. I’ve updated my modifications to use Centmin v1.2.0 and higher as a base. Centmin v1.2.0 has fixed my modifications to work with both CentOS 32bit and 64bit servers.


Update: 2013

Centmin Mod project FAQ, Change Log and other updates are now all listed on their own web site at You’ll find latest stable version listed in Change Log and latest beta version being tested on Centmin Mod Google+ Community.


Update: October 8th, 2011

Centmin Mod project gets own domain name: (runs on 3x load balanced Centmin Mod Nginx based web servers 🙂 ). Will eventually transition the download link to

Update: October 5th, 2011

Centmin Mod get’s it’s own logo. I used Denmark font for the text 🙂

Centmin Mod Logo

Update: September 24th, 2011

Menu based custom Centmin installer script has been officially released. Starting with Centmin 1.2.1-eva2000.14, you will be able to use a menu based Centmin installer. Just to clarify with the new menu version you DO NOT need to do a full reinstall again, you just download new centmin menu version and extract and run and DO NOT touch option #1, just run option #4 for nginx upgrade and #5 for php upgrade if need be.

As stated in comment replies below, I held off adding addition features to my custom Centmin version until I implemented a menu system. I finally got around to implementing a menu system and have started adding additional menu features to beta versions and then to final public release.

You can now recompile Xcache, APC and Memcached servers as well as upgrade Nginx, PHP, and MariaDB 5.2 MySQL. I’ve also added a menu option to add domain names to Nginx virtual host configuration and adding domain names to NSD name server – automatically creating the nsd.conf zone entry and NSD dns zone file. New installations also automatically setup log rotation for Nginx and PHP-FPM log files. If you are using older Centmin 1.2.1-eva2000.xx release there’s also menu options #14 and #15 which setup logrotate for you.

Centmin menu below:

Centmin 1.2.2-eva2000.20 -
                   Centmin Menu
1).  Centmin Install
2).  Add Nginx vhost domain
3).  NSD setup domain name DNS
4).  Nginx Upgrade
5).  PHP Upgrade
6).  XCache Re-install
7).  APC Cache Re-install
8).  XCache Install
9).  APC Cache Install
10). Memcached Server Re-install
11). MariaDB 5.2 Upgrade
12). Install
13). SELinux disable
14). Setup Logrotate for Nginx
15). Setup Logrotate for PHP-FPM
16). Change SSHD Port Number
17). Multi-thread compression: pigz,pbzip2,lbzip2,p7zip etc
18). Suhosin PHP Extension install
19). Install FFMPEG and FFMPEG PHP Extension
20). NSD Re-install
21). Exit
Enter option [ 1 - 21 ]

SSH2 Telnet client tip
If your SSH2 Telnet client options allow for it you can increase the size of your scroll back buffer size to allow larger amounts of outputted text to be shown via scrolling back and forth. This is the option in VanDyke SecureCRT SSH2 telnet client I use. I set my scrollback buffer to maximum size of 128,000 lines.

Here’s my modified Centmin v1.2.1  below which automatically installs the following via bash shell script framework written by BTCentral folks. Updates to my modified version will be updated in this blog post, so bookmark it and check back regularly. Also if you like this post/Centmin mod, feel free to share/vote on social media site links at top of post i.e. facebook, reddit, twitter, google+ etc 😉

  • Nginx v1.2.4
  • PHP 5.3.6 5.3.7 5.3.17 php-fpm install
  • MariaDB 5.2.12 default MySQL server – you’ll want min 512MB of installed memory
  • Memcached 1.4.15
  • Memcache v3.0.5 (do not use v3.0.6 doesn’t seem to work properly)
  • Xcache v1.3.2 / v2.0.1
  • APC 3.1.13
  • Python v2.72
  • CSF firewall
  • Siege benchmark and Sproxy.
CentOS 5.7/5.8 32bit & 64bit tested only. CentOS 6.x only tested on Centmin v1.2.1-eva2000.04 and higher.

Change log:

(compared to official Centmin v1.2.1/v1.2.2)

v1.2.2-eva2000.20 -11/10/2012

  • Updated Nginx from v1.2.3 to v1.2.4 stable release
  • Updated PHP from v5.3.16 to v5.3.17
  • Updated APC Cache from v3.1.12 beta to v3.1.13 beta
  • Updated igbinary from 1.1.1 to 1.1.2 dev build
  • Updated Memcached server from v1.4.14 to v1.4.15
  • Updated libevent from v2.0.19 stable to v2.0.20 stable
  • Updated wget command options
  • Update staticfiles.conf adding mime types font support for eot, svg, ttf and woff
  • Updated PHP download mirror URL, folks changed the format of the URL breaking PHP downloads. Corrected PHP download mirror URL.
  • Updated Nginx upgrade function to prompt for skipping OpenSSL recompile to speed up Nginx upgrades.

v1.2.2-eva2000.19 -25/08/2012

v1.2.2-eva2000.18 -15/07/2012

  • Updated Nginx from v1.1.20 to v1.2.2 stable release
  • Updated PHP from v5.3.13 to v5.3.14
  • Updated NSD config file with hide-version: yes option to prevent NSD from replying with the version string on CHAOS class queries
  • Updated Xcache from v2.0.0. to v2.0.1
  • Updated pigz, lzip, plzip, lbzip2 and lzib versions
  • Updated CentOS 6.x YUM EPEL Repo version download url from epel-release-6-6 to epel-release-6-7
  • Added detection support during installation for CentOS 6.x updated /switched to Oracle Unbreakable Enterprise Kernel R2 – 2.6.32-300.25.1 and 2.6.39-100.7.1 (based on 3.0.16 Kernel). Full details here.
[root@]# uname -r
[root@]# uname -r

v1.2.2-eva2000.17 -19/05/2012

  • Updated PHP from v5.3.11 to v5.3.13
  • Updated libevent from v2.0.18 stable to v2.0.19 stable
  • Updated Xcache re-install routine to detect from 1.3.2 to 2.0.0 upgrade to update xcache admin directory. Manual instructions are provided during upgrade to properly update xcache admin directory
  • Updated MariaDB 5.2 Upgrade menu option to detect for MariaDB 5.3 being the existing version on server and to abort when MariaDB 5.3 server already detected. The MariaDB 5.2 Upgrade menu option is for MariaDB 5.2.x based upgrades only. Centmin Mod will have an official MariaDB 5.3 Upgrade menu option added separately in future Centmin Mod versions.
  • Updated EPEL release YUM install
  • Updated Nginx and PHP upgrade routines to to allow skipping YUM checks, end user will be prompted if they want to skip YUM checks prior to upgrading Nginx or PHP to speed up upgrade times
  • Updated CSF tweaks to raise both DENY_IP_LIMIT & DENY_TEMP_IP_LIMIT from 100 to 1000 entries in /etc/csf/csf.conf
  • Updated MariaDB 5.2 upgrade routine’s download mirror to main MariaDB download mirror as it’s quickest to get new MariaDB MySQL updated versions uploaded to
  • Added MariaDB 5.3 upgrade routine (not active right now), currently doing internal tests for probable release for Centmin Mod v1.2.3 series
  • Added server memory installed check, to make sure you have at least 256MB of memory to run installation successfully

v1.2.2-eva2000.16 -29/04/2012

  • Updated PHP from v5.3.10 to v5.3.11
  • Updated Nginx from v1.1.19 to v1.2.0 stable release
  • Updated Xcache from v1.3.2 to v2.0.0 for PHP 5.4 support
  • Updated APC Cache from v3.1.9 to v3.1.10 beta for PHP 5.4 support (note: v3.1.10 beta retains v3.1.9 version name in PHPINFO so I modified the APC files to correct version number to v3.1.10 etc)
  • Updated APC configuration template files with additional settings you will need to manually add these to your /usr/local/lib/php.ini. You can compare using download zip’s copy at config/apc/apc-min.ini or apc.ini
  • Updated staticfiles.conf nginx includes file. You can find updated file in zip dowload config/nginx/staticfiles.conf which you can replace and overwrite the one on server at /usr/local/nginx/conf/staticfiles.conf
  • Updated nginx.conf and vhost template to add a 32K buffer to access_log logging. Changes aren’t updated automatically, you will need to update the /usr/local/nginx/conf/nginx.conf manually to remove line log_format bytes_log “$msec $bytes_sent .”; and add the line access_log logs/access.log combined buffer=32k;. You can compare using download zip’s copy at config/nginx/nginx.conf to compare against your live servers copy
  • Added optional Nginx modules from Agentzh’s Openresty bundle, memc-nginx-module and srcache-nginx-module. These modules are disabled by default but can be enabled by setting ‘y’ for new variable named NGINX_OPENRESTY=n. For more details read and No support is provided by me, optional modules are provided as is

v1.2.2-eva2000.15 -14/04/2012

  • Updated Nginx from v1.1.18 to v1.1.19
  • Updated MariaDB 5.2.11-115 MySQL to MariaDB 5.2.12-115 MySQL
  • Updated APC Cache install and re-install routine including setting up password protected file using tool
  • Updated YUM Install routine to be smarter in checking each package whether it’s already installed and needs updating or whether it’s not installed and needs installing
  • Updated php-fpm.conf files and vhost virtual.conf with pm.status and ping settings. PHP-FPM status/ping is disabled by default, uncomment setting #include /usr/local/nginx/conf/phpstatus.conf; in vhost virtual.conf and restart nginx and php-fpm services to enable. For folks upgrading Centmin Mod, ensure /usr/local/nginx/conf/phpstatus.conf exists, you can find a copy of it in v1.2.2-eva2000.15 zip file’s config/nginx/phpstatus.conf location.
  • Fixed CentOS 6.x EPEL Repo link
  • Fixed NSD v3.2.10 install/reinstall issue by moving NSD install routine further down the order for installation, seems v3.2.10 complains it can’t find the SSL libraries for some reason and fails to compile, so no /etc/nsd directory is created.
  • Add logging support to menu options. Log directory defined by variable CENTMINLOGDIR=’/root/centminlogs’ in inc/ When run menu option, the entire process will be logged to a time stamped text log file named ${CENTMINLOGDIR}/centminmod_${SCRIPT_VERSION}_${DT}_*.log so you can review the logs for error messages etc.

Full change log here.


Note: that Centmin script is meant for freshly installed virgin CentOS 5.x 32bit or 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.




MaxCDN Site Acceleration

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


  1. hi eva, i was tracking down a similar thought process. dmesg shows this segfault when php-fpm attempts to start : conftest[11504]: segfault at 1 ip 00007f145fef9d48 sp 00007fff4ae59c70 error 4 in[7f145feb8000+107000]

    appears it has something to do with excessive amounts of modules OR imap module.

    ill change version to 5.3.18 and see what happens. any issue with me changing ver to 5.4.8???

    thanks for your quick response george, really appreciate it! i also owe you an email!

  2. hi george, manually editing to 5.3.18 still produces the same kill error during install “kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec … or kill -l [sigspec]” and dmesg still has a segfault “conftest[14807]: segfault at 1 ip 00007f62bfef6d48 sp 00007ffff37f3570 error 4 in[7f62bfeb5000+107000]”


    it installs and works fine! starting and stopping fpm after install is complete does not generate any more segfaults either.

    any concerns with manually editing the file to specify php 5.4.8?

  3. Ok thanks eva2000 🙂

    I hope you add security for this so we can use the script for shared hosting soon 🙂

    On other servers open_base_dir is fine for this job 🙂

    Thank you we love your script!

  4. Hi,

    How i can setup AnyCast DNS in the DNS zone file because i tried it more times without any luck

    For example if the AnyCast DNS nameservers are:

    First i update my domain nameservers in the domain register to

    Then i edit my zone file /etc/nsd/master/ as below

    $TTL 14400
    @ IN SOA (
    86400 )

    ; Nameservers 14400 IN NS 14400 IN NS 14400 IN NS 14400 IN NS

    ; A Records 14400 IN A
    ftp 14400 IN A
    localhost 14400 IN A
    mail 14400 IN A
    ns1 14400 IN A
    ns2 14400 IN A
    ns3 14400 IN A
    ns4 14400 IN A
    pop 14400 IN A
    smtp 14400 IN A
    www 14400 IN A

    ; MX Record 14400 IN MX 10 mail

    ; TXT Record (for SPF) 14400 IN TXT "v=spf1 a mx ip4: ~all"

    But still the domain doesn’t work and in it showing the name servers (NO GLUE) and “ERROR: I could not get any A records for!”.

    So what is wrong?

    Thank you

  5. Do you have any luck with “W3 Total Cache” plugin for wordpress because i did everything still showing “It appears Page Cache URL rewriting is not working. If using apache, verify that the server configuration allows .htaccess or if using nginx verify all configuration files are included in the configuration.”

    “W3 Total Cache” created /home/nginx/domains/
    by default and i included in /usr/local/nginx/conf/conf.d/ file

    by using include /home/nginx/domains/;

    But still showing the same message above.

  6. Anycast dns changes in NSD, did you restart NSD bind service after changes ?

    service nsd restart

    W3 TC is tricky with nginx rewrites, but haven’t tried myself yet.

    FYI, Google+ Community has been setup for Centmin Mod discussion of latest v1.2.3 beta releases at Join in and test out new v1.2.3 beta 🙂

  7. Any plans to add an open_basedir option so the user from one account will not be able to access the files from another user or if one site hacked to not be able the user to get the rest server files?

    This is the only missing feature on this amazing script..

  8. Hi!

    Do you know a way to let nginx accept http OPTIONS request?

    Every time I send a request with the OPTIONS method I get a 405 error from nginx

    Thanks in advance

  9. Closing comments on this blog to move Centmin Mod specific discussions to Centmin Mod Google+ Community site at


  1. Centmin Mod - Menu based Nginx installer for CentOS servers - [...] latest version of Centmin Mod from (you can find latest version info here) and download at Download link will…