Centmin Mod LEMP Stack Install on CentOS

The following steps will allow you to install Nginx based Centmin Mod LEMP stack on CentOS 6 or CentOS 7 based server.

Installation Notes:

  1. SELINUX must be disabled.
  2. For disk partitioning it's recommended to have one large single root / partition. Especially for CentOS 7.x.
  3. Optimally, for KVM/Xen/VMWare or dedicated you should configure your server with at least 1GB to 2GB swap space if possible. This does not apply to OpenVZ VPS where you may not have control over swap depending on how OpenVZ is configured.
  4. Choose non-OpenVZ based VPS server i.e. dedicated, KVM, Xen or VMWare if you want to be able to tune TCP settings (sysctl.conf), update and use own Linux Kernels. You are not able to do those tasks with OpenVZ VPSes.
  5. Minimum system requirements are 256MB memory (128MB with variable tweak) for CentOS 6.x and 1GB memory for CentOS 7.x 64bit and 20GB disk space for OpenVZ VPS virtualization & 30GB for KVM and Xen virtualisation. These requirements were recently revised here.
  6. Recommended memory & disk requirements are double the mininum for CentOS 6/7 respectively at CentOS 6.x 512MB memory and CentOS 7.x 64bit at 2GB memory and disk space of 40GB for OpenVZ and 60GB for KVM/Xen virtualisation.
  7. If you plan on using PHP Composer for your web applications, you will want to have at least 3-4GB of memory on your server as Composer can use up to 1.5+ GB memory requirements itself and may require you raising the PHP memory_limit up to 1.5GB or more
  8. After install, check out the next steps in the Getting Started Guide and be sure to read how to update Centmin Mod code itself via Centmin Mod Upgrade page.
  9. If you're looking for cheap VPS hosting for Centmin Mod, the following are highly recommended & proven to work with Centmin Mod LEMP web stack - BuyVM.net KVM Slices, RamNode, Linode, DigitalOcean and Vultr. If using OVH or SoYouStart servers, make sure to use CentOS OS template with distro kernels and not OVH/SYS provided custom kernels.
  10. Check out Centmin Mod VPS hosting & Centmin Mod Dedicated server hosting forums for VPS and dedicated hosting reviews, benchmarks and discussions with other Centmin Mod users.
  11. The Configuration Files page outlines all the Centmin Mod LEMP stack environments' configuration files and their paths.
  12. After initial install, you can invoke the centmin.sh menu as outlined at here.


If you find Centmin Mod useful, please consider a donation or a community forum Premium Membership

Support Centmin Mod Donate

Quick Curl Installer

The curl installer method was added from Centmin Mod 1.2.3-eva2000.08+ onwards and is the easiest way to install Centmin Mod which allows for fully unattended installs. It is the preferred method of installation as opposed to centmin.sh menu option 1 method. It's just one line you type in SSH session as root user on a fresh virgin CentOS 6 or CentOS 7 OS environment. Resource video also has an example install at Centmin Mod .08 beta SSH one liner install on CentOS 6 + CentOS 7 simultaneously.

Centmin Mod Stable Release Install: 123.08stable

Note, it's highly recommended to try new and much improved latest Centmin Mod beta below though as it's much improved and will soon be latest stable once the updated documentation/guides are written up.

yum -y update; curl -O https://centmin.com/installer.sh && chmod 0700 installer.sh && bash installer.sh

Centmin Mod Latest Beta Release Install: 123.09beta01

If you want to try new and much improved latest Centmin Mod beta, you can switch to using the betainstaller.sh one liner below. The latest beta also adds optional Auditd & MariaDB Audit Plugin support which you can try out. There's also a tools/autoprotect.sh script you may need to tune to your web hosts' web apps which rely on Apache .htaccess protection which isn't supported by Nginx.

yum -y update; curl -O https://centmin.com/betainstaller.sh && chmod 0700 betainstaller.sh && bash betainstaller.sh

Once install completes, you'll have some basic info including mysql root password, memcached password and a post-install check list of major software installed's version numbers and also some install time stats.

---------------------------------------------------------------------------
Total Curl Installer YUM Time: 92.0033 seconds
Total YUM Time: 43.166100082 seconds
Total YUM + Source Download Time: 58.0522
Total Nginx First Time Install Time: 135.9561
Total PHP First Time Install Time: 130.5067
Download Zip From Github Time: 4.1942
Total Time Other eg. source compiles: 206.9870
Total Centmin Mod Install Time: 531.5020
---------------------------------------------------------------------------
Total Install Time (curl yum + cm install + zip download): 627.6995 seconds
---------------------------------------------------------------------------
                                

You can also find this info later on in Centmin Mod logs directory at /root/centminlogs. Every centmin.sh menu run has a log created and is time stamped for easier reference. For example listing in reverse time ascending order (most recent last).

ls -lAhrt /root/centminlogs/
total 4.0M
-rw-r--r-- 1 root root  19K Jun 16 05:31 centminmod_1.2.3-eva2000.08_160615-012722_yuminstall_centos6.log
-rw-r--r-- 1 root root  71K Jun 16 05:32 centminmod_yumtimes_160615-012722.log
-rw-r--r-- 1 root root   38 Jun 16 05:32 centminmod_profiletimes_160615-012722.log
-rw-r--r-- 1 root root 251K Jun 16 05:32 centminmod_downloadtimes_160615-012722.log
-rw-r--r-- 1 root root  199 Jun 16 05:32 securedtmp.log
-rw-r--r-- 1 root root   44 Jun 16 05:34 centminmod_libresslinstalltime_160615-012722.log
-rw-r--r-- 1 root root 1.2K Jun 16 05:34 gcc_native.log
-rw-r--r-- 1 root root 959K Jun 16 05:35 centminmod_ngxinstalltime_160615-012722.log
-rw-r--r-- 1 root root   58 Jun 16 05:38 centminmod_phpinstalltime_160615-012722.log
-rw-r--r-- 1 root root  21K Jun 16 05:41 centminmod_1.2.3-eva2000.08_160615-012722_yum-log.log
-rw-r--r-- 1 root root   20 Jun 16 05:41 install.utc.time.log
-rw-r--r-- 1 root root 2.7M Jun 16 05:41 centminmod_1.2.3-eva2000.08_160615-012722_install.log
                                


Getting Started Guide

Read, bookmark and regularly check back with the Getting Started Guide. Also read the How to troubleshoot Centmin Mod initial install issues guide. Reading Getting Started Guide is the most important thing you can do after Centmin Mod install as it gives you a good understanding and starting point to everything else - including adding Nginx vhost/domains (centmin.sh option 2), upgrade/downgrade/recompiling Nginx (centmin.sh menu option 4), PHP (menu option 5) etc.

Log out of SSH and log back into SSH and run centmin.sh command to invoke the menu options. You can find the resource video for finding centmin.sh at How to find and run centmin.sh menu options for Centmin Mod LEMP stack based servers

--------------------------------------------------------
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, 10.1 Upgrade Sub-Menu
12). Zend OpCache Install/Re-install
13). Install ioping.sh vbtechsupport.com/1239/
14). SELinux disable
15). Install/Re-install ImageMagick PHP Extension
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). 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 ]
                                

Check out how to setup centmin.sh menu option 23, submenu option 1 so you can setup git environment for easier Centmin Mod LEMP script code updates Beta Branch - New .08 beta menu option - updating Centmin Mod via git. You can also setup a cronjob to auto update too see Beta Branch - Cronjob Auto Updating Centmin Mod .08 beta03 How To Guide

centmin.sh option 23 submenu options

--------------------------------------------------------
        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 ]
                                

Once git environment setup, hit submenu option 4 to go back to main menu, hit menu option 24 to exit centmin.sh. Then log out of SSH and back in to complete setup.