Centmin Mod FAQ

If English isn't your first language, you can use Bing Translator to translate this page into your preferred language. Click translate button. Then click the down arrow and select your preferred language.



Centmin Mod was created and tested to work as standalone Nginx, PHP-FPM and MariaDB MySQL stack without the use of any control panels. The goal of the Centmin Mod menu based installation was to make it easier to manage without the aid of a control panel. Centmin Mod definitely doesn't work with WHM/Cpanel, Plesk or DirectAdmin. I am unsure if it will work with Webmin, ISPConfig or Kloxo. Reason is mainly due to custom source compiled versions for Nginx and PHP-FPM and how the configuration files and settings are structured and laid out are totally different from any CentOS YUM repository provided installs for Nginx and PHP-FPM and the fact that Centmin Mod LEMP stack uses MariaDB MySQL. If you do try this yourself, please do on a test server environment only and not your live production web servers.

Centmin Mod was born from extensive modification of the original Centmin script. As such there was never any intention of within the original Centmin or my Centmin Mod script for purposes of shared hosting with multiple end users using individual FTP usernames to manage sites and domains.

Centmin Mod like original Centmin script, was intended for a single root user/administrator to manage multiple or single web site domains on a VPS or dedicated server. By default, in current version of Centmin Mod there is no security in place to protect one site domain vhost account from access to another domain vhost account. As such, current Centmin Mod script isn't suited to shared hosting where you provide to admin users other than yourself with site ftp/ssh access. All users would be able to access each site account. Of course this doesn't prevent you from modifying Centmin Mod script and structure to support shared hosting yourself if you know what you're doing. Note: I won't be able to provide any help if you do such modifications though.

For future Centmin Mod script versions, I do plan to add such support eventually but it's definitely something planned way into the future. So not anything that will be available anytime soon. Centmin Mod is provided for free and as is, so I am only working on Centmin Mod in my free time.

For now most folks do not need to install FTP, instead just use native SFTP to upload to Centmin Mod installed servers using SFTP supported client i.e. Filezilla - documentation and google tutorials http://lmgtfy.com/?q=filezilla+sftp+connect+server+tutorial. A few example tutorials:

  1. http://wiki.filezilla-project.org/Using
  2. http://wiki.dreamhost.com/FileZilla_Setup
  3. http://kb.siteground.com/how_to_establish_sftp_connection_to_hosting_with_filezilla/
  4. http://kb.mediatemple.net/questions/880/Using+FileZilla+for+FTP%7B47%7DSFTP#gs
  5. http://psychologyit.rutgers.edu/helpdocs/filezilla.html
  6. http://blog.softlayer.com/2012/tips-and-tricks-how-to-use-sftp/

Update: Jan 19th, 2015 - Centmin Mod 1.2.3-eva2000.08 beta release has added basic isolated jailed FTP user support via pure-ftpd virtual FTP user features for beta testing. Virtual FTP user support is done via FTP with explicit TLS/SSL for encrypted transfers via a self-signed SSL certificate and PASV mode enabled. You'd want to disable PHP shell functions to further lock it down as per Getting Started Guide item 14.

Full install instructions here.

Within same v1.2.2 branch or within same v1.2.3 upgrades

If you are upgrading a server which already previously had Centmin Mod installed of the same branch i.e. Centmin Mod v1.2.2-eva2000.** or within same v1.2.3-eva2000.** branch, you DO NOT need to run option #1 (in fact as of Centmin Mod v1.2.2-eva2000.14 it will be impossible to run option #1 as the script will detect previous install of Centmin Mod and abort the script). For the latest Centmin Mod code update instructions check out the newly added Centmin Mod upgrade page.

Once, Centmin Mod code is updated just run option #4 and then option #5 for upgrading Nginx web server and upgrading PHP. You only need to run these if you upgrading to new Nginx or PHP version. If your existing Centmin Mod install has the same versions for Nginx and PHP, there maybe no need to even run those menu options unless, new Nginx and/or PHP modules and extensions are added by the updated Centmin Mod code. Update: as of v1.2.3-eva2000.07+ and higher, there's a new menu option #22 which can upgrade Nginx, PHP-FPM and Siege benchmark versions to the versions set in centmin.sh. This means if you are upgrade Centmin Mod from say .07 to .08, you only have to run centmin.sh menu option #21 from .08 release, to automatically upgrade Nginx, PHP-FPM and Siege benchmark. Again, if between Centmin Mod releases, you upgraded Nginx and PHP-FPM versions to versions matching those in the new Centmin Mod releases's centmin.sh version number variables, then there is no need to run menu option #21.

v1.2.2 to v1.2.3+ upgrades

But if you are on the older, Centmin Mod v1.2.2-eva2000.** branch, and want to move to utilising the full 100% feature set of Centmin Mod v1.2.3 branch, you will need to use a fresh CentOS installed server and do fresh Centmin Mod v1.2.3 install rather than upgrade and transfer your old files to the new server. The reason is the Centmin Mod v1.2.3 branch has alot of new features that are installed at initial install time only and not via upgrade.

If you don't need 100% of the new features in Centmin Mod v1.2.3 branch and are only concerned with utilising v1.2.3 Nginx, PHP and MariaDB 5.5 improvements, then just running Nginx upgrade option #4 and PHP upgrade option #5 and MariaDB 5.2.x to 5.5.x upgrade option #12 will allow you to use all the new Nginx, PHP and MariaDB 5.5 features listed at Centmin Mod v1.2.3. So running Nginx upgrade option #4, you will always still get Google SPDY and ngx_pagespeed and other listed modules support on Nginx page. Same if you run PHP upgrade option #5, you will always still get all compiled extensions supported and listed on PHP page.

Nginx upgrade

Menu option #4 will upgrade Nginx web server by prompting you to enter the Nginx version you want to install. You may receive 404 Not Found errors on php pages after Nginx upgrade. If you do, run Menu option #5 to upgrade/reinstall PHP version. You will find the latest stable and development versions on Nginx.org. The Nginx upgrade routine will do a preliminary YUM update check to make sure any new Centmin Mod options have their required YUM installed software prior to the upgrade.

You can also use the menu option #4 to downgrade Nginx versions as well just by entering a Nginx version you want. For Centmin Mod, I would stick with the stable version Nginx v1.1.xx to v1.2.xx as there are changes to nginx.conf etc which Centmin Mod caters to in it's configuration files, which earlier Nginx versions won't support.

Nginx upgrade process will also backup your existing Nginx conf directory and file via 3 options in centmin.sh: NGINXBACKUP='y', NGINXCONFDIR='/usr/local/nginx/conf', NGINXBACKUPDIR='/usr/local/nginxbackup'. You will find backups of previous Nginx versions in timestamped directories located within /usr/local/nginxbackup.

PHP Upgrade

Menu option #5 will upgrade your PHP version to whatever version you enter at the prompt. You'll find latest PHP versions stable releases on the top right corner column on php.net.

Prior to Centmin Mod 1.2.3-eva2000.07 stable release, upgrading PHP involved some additional steps if you had installed any of the following PHP extensions, Xcache, APC, Suhosin, FFMPEG, Memcache or generally any extension which required you to manually load a *.so file into php.ini. The reason why is the PHP upgrade routine will backup your existing php.ini which is at /usr/local/lib/php.ini and save backup to /usr/local/lib/php.ini-oldversion_timestamp and then overwrite that php.ini file with latest php.ini supplied by PHP tarbal download package. However, with Centmin Mod 1.2.3-eva2000.07 and higher versions, this is usually no longer required as the upgrade routine automatically detects previously compiled PHP extensions and auto recompiles them on major PHP upgrades only i.e. PHP 5.4 to 5.5 or 5.6. It will skip auto recompiles for minor PHP upgrades i.e. PHP 5.5.16 to 5.5.17.

The PHP upgrade process will then do a DIFF comparison check between new /usr/local/lib/php.ini and saved backup at /usr/local/lib/php.ini-oldversion_timestamp and display all the changes and differences between the file. There's a 60 second delay on the screen so you can use that opportunity to copy or note the changes for your own records. Usually, the changes will highlight what PHP extensions were installed previously and what is missing in the new php.ini.

Prior to Centmin Mod 1.2.3-eva2000.07 stable release, all you had to do after PHP upgrade was to re-install those PHP extensions via menu options listed below - for Suhosin and FFMPEG install is fine. However, with Centmin Mod 1.2.3-eva2000.07 and higher versions, this is usually no longer required unless there are issues requiring manual recompile via menu options outlined below:

  • 6). XCache Re-install
  • 7). APC Cache Re-install
  • 10). Memcached Server Re-install (this also updates your libevent version)
  • 15). Install/Re-install imagick PHP Extension
  • 18). Suhosin PHP Extension install
  • 19). Install FFMPEG and FFMPEG PHP Extension

The PHP upgrade process also backs up and overwrites your existing php-fpm configuration file /usr/local/etc/php-fpm.conf to /usr/local/etc/php-fpm.conf-oldversion_timestamped. It will prompt you and ask if you want to overwrite and backup the php-fpm.conf file. This is to ensure updated php-fpm.conf changes make it into your server's php-fpm configuration.

MariaDB 5.5 MySQL ?

As at July 28th, 2015, latest Centmin Mod v1.2.3 and higher have MariaDB 10.0.x MySQL default support as outlined here.

For existing Centmin Mod users still on MariaDB 5.2, you'll find the new revised menu option #12 is for MariaDB 5.2.x update to MariaDB 5.5.x for folks wanting to test older Centmin Mod installs upgrade process to MariaDB 5.5

Since MariaDB 10.0.x uses YUM repository, future updates can be done via YUM:

yum update MariaDB-client MariaDB-common MariaDB-compat MariaDB-devel MariaDB-server MariaDB-shared

Before upgrading it is highly recommended to backup all your mysql databases using mysqldump

backup

mysqldump -u mysqlusername -p mysqldatabasename > /path/to/mysqldatabasename_backup_date.sql

restore

mysql -u mysqlusername -p mysqldatabasename < /path/to/mysqldatabasename_backup_date.sql

MariaDB 5.2.x upgrade

Menu option #11 will upgrade existing MariaDB 5.2.x MySQL server users only within MariaDB 5.2.x branch (follow above instructions if you want to move from MariaDB 5.2.x to MariaDB 5.5.x). But unlike Nginx and PHP upgrade routines, it will not prompt for MariaDB version. The version that is upgraded to is determined by what is set in centmin.sh for the following variables:

Set to version you want to upgrade to:

MDB_VERONLY='5.2.14'
MDB_BUILD='122'

Set to existing version you are already using:

MDB_PREVERONLY='5.2.12'
MDB_PREBUILD='115'

So centmin.sh will look like this for MariaDB 5.2.12 Build 115 upgrade to MariaDB 5.2.14 Build 122.

# Define current MariaDB version
MDB_VERONLY='5.2.14'
MDB_BUILD='122'
MDB_VERSION="${MDB_VERONLY}-${MDB_BUILD}"     # Use this version of MariaDB ${MDB_VERONLY}
 
# Define previous MariaDB version for proper upgrade
MDB_PREVERONLY='5.2.12'
MDB_PREBUILD='115'
MDB_PREVERSION="${MDB_PREVERONLY}-${MDB_PREBUILD}"     # Use this version of MariaDB ${MDB_VERONLY}

Please stick with only the latest MariaDB 5.2.x version tested and listed on official web site at changelog.html. I can not guarantee that higher versions which have not been tested by me to work 100%.

Before upgrading it is highly recommended to backup all your mysql databases using mysqldump

backup

mysqldump -u mysqlusername -p mysqldatabasename > /path/to/mysqldatabasename_backup_date.sql

restore

mysql -u mysqlusername -p mysqldatabasename < /path/to/mysqldatabasename_backup_date.sql

Centmin Mod releases are tested from fresh installs as well as upgrades with latest PHP (php-fpm) 5.3.x, 5.4.x, 5.5.x and 5.6.x versions . But PHP (php-fpm) 5.4.x is the default installed PHP version for best PHP script compatibility. Not all PHP scripts out there are coded to support PHP 5.5.x or 5.6.x, so I've left the choice of PHP versions up to the end user. You can choose which version of PHP to use yourself and it would be up to you to make sure your PHP scripts support the chosen PHP version. You can always downgrade to PHP 5.3.x later on and upgrade again to PHP 5.4 - 5.6 whenever you want.

You'll find latest PHP versions stable releases on the top right corner column on php.net.

There are 2 methods you can choose to use PHP (php-fpm) 5.5.x or 5.6.x:

Method 1.
Start fresh Centmin Mod install with latest PHP 5.5.x or 5.6.x version by editing centmin.sh and changing the PHP_VERSION variable to appropriate PHP version. So to go from PHP 5.4.43 to PHP 5.5.27, you'd edit centmin.sh BEFORE running fresh installation and change the variable

from

  PHP_VERSION='5.4.43'          # Use this version of PHP

to

  PHP_VERSION='5.5.27'          # Use this version of PHP

If you also want to switch from APC Cache 3.1.13 or APC Cache 3.1.15-dev (used for PHP 5.5+) to Zend OpCache, you can also set in centmin.sh the variable ZOPCACHEDFT='y' prior to initial centmin.sh install run.

  ZOPCACHEDFT='y'

Then do the first time fresh install as per FAQ guide

Method 2.
Upgrading an existing Centmin Mod install base from PHP 5.4.x to PHP 5.5.x or 5.6.x by running centmin.sh script and selecting menu option #5 and specifying the PHP version you want to upgrade (or downgrade to) i.e. specify PHP 5.4.32 or PHP 5.5.16 or PHP 5.6.0. More specific upgrade details outlined below. You can read the PHP 5.6.0 upgrade thread for more details too.

You can do this via Centmin Mod menu options #2 & #3. Full details here.

Remember to check your domain name's DNS is properly configured at both your domain registrar & web server end (NSD) by running domain name through these 3 dns test sites

From Centmin Mod v1.2.2-eva2000.15 and onwards, logging is automatically done when you run centmin.sh. A log directory is defined by variable CENTMINLOGDIR='/root/centminlogs' in inc/centminlogs.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

ls -lhrt /root/centminlogs/
 
total 7.3M
-rw-r--r-- 1 root root 4.3M Apr 14 17:14 centminmod_1.2.2-eva2000.15_140412-151749_install.log
-rw-r--r-- 1 root root 1.7M Apr 14 17:44 centminmod_1.2.2-eva2000.15_140412-173219_php_upgrade.log
-rw-r--r-- 1 root root  30K Apr 14 17:44 centminmod_1.2.2-eva2000.15_140412-173219_apc_reinstall.log
-rw-r--r-- 1 root root  89K Apr 14 17:45 centminmod_1.2.2-eva2000.15_140412-173219_memcached_reinstall.log
-rw-r--r-- 1 root root  24K Apr 14 17:46 centminmod_1.2.2-eva2000.15_140412-173219_suhosin_install.log
-rw-r--r-- 1 root root  17K Apr 14 17:49 centminmod_1.2.2-eva2000.15_140412-173219_ffmpeg_install.log
-rw-r--r-- 1 root root 1.3M Apr 14 18:02 centminmod_1.2.2-eva2000.15_140412-173219_nginx_upgrade.log
-rw-r--r-- 1 root root  23K Apr 14 18:31 centminmod_1.2.2-eva2000.15_140412-183136_nsd_reinstall.log

Old method (prior to v1.2.2-eva2000.15): If you're testing Centmin Mod installation on a test server and want to log the entire output of the process to a log file, you can use script command before running centmin.sh.

Type this command before running centmin.sh

script -f centminv122mod.log

Run centmin.sh which will invoke the full menu and select options you wan to run i.e. option #1

./centmin.sh

When you finished running centmin.sh hit exit option then at command prompt type exit command, this finishes the log and writes everything to centminv122mod.log which you can download and review.

exit

To change timezone before install, edit centmin.sh and find and change the ZONEINFO variable. For after install changes and more on ZONEINFO variable read the full guide here.

Time it takes varies depending on what software you opt to install, the server's network connectivity speed and the type of VPS or dedicated server you install it on. More powerful servers will take less time to install. The faster your server's network connectivity, the faster it downloads software (YUM/RPMs). On my local virtualbox test server (Xeon W3540 @3.5Ghz 2 cores allocated, 1.5GB memory, SATAII disk) for CentOS 5.5, 5.6 and 6.0, for full install for all prompted default options it takes roughly 20-22 minutes to install. On centminmod.com's cluster of 512MB / 1GB Burst OpenVZ based VPSes with 2 core Xeon E5520, the same full install took nearly 55 minutes. For Centmin Mod 1.2.3-eva2000.08+ and higher, the times have been relatively improved. From my local Virtualbox testing in 2015, install times were reduced from 1,300-1,800 seconds to 1,000-1,300 seconds. For OpenVZ testing on 4 cpu core VPS, times weere reduced from 1,000-1,300 seconds to 600-900 seconds. You may think that is a long time, but remember in most cases you'll be optimised post-install time ready to go as opposed to usual YUM/RPM install, you could spend hours post-install on getting everything optimised settings wise.

From 1.2.3-eva2000.08+ and higher versions, there's a one liner curl install method. This method provides additional statistics at end of install including the install times and a break down of download, yum, source compile and total install times. Example below:

---------------------------------------------------------------------------
Total Curl Installer YUM Time: 146.8008 seconds
Total YUM Time: 48.815243370 seconds
Total YUM + Source Download Time: 64.1629
Total Nginx First Time Install Time: 86.1649
Total PHP First Time Install Time: 101.5644
Download Zip From Github Time: 3.5280
Total Time Other eg. source compiles: 206.8567
Total Centmin Mod Install Time: 458.7489
---------------------------------------------------------------------------
Total Install Time (curl yum + cm install + zip download): 609.0777 seconds
---------------------------------------------------------------------------
                

Centmin Mod Nginx auto installer has been tested on CentOS 5.5, 5.6, 5.7, 6..0 - 6.5 64bit and CentOS 6.0 to 6.5 32bit so far. As of Centmin Mod v1.2.3-eva2000.06, Centmin Mod also supports Oracle 6.x Linux for updated Linux 2.6.39 and 3.8.13 UEK Kernel support and TCP performance improvements. CentOS 7.0 support is supported from Centmin Mod 1.2.3-eva2000.08+ and higher after undergoing alot of tests with Centmin Mod 1.2.3-eva2000.08 betas. Earlier Centmin Mod script has also been successfully tested with Scientific Linux 6.0 64bit. But current full menu supported version of Centmin Mod has not been tested with Scientific Linux 6.

Centmin Mod has personally been tested on mainly on local Virtualbox servers, Parallels Virtuozzo, KVM and OpenVZ based VPS servers. As of June 2013, also successfully tested on DigitalOcean.com KVM VPS servers. As of October 15, 2012, also successfully tested on Secured Cloud VMWare instances which are great for quick tests - a 512MB ram, 16GB hard disk VM instance only costs around US$0.025 per hour! Reports from Centmin Mod users have confirmed working installations also on Xen based VPS servers as well. I intend to also personally test Centmin Mod Nginx auto installer on Xen based VPS servers shortly.

Note: If you are using Xen Paravirtualization and are running a 32bit OS on a 64bit host node, then you must uncomment the #ARCH_OVERRIDE='i386' line of the script, else it will not function correctly. (to uncomment, simply remove the hash - #).

Currently, only testing Debian for MariaDB 5.2.x Mysql tuning and optimisation and for the Debian version of my mysqlmymonlite.sh server stats gathering script. But there's a definite possibility that in future, I'll write up a Debian version once I have Centmin Mod version settled in terms of features and stability. As for a FreeBSD Nginx auto installer script, there's no plans right now. But that can change.

Put simply, MariaDB 5.2.x, 5.5.x, and 10.x MySQL server currently has the best performance mix for both MyISAM and InnoDB storage engines in MySQL. You can read benchmarks I did on my blog Part 1 and Part 2. While it may not make as much difference for VPS and dedicated servers with low memory and cpu core count specifications, MariaDB 5.2.x uses Percona's XtraDB InnoDB engine so has same or somewhat better InnoDB performance as Percona but MariaDB is the only MySQL version which still focuses on MySQL core improvements as well as improvements to MyISAM engine.

As at May 18th, 2013, latest Centmin Mod v1.2.3 beta has MariaDB 5.5 MySQL default support as outlined here.

Note: MariaDB 5.5.30 currently has a bug when a host is configured to have both ipv6 and ipv4 enabled you may get 'Error establishing a database connection' with your web apps i.e. wordpress when connecting via localhost. If you use 127.0.0.1 instead of localhost it works fine. This bug is fixed in next MariaDB 5.5.31 release (bug reported).

yum -q -y install postfix
 
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package postfix.x86_64 2:2.6.6-2.2.el6_1 will be installed
--> Processing Dependency: mysql-libs for package: 2:postfix-2.6.6-2.2.el6_1.x86_64
--> Finished Dependency Resolution
Error: Package: 2:postfix-2.6.6-2.2.el6_1.x86_64 (base)
           Requires: mysql-libs
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

This is a problem with MariaDB 5.2 RPM packages on CentOS 6.x which usually provides mysql-libs but to install MariaDB 5.2 you have to uninstall mysql-libs which postfix requires. This is fixed with MariaDB 5.5 packages as it includes the dependencies that CentOS 6.x mysql-lib usually provide.

As at May 18th, 2013, latest Centmin Mod v1.2.3 beta has MariaDB 5.5 MySQL default support as outlined here.

Note: MariaDB 5.5.30 currently has a bug when a host is configured to have both ipv6 and ipv4 enabled you may get 'Error establishing a database connection' with your web apps i.e. wordpress when connecting via localhost. If you use 127.0.0.1 instead of localhost it works fine. This bug is fixed in next MariaDB 5.5.31 release (bug reported).

Centmin Mod will very soon be moving to MariaDB 5.5 base installs by default for this very reason as well as the better performing MariaDB 5.5 server. Testing is currently being done with MariaDB 5.5. For updates as to when MariaDB 5.5 support comes to Centmin Mod, please follow me on Twitter or via Centmin Mod Google+ Page.

Example of successful install of postfix with test MariaDB 5.5 on Centmin Mod install

mysqladmin ver
mysqladmin  Ver 9.0 Distrib 5.5.25-MariaDB, for Linux 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.5.25-MariaDB
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/lib/mysql/mysql.sock
Uptime:                 5 sec
 
Threads: 1  Questions: 1  Slow queries: 0  Opens: 33  Flush tables: 1  Open tables: 26  Queries per second avg: 0.200
yum install postfix
 
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package postfix.x86_64 2:2.6.6-2.2.el6_1 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
=========================================================================
 Package                  Arch       Version                     Repository               Size
=========================================================================
Installing:
 postfix                    x86_64    2:2.6.6-2.2.el6_1       base                         2.0 M
 
Transaction Summary
=========================================================================
Install       1 Package(s)
 
Total download size: 2.0 M
Installed size: 9.7 M
Is this ok [y/N]: y
Downloading Packages:
postfix-2.6.6-2.2.el6_1.x86_64.rpm                                                                                          | 2.0 MB     00:01     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 2:postfix-2.6.6-2.2.el6_1.x86_64                                                                                                1/1 
 
Installed:
  postfix.x86_64 2:2.6.6-2.2.el6_1                                                                                                                 
 
Complete!

This depends on various factors including, what you choose to install software wise at installation time, opting to install Xcache or APC cache for php opcode caching, Memcached servers - choice between 1 or 2 instances, whether you choose to use MySQL.com community release default MySQL 5.0.x/5.1 or higher memory usage but better performing MariaDB 5.2.x based MySQL server and dependent on the CentOS operating system version and whether it's 32bit or 64bit. 64bit will generally use more memory than 32bit. For VPS based servers, it will also depend on what type of virtualization is implemented. OpenVZ based VPS out of box used more memory if left unchecked due to default stack sizes. Check out my BuyVM.net VPS review on my blog here.

On centminmod.com OpenVZ based VPS servers, if you selected 'y' to <256MB installation prompts at install time, with full software install - Nginx v1.1.x, PHP 5.3.8 PHP-FPM, MariaDB 5.2.9, APC cache, 1x Memcached server instance, CSF firewall, NSD DNS, siege bench and Python 2.72 the idle memory usage falls between 112-130MB.

Below is sample output for one of my OpenVZ VPS - note there's several active SSH/SFTP connections as well. PHP-FPM and MariaDB MySQL server are the biggest consumers of memory in default Centmin Mod installation. You could tune them even more for less memory usage, but at the expense of performance.

--------------------------------
base mem usage
             total       used       free     shared    buffers     cached
Mem:          1024         24        999          0          0          0
-/+ buffers/cache:         24        999
Swap:            0          0          0
--------------------------------
Starting system logger: [  OK  ]
             total       used       free     shared    buffers     cached
Mem:          1024         26        997          0          0          0
-/+ buffers/cache:         26        997
Swap:            0          0          0
--------------------------------
Starting xinetd: [  OK  ]
             total       used       free     shared    buffers     cached
Mem:          1024         27        996          0          0          0
-/+ buffers/cache:         27        996
Swap:            0          0          0
--------------------------------
Starting saslauthd: [  OK  ]
             total       used       free     shared    buffers     cached
Mem:          1024         28        995          0          0          0
-/+ buffers/cache:         28        995
Swap:            0          0          0
--------------------------------
Starting sendmail: [  OK  ]
Starting sm-client: [  OK  ]
             total       used       free     shared    buffers     cached
Mem:          1024         31        992          0          0          0
-/+ buffers/cache:         31        992
Swap:            0          0          0
--------------------------------
Starting sshd: [  OK  ]
             total       used       free     shared    buffers     cached
Mem:          1024         31        992          0          0          0
-/+ buffers/cache:         31        992
Swap:            0          0          0
--------------------------------
[  OK  ] crond: [  OK  ]
             total       used       free     shared    buffers     cached
Mem:          1024         32        991          0          0          0
-/+ buffers/cache:         32        991
Swap:            0          0          0
--------------------------------
Starting lfd:[  OK  ]
             total       used       free     shared    buffers     cached
Mem:          1024         41        982          0          0          0
-/+ buffers/cache:         41        982
Swap:            0          0          0
--------------------------------
Starting php-fpm  done
             total       used       free     shared    buffers     cached
Mem:          1024         72        951          0          0          0
-/+ buffers/cache:         72        951
Swap:            0          0          0
--------------------------------
Starting nginx: [  OK  ]
             total       used       free     shared    buffers     cached
Mem:          1024         73        950          0          0          0
-/+ buffers/cache:         73        950
Swap:            0          0          0
--------------------------------
Starting MySQL.. SUCCESS! 
             total       used       free     shared    buffers     cached
Mem:          1024        123        900          0          0          0
-/+ buffers/cache:        123        900
Swap:            0          0          0
--------------------------------
memcached start
             total       used       free     shared    buffers     cached
Mem:          1024        125        898          0          0          0
-/+ buffers/cache:        125        898
Swap:            0          0          0
--------------------------------

When I started modifying the original Centmin script for my own needs, the first thing I did was add command shortcuts to Centmin Mod. Normally, to edit server configuration files or start/stop/restart services in SSH2 telnet, you need to type in lengthy commands.

With command shortcuts, if you opted to install them at Centmin Mod installation time, you'll be able to type a one word command to perform the entire action. Of course, the software needs to be installed for command lines to work i.e. memcached or csf need to have been installed. The command shortcuts invokes the nano linux text editor, you can read up more about nano here and here.

Below are a list of command shortcuts:

  • Edit php.ini = phpedit ( /usr/local/lib/php.ini )
  • Edit my.cnf = mycnf ( /etc/my.cnf )
  • Edit php-fpm.conf = fpmconf ( /usr/local/etc/php-fpm.conf )
  • Edit nginx.conf = nginxconf ( /usr/local/nginx/conf/nginx.conf )
  • Edit (nginx) virtual.conf = vhostconf - only edits /usr/local/nginx/conf/conf.d/virtual.conf not the additional vhost domain.com.conf files added later
  • Edit (nginx) php.conf = phpinc ( /usr/local/nginx/conf/php.conf )
  • Edit (nginx) drop.conf = dropinc ( /usr/local/nginx/conf/drop.conf )
  • Edit (nginx) staticfiles.conf = statfilesinc ( /usr/local/nginx/conf/staticfiles.conf )
  • nginx stop/start/restart = ngxstop/ngxstart/ngxrestart
  • php-fpm stop/start/restart = fpmstop/fpmstart/fpmrestart
  • mysql stop/start/restart = mysqlstop/mysqlstart/mysqlrestart
  • nginx + php-fpm stop/start/restart = npstop/npstart/nprestart
  • memcached stop/start/restart = memcachedstop/memcachedstart/memcachedrestart
  • csf stop/start/restart = csfstop/csfstart/csfrestart

Setting shortcut to centmin.sh directory

Centmin Mod command shortcuts use hard coded files in /usr/bin/shortcutname as they are known paths etc. But for normal short cuts you might want to use more common alias command via /root/.bashrc file.

  1. backup contents of /root/.bashrc
  2. then edit /root/.bashrc to add aliases which are short cuts to command line statements you commonly run. One alias line per command. So to change to Centmin Mod centmin.sh directory if it's installed at /usr/local/src/centmin-v1.2.3mod (change directory path for below commands accordingly if you downloaded to different directory) you would type these 2 commands as root user in SSH telnet session.
  alias cmod='pushd /usr/local/src/centmin-v1.2.3mod/'
  echo "alias cmod='pushd /usr/local/src/centmin-v1.2.3mod/'" >> /root/.bashrc

Second command adds the alias command (first command) to /root/.bashrc.

I used pushd instead of cd command to change to directory as pushd along with popd are very useful. Read about their usage at http://www.eriwen.com/bash/pushd-and-popd/ and http://linux.101hacks.com/cd-command/dirs-pushd-popd/

To see all your listed and active alias commands type the command below. By default CentOS already has some alias commands set which will also be listed:

  alias

Unfortunately, I haven't gotten my head around rewrite rules and regex as yet. Best place to ask for help for Apache rewrite/htaccess conversions to equivalent Nginx rewrite rule would be on Nginx's official forums at http://forum.nginx.org/. I am actively looking at compiling a list of standard working Nginx rewrite rules for various software like, wordpress & drupal perma links, vBulletin, xenforo, IPB forums and other software. Appropiate credit/linking to contributor and their site will be given on the compiled list page. So if you'd like to contribute to such a list, feel free to contact me.

When I started modifying the original Centmin script for my own needs, I had a very specific configuration in mind for Nginx, PHP-FPM, and MariaDB. They would be custom tuned settings wise from out of the box installations - ready to hit the ground running with optimised specific settings.

RPM/YUM while faster for installation, wouldn't satisfy my goals in that you'd spend alot more time after installation trying to customise each and every software. I also use Amazon EC2, Rackspace Cloud, GoGrid based cloud server hosting for testing as well for my Apache equivalent bash auto install script which I wrote from ground up prior to finding Centmin (alot of the Centmin Mod functions were ported over from my Apache bash auto installer sript - including the above command shortcut feature).

The Apache version like Centmin Mod, aimed at reducing the amount of post-install time in customising settings for all software. Afterall, cloud server hosting charges by the hour, so less time post-install configuring equals less costs incurred. So basically, some software is source compiled for this reason - weighing up a more lengthy install process for nearly zero time post-install custom configuration process. The other reason for source compile for Nginx, PHP-FPM, Xcache, APC, Memcached etc is that these are constantly updated with new versions and rather than be reliant on and waiting for YUM REPO/RPM binary updates which always lag behind the new releases, source compilation allowed much more timely updates. This is also important for Nginx to be able to add and update additional Nginx modules in a timely manner i.e. ngx_pagespeed module.

Some of Centmin Mod's installed software will have their own access and error logs which maybe useful for diagnosing errors or give info, notes, or warning notices.

Note: There's no support provided by me for diagnosing such errors which may occur for various reasons including misconfiguration of installed php/mysql scripts or applications.

In SSH2 telnet you can use tail command to view the last X number of lines in the file.

For example for viewing last 10 lines in the file for:

For Nginx access and error logs:

  tail -10 /usr/local/nginx/logs/access.log
  tail -10 /usr/local/nginx/logs/error.log

For specific domainname.com access and error log:

  tail -10 /home/nginx/domains/domainname.com/log/access.log
  tail -10 /home/nginx/domains/domainname.com/log/error.log

For other system error logs located at /var/log:

list /var/log files in ascending time order so the most recently modified files are at the bottom

  ls -lhrt /var/log
 
total 2.7M
-rw------- 1 root  root    0 Aug 29 15:33 tallylog
-rw------- 1 root  root    0 Aug 29 15:33 spooler
drwx------ 3 root  root 4.0K Aug 29 15:35 samba
drwxr-xr-x 2 root  root 4.0K Aug 29 15:35 mail
-rw-r--r-- 1 root  500     0 Oct  8 18:13 dmesg.old
-rw------- 1 root  500     0 Oct  8 18:13 boot.log
-rw-r--r-- 1 root  500     0 Oct  8 18:14 dmesg
drwx------ 2 root  root 4.0K Oct  8 18:14 httpd
drwxr-xr-x 2 root  root 4.0K Oct  8 19:08 php-fpm
-rw-rw---- 1 mysql root 2.3K Oct  9 12:38 mysqld.log
-rw------- 1 root  root 9.2K Oct 26 10:48 yum.log
-rw------- 1 root  utmp  94K Nov  7 22:59 btmp
drwxr-xr-x 2 root  root 4.0K Nov  8 00:00 sa
-rw------- 1 root  root 269K Nov  8 21:39 messages
-rw------- 1 root  root 110K Nov  8 23:08 secure
-rw-rw-r-- 1 root  utmp  43K Nov  8 23:08 wtmp
-rw-r--r-- 1 root  root 144K Nov  8 23:08 lastlog
-rw------- 1 root  root  69K Nov  8 23:08 lfd.log
-rw------- 1 root  root 332K Nov  8 23:08 maillog
-rw------- 1 root  500  1.6M Nov  8 23:10 cron
 

For PHP-FPM error log:

  tail -10 /var/log/php-fpm/www-error.log 

and/or

  /var/log/php-fpm/www-php.error.log

For MySQL / MariaDB error log:

  tail -10 /var/log/mysqld.log 

For CSF firewall LFD log:

  tail -10 /var/log/lfd.log

For Mail log:

  tail -10 /var/log/maillog

For Cron job logs:

  tail -10 /var/log/cron

You need to edit /usr/local/nginx/conf/conf.d/virtual.conf and find the very first instance of these lines

include /usr/local/nginx/conf/staticfiles.conf;
include /usr/local/nginx/conf/php.conf;
#include /usr/local/nginx/conf/phpstatus.conf;
include /usr/local/nginx/conf/drop.conf;
#include /usr/local/nginx/conf/errorpage.conf;

Uncomment and enable by remove # hash in front of phpstatus.conf

So this

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

becomes

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

save /usr/local/nginx/conf/conf.d/virtual.conf, then restart Nginx

service nginx restart

or if you installed centmin mod shortcuts http://centminmod.com/faq.html#commandshortcuts you can use this command

ngxrestart

then install lynx via yum

yum -q -y install lynx

then run this command whenever you want to see php-fpm usage stats

lynx --dump  http://127.0.0.1/phpstatus

You'll get output like below

pool:                 www
process manager:      static
start time:           28/Jun/2012:21:24:51 +0400
start since:          75
accepted conn:        196
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       4
active processes:     1
total processes:      5
max active processes: 1
max children reached: 0

PHP Status explained:

  • pool - the name of the pool that is listening on the connected socket, as defined in the php-fpm config.
  • process manager - the method used by the process manager to control the number of child processes - either ondemand, dynamic or static - set on a per pool basis (in the php-fpm config) by the pm parameter.
  • start time - the date, time, and UTC offset corresponding to when the PHP-FPM server was started.
  • start since - the number of seconds that have elapsed since the PHP-FPM server was started (i.e. uptime).
  • accepted conn - the number of incoming requests that the PHP-FPM server has accepted; when a connection is accepted it is removed from the listen queue (displayed in real time).
  • listen queue - the current number of connections that have been initiated, but not yet accepted. If this value is non-zero it typically means that all the available server processes are currently busy, and there are no processes available to serve the next request. Raising pm.max_children (provided the server can handle it) should help keep this number low. This property follows from the fact that PHP-FPM listens via a socket (TCP or file based), and thus inherits some of the characteristics of sockets.
  • max listen queue - the maximum value the listen queue has reached since the server was started.
  • listen queue len - the upper limit on the number of connections that will be queued Once this limit is reached, subsequent connections will either be refused, or ignored. This value is set by the php-fpm per pool configuration option 'listen.backlog', which defaults to -1 (unlimited). However, this value is also limited by the system (sysctl) value 'net.core.somaxconn', which defaults to 128 on many Linux systems.
  • idle processes - the number of servers in the 'waiting to process' state (i.e. not currently serving a page). This value should fall between the pm.min_spare_servers and pm.max_spare_servers values when the process manager is dynamic. (updated once per second)
  • active processes - the number of servers current processing a page - the minimum is 1 (so even on a fully idle server, the result will be not read 0). (updated once per second)
  • total processes - the total number of server processes currently running; the sum of idle processes + active processes. If the process manager is static, this number will match pm.max_children. (updated once per second)
  • max active processes - the highest value that 'active processes' has reached since the php-fpm server started. This value should not exceed pm.max_children.
  • max children reached - the number of times that pm.max_children has been reached since the php-fpm server started (only applicable if the process manager is ondemand or dynamic)

To increase or decrease Memcached server's allocated memory size, you will need to edit /etc/init.d/memcached start up file's MEMSIZE=8 variable. The variable assigns memory in MegaBytes (MB), so MEMSIZE=8 is equal to 8MB. If you want to allocate 256MB to Memcached server(s), then edit and change variable to MEMSIZE=256 and then restart memcached server:

  service memcached restart

or via command shortcut

  memcachedrestart

Since Centmin Mod v1.2.2-eva2000.09, installation automatically sets up a /etc/cron.daily/diskalert daily cron job script to monitor your disk space usage. By default the script will alert you to when disk space usage is >90% on any one partition on your server and sends email to root user unless you edit the script at /etc/cron.daily/diskalert to set the EMAIL='youremail@email.com' address. You can also change the preset warning percentage threshold by editing /etc/cron.daily/diskalert and changing ALERT='90' to different percentage.

It is important to monitor disk space usage - to be able to see how much free disk space you have left. It is sometimes one of the more commonly overlooked metrics on VPS or dedicated servers.

Centmin Mod additional PHP compiled extensions such as APC Cache, Xcache, Memcache/Memcached, ImagicK, igbinary, FFMPEG and Suhosin are usually loaded separately from php.ini for ease of management via the menu options. As such these PHP compiled extensions are loaded individually into their own respective *.ini files in the directory defined in centmin.sh script, CONFIGSCANBASE='/root/centminmod'. For Centmin Mod v1.2.3-eva2000.07+ and higher, this path will change to CONFIGSCANBASE='/etc/centminmod'

So if you need to edit settings or manually disable a PHP extension, you can do so at the following locations (provided you have actually installed the listed PHP extension):

  • /root/centminmod/apc.ini (edit APC memory allocation here)
  • /root/centminmod/xcache.ini (edit Xcache memory allocation here)
  • /root/centminmod/igbinary.ini
  • /root/centminmod/imagick.ini
  • /root/centminmod/memcache.ini
  • /root/centminmod/memcached.ini
  • /root/centminmod/suhosin.ini (older installs will have ffmpeg.so directory loaded via (/usr/local/lib/php.ini)
  • /root/centminmod/ffmpeg.ini (older installs will have suhosin.so directory loaded via (/usr/local/lib/php.ini)

Common errors you may come across while installing or using Centmin Mod on CentOS operating system:

Problem: If you forget to make centmin.sh script executable via chmoding it or setting it's permissions to 755 via FTP/SFTP you'll get permission denied message for centmin.sh. Make sure you are running centmin.sh as root administrative user.

./centmin.sh: Permission denied

Solution: in SSH2 telnet as root admin user chmod centmin.sh or via FTP/SFTP set 755 permissions on centmin.sh

chmod +x centmin.sh

Problem: Nginx upgrade option fails - nginx tarball file not found.

Compiling nginx...
--2011-10-07 14:48:5-- http://nginx.org/download/nginx-.tar.gz
Resolving nginx.org... 206.251.255.63
Connecting to nginx.org|206.251.255.63|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2011-10-07 14:48:53 ERROR 404: Not Found.
 
tar: nginx-.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
./centmin.sh: line 1789: cd: nginx-: No such file or directory
make: *** No rule to make target 'clean'. Stop.
Would you like to compile nginx with IPv6 support? [y/n]

Solution: You didn't enter the correct nginx version number when prompted when you ran nginx upgrade option.

ie. enter 1.0.8 or 1.1.5 at prompt

--------------------------------------------------------
Centmin 1.2.2-eva2000.02 - http://centminmod.com
Menu/Mods Author: eva2000 (vbtechsupport.com)
Centmin Original Author: BTCentral (btcentral.org.uk)
--------------------------------------------------------
                   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 ioping.sh vbtechsupport.com/1239/
13). SELinux disable
14). Setup Logrotate for Nginx
15). Setup Logrotate for PHP-FPM
16). Change SSHD Port Number
17). Exit
--------------------------------------------------------
Enter option [ 1 - 17 ] 4
--------------------------------------------------------
**********************************************************************
* Nginx Update script - Included in Centmin Extras
* Version: 1.2.2-eva2000.02 - Date: 08/10/2011 - Copyright 2011 BTCentral
**********************************************************************
  
This software comes with no warranty of any kind. You are free to use
it for both personal and commercial use as licensed under the GPL.
  
Nginx Upgrade - Would you like to continue? [y/n] y
Install which version of Nginx? (version i.e. 1.0.6): 1.1.5

Problem: MySQL server not starting up, I get the following error message:

Starting MySQL................................ ERROR! Manager of pid-file quit without updating file.

Solution: Run the following commands:

Check mysql error log for unsupported mysql variable options you may have added or changed in /etc/my.cnf after Centmin Mod initial installation

Command to run in ssh2 telnet as root user:

tail -30 /var/lib/mysql/`hostname`.err | sed -e "s/`hostname`/yourserverhostname/g"

Also check:

tail -30 /var/log/mysqld.log | sed -e "s/`hostname`/yourserverhostname/g"

Check MySQL server status to see if it's running or stopped

Command to run in ssh2 telnet as root user:

service mysql status

If MySQL status says stopped but there's still mysql* processes showing up in first command below, run the second command to kill any lingering mysql processes preventing mysql to start up properly

1st command

ps aux |grep mysql |awk '{print $2, $7, $8, $9, $10, $11, $12}' | grep -Ev grep

2nd command

kill -9 `ps aux |grep mysql |awk '{print $2}'`

Restart MySQL server

Command to run in ssh2 telnet as root user:

service mysql restart

Problem: I can't connect to the installed Memcached server instance on 127.0.0.1 port 11211 ?

Solution: Steps to follow:

1. Check if memcached server is running and that php was successfully compiled with memcache extension (which it would of been when you said YES to memcached server install prompt).

Command to check memcached server running:

  ps ax | grep memcached | grep -Ev grep

output showing memcached server running:

  ps ax | grep memcached | grep -Ev grep
 3210 ?        Ssl    0:00 /usr/local/bin/memcached -d -m 8 -l 127.0.0.1 -p 11211 -c 2048 -t 4 -n 48 -f 1.05 -u nobody

Command to check memcache extension loaded with phpinfo:

  php -i | grep memcache

output showing memcache php extension loaded and installed:

  php -i | grep memcache
memcache
memcache support => enabled
memcache.allow_failover => 1 => 1
memcache.chunk_size => 32768 => 32768
memcache.compress_threshold => 20000 => 20000
memcache.default_port => 11211 => 11211
memcache.hash_function => crc32 => crc32
memcache.hash_strategy => consistent => consistent
memcache.lock_timeout => 15 => 15
memcache.max_failover_attempts => 20 => 20
memcache.protocol => ascii => ascii
memcache.redundancy => 1 => 1
memcache.session_redundancy => 2 => 2
Registered save handlers => files user sqlite memcache

2. If you installed CSF firewall when prompted, the default memcached 11211 port would of been set to allow the memcached server through CSF firewall. If you didn't install CSF firewall, then you may have ip tables enabled running and it is blocking 11211 port so need to add a rule to allow memcached port 11211 through iptables.

Confirm if iptables is blocking 11211 port, by temporarily shutting down iptables service with command

  service iptables stop

Now check if you can connet to your memcached server on default 127.0.0.1 and port 11211. If you can connect when iptables is stopped, then you need to allow port 11211 through iptables with either command or iptables file edit.

Start iptables service again

  service iptables start

Command for iptables to allow port 11211

  iptables -A INPUT -p tcp --dport 11211 -j ACCEPT

or edit /etc/sysconfig/iptables and add after the default port 22 line

  -A INPUT -m state --state NEW -m tcp -p tcp --dport 11211 -j ACCEPT

restart iptables

  service iptables restart

Problem: Tried upgrading MariaDB MySQL and it's still stuck on MariaDB 5.2.10 ?.

rpm -qa | grep MariaDB
MariaDB-devel-5.2.10-107.el5.x86_64
MariaDB-client-5.2.10-107.el5.x86_64
MariaDB-server-5.2.10-107.el5.x86_64
MariaDB-shared-5.2.10-107.el5.x86_64
MariaDB-test-5.2.10-107.el5.x86_64

Solution: For a bried period during Centmin Mod's early versions, I used a YUM repo for MariaDB 5.2.x installs, but it never gets updated in timely manner and latest version was MariaDB 5.2.10. So I switched back to manual install and updates via RPM binaries. If you have MariaDB 5.2.10 still showing up after trying to run menu option to upgrade MariaDB 5.2.10, please follow below suggestions

1. Edit centmin.sh file and find these 3 settings and edit it to which ever MariaDB version and build you are stuck on. In this case 5.2.10 and build 107

# Define previous MariaDB version for proper upgrade 
MDB_PREVERONLY='5.2.10'      
MDB_PREBUILD='107'
MDB_PREVERSION="${MDB_PREVERONLY}-${MDB_PREBUILD}"     # Use this version of MariaDB ${MDB_VERONLY}

2. Then run MariaDB upgrade menu option #11

--------------------------------------------------------
Centmin 1.2.2-eva2000.15 - http://centminmod.com
--------------------------------------------------------
                   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 ioping.sh vbtechsupport.com/1239/
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 ] 11
--------------------------------------------------------

3. When prompted for path to save downloads, enter /svr-setup to keep your version inline for future updates and reinstalls.

Where do you want the downloads stored ? Enter path to download directory (i.e. /usr/local/src) 
 
/svr-setup

4. After upgrade process you will be return to Centmin Mod menu, exit it and run the command to check your MariaDB MySQL server has been updated to latest version.

rpm -qa | grep MariaDB
rpm -qa | grep MariaDB
 
MariaDB-shared-5.2.12-115.el5.i386
MariaDB-test-5.2.12-115.el5.i386
MariaDB-client-5.2.12-115.el5.i386
MariaDB-server-5.2.12-115.el5.i386
MariaDB-devel-5.2.12-115.el5.i386

For Centmin Mod it's all or nothing only. However, from 1.2.3-eva2000.08+ and higher for fresh initial installs you can enable some settings in centmin.sh to disable services after they are initially installed. This allows for such services to be re-enabled later down the track if needed following the same manual steps outlined for Memcached server re-enabling. In centmin.sh set these variables to =y before initial Centmin Mod install

change from

# When set to =y, will disable those listed installed services
# by default. The service is still installed but disabled
# by default and can be re-enabled with commands:
# service servicename start; chkconfig servicename on
NSD_DISABLED=n                # when set to =y, NSD disabled by default with chkconfig off
MEMCACHED_DISABLED=n          # when set to =y,  Memcached server disabled by default via chkconfig off
PHP_DISABLED=n                # when set to =y,  PHP-FPM disabled by default with chkconfig off
MYSQLSERVICE_DISABLED=n       # when set to =y,  MariaDB MySQL service disabled by default with chkconfig off
PUREFTPD_DISABLED=n           # when set to =y, Pure-ftpd service disabled by default with chkconfig off                    
                

to

# When set to =y, will disable those listed installed services
# by default. The service is still installed but disabled
# by default and can be re-enabled with commands:
# service servicename start; chkconfig servicename on
NSD_DISABLED=y                # when set to =y, NSD disabled by default with chkconfig off
MEMCACHED_DISABLED=y          # when set to =y,  Memcached server disabled by default via chkconfig off
PHP_DISABLED=y                # when set to =y,  PHP-FPM disabled by default with chkconfig off
MYSQLSERVICE_DISABLED=y       # when set to =y,  MariaDB MySQL service disabled by default with chkconfig off
PUREFTPD_DISABLED=y           # when set to =y, Pure-ftpd service disabled by default with chkconfig off                    
                

This will stop and disable NSD, Memcached server, PHP-FPM, MariaDB MySQL and Pure-FTPD services.

Centmin Mod 1.2.3-eva2000.08+ and higher have open_basedir enabled in /usr/local/nginx/conf/php.conf include file. This file is included in each created Nginx vhost config file i.e. /usr/local/nginx/conf/conf.d/newdomain.com.conf. The relevant line is the 9th line in /usr/local/nginx/conf/php.conf

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass   127.0.0.1:9000;
    #fastcgi_pass   unix:/tmp/php5-fpm.sock;
    fastcgi_index  index.php;
    #fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_param  SCRIPT_FILENAME    $request_filename;
    fastcgi_param PHP_ADMIN_VALUE open_basedir=$document_root/:/usr/local/lib/php/:/tmp/;

This line locks you to each Nginx vhost's document web root i.e. /home/nginx/domains/newdomain.com/public.

    fastcgi_param PHP_ADMIN_VALUE open_basedir=$document_root/:/usr/local/lib/php/:/tmp/;

You can disable this globally across all Nginx vhosts, by commenting out the line and restarting Nginx and PHP-FPM services.

    #fastcgi_param PHP_ADMIN_VALUE open_basedir=$document_root/:/usr/local/lib/php/:/tmp/;

Or you can disable it for a specific Nginx vhost domain only, leaving all other domains enabled with open_basedir protection. To disable it for a specific Nginx vhost domain only, you need to make a copy of the /usr/local/nginx/conf/php.conf include file and change the php.conf include line within that specific Nginx vhost i.e. /usr/local/nginx/conf/conf.d/newdomain.com.conf.

Make a copy of the /usr/local/nginx/conf/php.conf include file called /usr/local/nginx/conf/php_disable_openbasedir.conf.

    cp -a /usr/local/nginx/conf/php.conf /usr/local/nginx/conf/php_disable_openbasedir.conf

Then in your /usr/local/nginx/conf/conf.d/newdomain.com.conf, change the include line for /usr/local/nginx/conf/php.conf to /usr/local/nginx/conf/php_disable_openbasedir.conf

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

Then restart Nginx and PHP-FPM services

    nprestart

Owning a VPS or dedicated server means you're responsible for keeping the server up to date software wise. I suggest you sign up for pushover.net service and download appropriate pushover mobile app client to your mobile or tablet device. This will allow you to use your pushover userkey email for notifications for backups or updates i.e. yourUSERkey+devicename+p1@api.pushover.net. Then setup automatic nightly YUM updates via yum-cron and also setup persistent settings that survive auto updates and as added precautiion install the Centmin Mod Addon for an anti-virus malware scanner - Linux Malware Detect (maldet) + ClamAV scanner.

The default php.ini location is at /usr/local/lib/php.ini. However, PHP upgrades via centmin.sh menu option 5 can overwrite that. So it's best to set aside your php.ini level customisations in a separate *.ini file. Centmin Mod by default has a custom file at /etc/centminmod/php.d/a_customphp.ini which has some tweaks to PHP settings already added by default. You can add custom settings to /etc/centminmod/php.d/a_customphp.ini however, they can be also overwritten if future Centmin Mod updates adjust or add tweaks which are automated on PHP-FPM upgrades. So you can instead create a second custom file with naming convention alphabetically below that of /etc/centminmod/php.d/a_customphp.ini i.e. /etc/centminmod/php.d/b_customphp.ini.

Default /etc/centminmod/php.d/a_customphp.ini contents. Note ;always_populate_raw_post_data=-1 is auto uncommented (remove semi-colon ;) when PHP 5.6+ is detected only.

date.timezone = UTC
max_execution_time = 60
short_open_tag = On
realpath_cache_size = 1024k
realpath_cache_ttl = 14400
upload_max_filesize = 40M
memory_limit = 160M
post_max_size = 40M
expose_php = Off
mail.add_x_header = Off
max_input_nesting_level = 128
max_input_vars = 2000
mysqlnd.net_cmd_buffer_size = 16384
;always_populate_raw_post_data=-1

You can add your own custom settings to a newly created file at /etc/centminmod/php.d/b_customphp.ini i.e. double default max_execution_time from 60 to 120. PHP-FPM will process those in a specific alpha-numeric order where later ini files override the former.

max_execution_time = 120

Then restart PHP-FPM service via either command shortcut or full service restart command

fpmrestart

or

service php-fpm restart

Confirming changes are in effect by looking at phpinfo file. Centmin Mod sets this up on main hostname with randomised prefix unqiue to each Centmin Mod install. You can rename this file, delete it or password protect or IP address restrict it if you want. In below example, the install created phpinfo file at /usr/local/nginx/html/417911c9_phpi.php which would be accesible online via yourmainhostname.com/417911c9_phpi.php or localhost/417911c9_phpi.php.

ls -lah /usr/local/nginx/html | grep phpi                          
-rw-r--r-- 1 nginx nginx   20 Jul 28 11:31 417911c9_phpi.php

You don't need to move out of SSH session to do a simple check - use lynx command grep can confirm the changes.

before

lynx -dump localhost/417911c9_phpi.php | grep max_execution_time    
   max_execution_time 60 60

after

lynx -dump localhost/417911c9_phpi.php | grep max_execution_time    
   max_execution_time 120 120

Typing the command php --ini, will output the list of *.ini files PHP-FPM has detected and the order in which they are processed.

php --ini

default before custom /etc/centminmod/php.d/b_customphp.ini file added

php --ini
Configuration File (php.ini) Path: /usr/local/lib
Loaded Configuration File:         /usr/local/lib/php.ini
Scan for additional .ini files in: /etc/centminmod/php.d
Additional .ini files parsed:      /etc/centminmod/php.d/a_customphp.ini,
/etc/centminmod/php.d/curlcainfo.ini,
/etc/centminmod/php.d/geoip.ini,
/etc/centminmod/php.d/igbinary.ini,
/etc/centminmod/php.d/imagick.ini,
/etc/centminmod/php.d/memcache.ini,
/etc/centminmod/php.d/memcached.ini,
/etc/centminmod/php.d/mongodb.ini,
/etc/centminmod/php.d/redis.ini,
/etc/centminmod/php.d/zendopcache.ini

after custom /etc/centminmod/php.d/b_customphp.ini file added and PHP-FPM service restarted

php --ini
Configuration File (php.ini) Path: /usr/local/lib
Loaded Configuration File:         /usr/local/lib/php.ini
Scan for additional .ini files in: /etc/centminmod/php.d
Additional .ini files parsed:      /etc/centminmod/php.d/a_customphp.ini,
/etc/centminmod/php.d/b_customphp.ini,
/etc/centminmod/php.d/curlcainfo.ini,
/etc/centminmod/php.d/geoip.ini,
/etc/centminmod/php.d/igbinary.ini,
/etc/centminmod/php.d/imagick.ini,
/etc/centminmod/php.d/memcache.ini,
/etc/centminmod/php.d/memcached.ini,
/etc/centminmod/php.d/mongodb.ini,
/etc/centminmod/php.d/redis.ini,
/etc/centminmod/php.d/zendopcache.ini

30a
31a
32a
33a
34a
.

Site FAQ


Forums FAQ