Upgrade Centmin Mod

If English isn't your first language, you can use dropdown menu translator to translate this page into your preferred language.




Centmin Mod allows for much easier Centmin Mod code updates for each release. There's a new centmin.sh menu option 23 which handles updates via Git. As at July 1, 2024, Centmin Mod 131.00stable is the latest stable version. With a Git environment setup you can also auto update Centmin Mod code via a cronjob scheduled task - full install instructions here and also setup persistent settings that survive auto updates.

Upgrading Centmin Mod versions

To update from Centmin Mod 123.09beta01 to 131.00stable or 140.00beta01 run these commands which:

  1. First updates cmupdate tool to support 131.00stable and 140.00beta01 updating.
  2. Then for 131.00stable run cmupdate update-stable command or for 140.00beta01 run cmupdate update-beta command to switch to 131.00stable or 140.00beta01 respectively.
  3. cmdir is the command shortcut equivalent of

    cd /usr/local/src/centminmod

  4. centmin is command shortcut equivalent of running centmin.sh from /usr/local/src/centminmod directory.

For 131.00stable run:

cmupdate
cmupdate update-stable
cmdir
centmin

or for 140.00beta01 run:

cmupdate
cmupdate update-beta
cmdir
centmin

An example for output for cmupdate update-stable command which does the actual switching to 124.00stable branch.

cmupdate update-stable
No local changes to save
Already up to date.
Switching local code branch to 131.00stable

Cloning into 'centminmod'...
remote: Enumerating objects: 838, done.
remote: Counting objects: 100% (838/838), done.
remote: Compressing objects: 100% (591/591), done.
remote: Total 838 (delta 343), reused 553 (delta 224), pack-reused 0
Receiving objects: 100% (838/838), 23.89 MiB | 30.01 MiB/s, done.
Resolving deltas: 100% (343/343), done.

Completed. Fresh /usr/local/src/centminmod code base in place
To run centmin.sh again, you need to change into directory: /usr/local/src/centminmod
cd /usr/local/src/centminmod

And an example for output for cmupdate update-beta command which does the actual switching to 140.00beta01 branch.

cmupdate update-beta
No local changes to save
Already up to date.
Switching local code branch to 140.00beta01

Cloning into 'centminmod'...
remote: Enumerating objects: 892, done.
remote: Counting objects: 100% (892/892), done.
remote: Compressing objects: 100% (632/632), done.
remote: Total 892 (delta 364), reused 577 (delta 237), pack-reused 0
Receiving objects: 100% (892/892), 23.90 MiB | 32.63 MiB/s, done.
Resolving deltas: 100% (364/364), done.

Completed. Fresh /usr/local/src/centminmod code base in place
To run centmin.sh again, you need to change into directory: /usr/local/src/centminmod
cd /usr/local/src/centminmod

Upgrading Centmin Mod 1.2.3-eva2000.07 and older versions

To upgrade older Centmin Mod 1.2.3-eva2000.07 and older versions follow instructions here.

If you came looking for Centmin Mod Install instructions instead - full install instructions here

  --------------------------------------------------------
  Centmin Mod 1.2.3-eva2000.08 - http://centminmod.com
  --------------------------------------------------------
                     Centmin Mod Menu                   
  --------------------------------------------------------
  1).  Centmin Install
  2).  Add Nginx vhost domain
  3).  NSD setup domain name DNS
  4).  Nginx Upgrade / Downgrade
  5).  PHP Upgrade / Downgrade
  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/5.5 & 10.x Upgrade Sub-Menu
  12). Zend OpCache Install/Re-install
  13). Install ioping.sh vbtechsupport.com/1239/
  14). SELinux disable
  15). Install/Reinstall ImagicK PHP Extension
  16). Change SSHD Port Number
  17). Multi-thread compression: pigz,pbzip2,lbzip2...
  18). Suhosin PHP Extension install
  19). Install FFMPEG and FFMPEG PHP Extension
  20). NSD Re-install
  21). Update - Nginx   PHP-FPM   Siege
  22). Add Wordpress Nginx vhost   WP Super Cache
  23). Update Centmin Mod Code Base
  24). Exit
  --------------------------------------------------------
  Enter option [ 1 - 24 ] 23
  --------------------------------------------------------
  
  --------------------------------------------------------
          Centmin Mod Updater Sub-Menu          
  --------------------------------------------------------
  1). Setup Centmin Mod Github Environment
  2). Update Centmin Mod Current Branch
  3). Update Centmin Mod Newer Branch
  4). Back to Main menu
  --------------------------------------------------------
  Enter option [ 1 - 4 ]     
  

Enter submenu option 1 to setup Github local environment. Once setup hit submenu option 4 to go back and then centmin.sh menu option 24 to exit. Then log out and log back into SSH window session to complete the process. From then on, you can use centmin.sh menu option 23 -> submenu option 2 to easily update your local Centmin Mod code itself. This won't update your software like Nginx, PHP-FPM. It's only to updating the shell scripts that make up and power Centmin Mod's centmin.sh core.

 --------------------------------------------------------
         Centmin Mod Updater Sub-Menu          
 --------------------------------------------------------
 1). Setup Centmin Mod Github Environment
 2). Update Centmin Mod Current Branch
 3). Update Centmin Mod Newer Branch
 4). Back to Main menu
 --------------------------------------------------------
 Enter option [ 1 - 4 ] 1
 --------------------------------------------------------
 
 setup Centmin Mod git sourced install...
 
 download github.com centmin mod 123.08beta03 branch repo
 Cloning into 'centminmod-123.08beta03'...
 Switched to a new branch '123.08beta03'
 Branch 123.08beta03 set up to track remote branch 123.08beta03 from origin.
 
 list all available local branches
         git branch -a
 * 123.08beta03
   master
   remotes/origin/123.06stable
   remotes/origin/123.07stable
   remotes/origin/123.08beta03
   remotes/origin/123.08centos7beta01
   remotes/origin/123.08centos7beta02
   remotes/origin/123.08livestats
   remotes/origin/123.08lua
   remotes/origin/123.08zerodown
   remotes/origin/HEAD -> origin/master
   remotes/origin/master
 
 list git log last commit
         git log -a
 commit 0a14b23ee0ec2c7787bdfc6befd58d5fb13475dd
 Author: George Liu 
 Date:   Sun May 31 14:40:29 2015  1000
 
     add tools/gitsetup.sh to automate steps to switch to git updated code base
     https://community.centminmod.com/threads/working-with-git-command-line-for-updating-centmin-mod-local-copies.2150/
 
 to update centmin mod 123.08beta03 branch repo via git
         cd /usr/local/src/centminmod-123.08beta03
         git stash
         git pull
         chmod  x centmin.sh 
 

if you try submenu option 2 and you haven't done submenu option 1 yet

--------------------------------------------------------
        Centmin Mod Updater Sub-Menu          
--------------------------------------------------------
1). Setup Centmin Mod Github Environment
2). Update Centmin Mod Current Branch
3). Update Centmin Mod Newer Branch
4). Back to Main menu
--------------------------------------------------------
Enter option [ 1 - 4 ] 2
--------------------------------------------------------

Error: you do not have git environment setup for github based updates
       run submenu option 1 to setup github environment first    

switching to a new github branch via submenu option 3 i.e. switching to 123.08beta03

--------------------------------------------------------
        Centmin Mod Updater Sub-Menu            
--------------------------------------------------------
1). Setup Centmin Mod Github Environment
2). Update Centmin Mod Current Branch
3). Update Centmin Mod Newer Branch
4). Back to Main menu
--------------------------------------------------------
Enter option [ 1 - 4 ] 3
--------------------------------------------------------

Update Centmin Mod to newer branch via git
You need to input the name of the branch
List of current remote branches by descending date order

2015-05-31 16:54:41  1000 4 minutes ago 123.08beta03updater
2015-05-31 14:40:29  1000 2 hours ago   123.08beta03
2015-05-29 20:22:39  1000 2 days ago    master
2015-05-29 20:22:39  1000 2 days ago    master
2015-05-28 21:20:39  1000 3 days ago    123.08livestats
2015-05-28 15:29:07  1000 3 days ago    123.08lua
2015-05-27 15:54:13  1000 4 days ago    123.08centos7beta02
2015-05-17 19:25:36  1000 2 weeks ago   123.07stable
2015-05-12 00:44:49  1000 3 weeks ago   123.08centos7mongodb
2015-05-08 03:36:57  1000 3 weeks ago   123.08centos7setmisc
2015-04-13 12:00:17  1000 7 weeks ago   123.08centos7beta02wp
2015-04-07 12:33:43  1000 8 weeks ago   123.08centos6beta02redis
2015-04-04 05:50:25  1000 8 weeks ago   123.07stable-fixes
2015-03-25 03:45:39  1000 10 weeks ago  123.08zerodown
2015-03-10 16:52:48  1000 3 months ago  123.08geoip
2015-03-10 16:52:37  1000 3 months ago  123.08centos7beta01
2015-02-24 22:19:38  1000 3 months ago  123.07stable_intel
2015-02-02 00:51:34  1000 4 months ago  123.08slowfs
2014-06-23 17:08:44  1000 11 months ago 123.06stable
        ->

Enter the branch name you want to switch to i.e. 123.08beta03 : 123.08beta03

download github.com centmin mod 123.08beta03 branch repo
Cloning into 'centminmod-123.08beta03'...            


Auto Updating Centmin Mod Code

Centmin Mod 124.00stable and higher versions include a native /usr/bin/cmupdate command shortcut which allows you to update your Centmin Mod server's local code with latest updates. This is done via Git since initial installation of Centmin Mod installs the local Centmin Mod code via Github repository at /usr/local/src/centminmod. The initial Git setup is completed once after you ran centmin.sh shell menu for the first time.

As the Centmin Mod initial installation sets up a Git environment after you ran centmin.sh shell menu for the first time, you can use the native /usr/bin/cmupdate to run it on a scheduled cronjob.

An example for setting up a cronjob every 3hrs using crontab -e command

15 */3 * * * /usr/bin/cmupdate >/dev/null 2>&1

You can also manually run /usr/bin/cmupdate script which will also update the code and list the last commit made.

An example of output from /usr/bin/cmupdate command when there are no updates available

cmupdate

Saved working directory and index state WIP on 124.00stable: bf9fd3c update PHP libicu routine in 124.00stable
HEAD is now at bf9fd3c update PHP libicu routine in 124.00stable
Already up-to-date.
No local changes to save
Already up-to-date.

An example of output from /usr/bin/cmupdate command when there are updates available

cmupdate

No local changes to save
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 6 (delta 5), reused 6 (delta 5), pack-reused 0
Unpacking objects: 100% (6/6), done.
From https://github.com/centminmod/centminmod
   bf9fd3c..6610880  124.00stable -> origin/124.00stable
Updating bf9fd3c..6610880
Fast-forward
 centmin-cli.sh    | 2  -
 centmin.sh        | 2  -
 tools/cmupdate.sh | 1  
 3 files changed, 3 insertions( ), 2 deletions(-)
No local changes to save
Already up-to-date.


Persistent Settings via custom_config.inc

With auto cron updates for Centmin Mod code in place, you'll ask what about custom settings changes made in centmin.sh - will they be lost on auto updates ? Centmin Mod 1.2.3-eva2000.08 added support for a separate and persistent custom_config.inc file to place custom centmin.sh settings/variables in which override centmin.sh defaults. This comes in handy when updating Centmin Mod but wanting your custom settings in centmin.sh to be untouched.

Supports 2 locations for custom_config.inc

  1. inc/custom_config.inc where centmin.sh base directory resides
  2. at ${CONFIGSCANBASE}/custom_config.inc which defaults to /etc/centminmod/custom_config.inc

To override centmin.sh settings and allow them to persist on centmin mod code updates, create a custom_config.inc at one of the 2 locations mentioned above and add the centmin.sh option to the custom_config.inc file.

i.e. to set PHP 5.6.13 as default, place in manually created file at /etc/centminmod/custom_config.inc the following variables which are in centmin.sh to override centmin.sh ones and then recompile PHP via centmin.sh menu option 5.

PHP_VERSION='5.6.13'

Or to enable Nginx with IPv6 by default

NGINX_IPV='y'

Another example is if you want to disable unnecessary Nginx modules on Nginx compile/recompiles via centmin.sh menu option 4. You'd add to /etc/centminmod/custom_config.inc the following variables and then recompile Nginx via centmin.sh menu option 4:

NGINX_STREAM=n               # http://nginx.org/en/docs/stream/ngx_stream_core_module.html
NGINX_RTMP=n                 # Nginx RTMP Module support https://github.com/arut/nginx-rtmp-module
NGINX_FLV=n                  # http://nginx.org/en/docs/http/ngx_http_flv_module.html
NGINX_MP4=n                  # Nginx MP4 Module http://nginx.org/en/docs/http/ngx_http_mp4_module.html
NGINX_AUTHREQ=n              # http://nginx.org/en/docs/http/ngx_http_auth_request_module.html
NGINX_SECURELINK=n           # http://nginx.org/en/docs/http/ngx_http_secure_link_module.html
NGINX_FANCYINDEX=n           # http://wiki.nginx.org/NgxFancyIndex
NGINX_VHOSTSTATS=n           # https://github.com/vozlt/nginx-module-vts
NGINX_PAGESPEED=n            # Install ngx_pagespeed
NGINX_PASSENGER='n'          # Install Phusion Passenger requires installing addons/passenger.sh before hand
NGINX_WEBDAV=n               # Nginx WebDAV and nginx-dav-ext-module
NGINX_UPSTREAMCHECK='n'      # nginx upstream check https://github.com/yaoweibin/nginx_upstream_check_module
NGINX_OPENRESTY='n'            # Agentzh's openresty Nginx modules
LUAJIT_GITINSTALL='n'        # opt to install luajit 2.1 from dev branch http://repo.or.cz/w/luajit-2.0.git/shortlog/refs/heads/v2.1
ORESTY_LUANGINX='n'             # enable or disable or ORESTY_LUA* nginx modules below


Upgrade Centmin Mod 1.2.3-eva2000.07 and older Releases

Centmin Mod 1.2.3-eva2000.08 and higher versions have moved to using Git repository for easier updates. To update Centmin Mod 1.2.3-eva2000.07 and older releases to this newer method of upgrade outlined above. Follow these steps below.

Centmin Mod 1.2.3-eva2000.07 and older releases install Centmin Mod code to the directory at /usr/local/src/centmin-v1.2.3mod. Centmin Mod 1.2.3-eva2000.08 and higher changed the install directory to /usr/local/src/centminmod. So the below upgrade process makes changes to that default install directory and implements it via Git.

Type following commands in SSH session as root user

Step 1. Whitelist git port 9418

sed -i "s/TCP_IN = \"/TCP_IN = \"9418,/g" /etc/csf/csf.conf
sed -i "s/TCP6_IN = \"/TCP6_IN = \"9418,/g" /etc/csf/csf.conf    
sed -i "s/TCP_OUT = \"/TCP_OUT = \"9418,/g" /etc/csf/csf.conf
sed -i "s/TCP6_OUT = \"/TCP6_OUT = \"9418,/g" /etc/csf/csf.conf
csf -r

Step 2. Update Centmin Mod via Git

Update to Centmin Mod 1.2.3-eva2000.08 stable branch of git = 123.08stable from Centmin Mod Github Repository. This will setup Centmin Mod code in install directory at /usr/local/src/centminmod.

cd /usr/local/src
mv centmin-v1.2.3mod/ centmin-v1.2.3mod-orig
yum -y install git -q
git clone https://github.com/centminmod/centminmod.git centminmod
cd centminmod
git checkout -f 123.08stable

Then run once to do any auto detected update tasks i.e. ccache gets updated if detected to not exist or be an older version.

cd /usr/local/src/centminmod
./centmin.sh

Step 3. This step is optional. Centmin Mod 1.2.3-eva2000.08 defaults to using MariaDB 10.0.x MySQL server. While older releases used MariaDB 5.5 MySQL server. You can update your older install to MariaDB 10.0.x MySQL server via centmin.sh menu option 11, submenu option 3.

--------------------------------------------------------
Centmin Mod 1.2.3-eva2000.08 - http://centminmod.com
--------------------------------------------------------
                   Centmin Mod Menu                   
--------------------------------------------------------
1).  Centmin Install
2).  Add Nginx vhost domain
3).  NSD setup domain name DNS
4).  Nginx Upgrade / Downgrade
5).  PHP Upgrade / Downgrade
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/5.5 & 10.x Upgrade Sub-Menu
12). Zend OpCache Install/Re-install
13). Install ioping.sh vbtechsupport.com/1239/
14). SELinux disable
15). Install/Reinstall ImagicK PHP Extension
16). Change SSHD Port Number
17). Multi-thread compression: pigz,pbzip2,lbzip2...
18). Suhosin PHP Extension install
19). Install FFMPEG and FFMPEG PHP Extension
20). NSD Re-install
21). Update - Nginx   PHP-FPM   Siege
22). Add Wordpress Nginx vhost   WP Super Cache
23). Update Centmin Mod Code Base
24). Exit
--------------------------------------------------------
Enter option [ 1 - 24 ] 11
--------------------------------------------------------

--------------------------------------------------------
        MariaDB MySQL Upgrade Sub-Menu              
--------------------------------------------------------
1). MariaDB 5.2.x Branch Upgrade Only
2). MariaDB 5.2.x to MariaDB 5.5 YUM upgrade
3). MariaDB 5.5 to MariaDB 10.x YUM upgrade
4). MariaDB 5.5 to MariaDB 10.1.x YUM upgrade
5). MariaDB 10.x to MariaDB 10.1.x YUM upgrade
6). Back to Main menu
--------------------------------------------------------
Enter option [ 1 - 6 ] 

MariaDB 10.0.x server can then be easily updated via YUM update commands:

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

Step 4. This step is also optional. Centmin Mod 1.2.3-eva2000.08 and higher has a preset included download files for base versions of software that Centmin Mod relies on and usually these downloads that comes inside the download zip for Centmin Mod are extracted on fresh initial installs only. So if you're upgrading from Centmin Mod .07 and older, they won't be extracted so you can manually extract these from /downloads/svr-setup.zip to /svr-setup using this command in SSH as root user. This may save download time as Centmin Mod if it doesn't detect the required software in /svr-setup, it will auto download what is required. However, sometimes servers connectivity to remote downloads can be flaky so this manual extraction method at least ensures the initial software downloads that Centmin Mod requires is available.

/usr/bin/unzip -qo /usr/local/src/centminmod/downloads/svr-setup.zip -d /

If there any prompts for overwrite, you can select Yes or A for ALL and your local /svr-setup download folder should have base software version downloads now for centmin.sh specified version downloads.

Then run centmin.sh menu options to upgrade php-fpm and nginx.


What updating Centmin Mod does ?

Upgrading Centmin Mod involves 2 parts.

  1. Upgrading the actual Centmin Mod code which you downloaded via git as outlined above. This is heart of Centmin Mod where the code is the engine that runs centmin.sh shell based menu and all the automation you're accustomed to.
  2. Upgrade software that Centmin Mod installed or manages. For this part following outline at Upgrade - How to upgrade Centmin Mod is best.

So essentially, you can upgrade from 1.2.3-eva2000.07 to 1.2.3-eva2000.08 in place, but not everything is upgraded as some things like server initial environment setup isn't changed i.e. how swap, tmp setup and allocation are created etc. The main parts from part 2 above are what in place upgrades do i.e. Nginx and PHP-FPM compilation and config/settings parameters and MariaDB version from 5.5 to 10.0.x. If you want the full environment changed including tmp and swap setup to .08's configuration, then you would need a fresh OS install and fresh .08 initial install. You can think of it like upgrading Windows 7 to Windows 8. An in place upgrade will upgrade code but won't change your computer environment from when you installed Windows 7 i.e. disk configuration and partition sizes won't change from when you initially installed Windows 7. Only way to change that would be fresh Windows 8 install.