Upgrade Centmin Mod

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 1.2.3-eva2000.08+ and higher 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. 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 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 1.2.3-eva2000.08+ and higher versions can allow you to auto update the Centmin Mod code installed at /usr/local/src/centminmod if you have setup the Git environment via centmin.sh menu option 23 -> submenu option 1. You can discuss this setup on the forums here.

After you have setup the initial Git environment outlined above, you can create a file at /root/tools/updatecm.sh and place the following contents in it.

Create /root/tools directory if it doesn't exist

mkdir -p /root/tools

Then in /root/tools/updatecm.sh put the following code. You would need to update the branchname, when you update Centmin Mod further off in the future. i.e. branchname=123.08stable where branch 123.08stable is the latest stable as of this writing.

#!/bin/bash
branchname=123.08stable
cd /usr/local/src/centminmod
git stash
git pull
git log -1

chmod +x the /root/tools/updatecm.sh file

chmod +x /root/tools/updatecm.sh

then setup cronjob every 3hrs using crontab -e command

15 */3 * * * /root/tools/updatecm.sh 2>/dev/null

You can also manually run script will also update the code and list the last commit made

/root/tools/updatecm.sh

No local changes to save
Already up-to-date.
commit 29a67676c548e82b13079af0c10eebb220509b7c
Author: George Liu 
Date:   Mon Jun 15 17:53:46 2015 +1000

    fix inc/openssl_install.inc for .08 beta 03 for LibreSSL make


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.