Centmin Mod LEMP Stack Install on CentOS
The following steps will allow you to install Nginx based Centmin Mod LEMP stack on AlmaLinux 8/9 or Rocky Linux 8/9 based operating system servers..
Installation Notes:
- SELINUX must be disabled.
- Initial Centmin Mod installation needs to be done as full root user rather than as sudo user and
centmin.sh
shell based menu needs to be run as full root user. - Tip #1: For best security and performance you would want to use a KVM based VPS server or dedicated servers. Centmin Mod can detect whether OpenVZ or Xen/KVM virtualization is being used and auto optimise the server environment based on that info. OpenVZ VPS due to the limitations and use of host level Kernel can not be auto optimized to the level that KVM, Xen or dedicated servers can.
- Tip #2: Centmin Mod currently DOES NOT fully support LXD/LXC containers due to the fact that not all web hosts properly configure LXD/LXC container at the LXD/LXC host level for CentOS support. Centmin Mod 123.09beta01 and newer, has preliminary and on-going developmental LXD support if LXD containers are properly configure at LXD host node level first. But it's still a work in progress. See comment here & some of the LXD config issues LXD web host providers need to be aware of for CentOS here. If you're using and configuring your own server with LXD containers, then you'd need to properly configure LXD at LXD host level. For least problems, use KVM VPSes instead.
- Tip #3: For best performance and latest feature improvements, ensure you're using PHP 8.1, PHP 8.2 or PHP 8.3 provided your web app supports the versions. See PHP 7.4 vs 7.3 vs 7.2 vs 7.1 vs 7.0 benchmarks here and PHP 8.0 JIT vs 8.0 vs 7.4 vs 7.3 vs 7.2 vs 7.1 vs 7.0 benchmarks here.
- Currently, only x86/x86_64 architecture is supported and ARMv7/8 based cpus isn't supported fully due to CentOS ARM compatibility with 3rd party YUM repositories that Centmin Mod uses. Hopefully, in future it maybe so keep an eye on Centmin Mod Community Forum's Beta Release forums for any updates.
- For disk partitioning it's recommended to have one large single root
/
partition. If you plan to use Docker, pay attention to default file system used EXT4 versus XFS when formatting partitions (on dedicated servers). Details here. - Optimally, for KVM/Xen/VMWare or dedicated you should configure your server with at least 4GB swap space if possible.
- 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.
- For AlmaLinux or Rocky Linux 8/9 operating systems, the minimum system requirements are 2GB memory + 4GB swap disk and 40GB disk space.
- Highly recommended is at least 4GB memory + 4GB swap disk and 60GB disk space.
- 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
- 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.
- 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 - Upcloud - signees also get US$25 credits to use as well, BuyVM.net KVM Slices, 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.
- 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.
- The Configuration Files page outlines all the Centmin Mod LEMP stack environments' configuration files and their paths.
- 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
Quick Curl Installer
Centmin Mod LEMP stack has two branches - a stable release and a beta release version. Both branches support continuous updates within their respective branches via SSH command - cmupdate - this command can also switch between the stable and beta release branches.
Stable Release
Centmin Mod Stable Release Install: 131.00stable (released July 1, 2024).
default PHP 8.0 installation - with backported security patches from PHP 8.1+
yum -y update curl -O https://lb1.centminmod.com/installer.sh && chmod 0700 installer.sh && bash installer.sh
default PHP 8.1 installation
yum -y update curl -O https://lb1.centminmod.com/installer81.sh && chmod 0700 installer81.sh && bash installer81.sh
default PHP 8.2 installation
yum -y update curl -O https://lb1.centminmod.com/installer82.sh && chmod 0700 installer82.sh && bash installer82.sh
default PHP 8.3 installation
yum -y update curl -O https://lb1.centminmod.com/installer83.sh && chmod 0700 installer83.sh && bash installer83.sh
default PHP 7.4 installation - with backported security patches from PHP 8.1+
yum -y update curl -O https://lb1.centminmod.com/installer74.sh && chmod 0700 installer74.sh && bash installer74.sh
Beta Release
Centmin Mod Latest Beta Release Install: 140.00beta01 (released July 1, 2024).
If you want to latest development branch of latest Centmin Mod beta, you can switch to using the betainstaller.sh
one liner below.
The beta installer has a choice of which version of PHP you want to default to on initial install. The PHP default options are below:
default PHP 8.1 installation
yum -y update curl -O https://lb1.centminmod.com/betainstaller.sh && chmod 0700 betainstaller.sh && bash betainstaller.sh
default PHP 8.2 installation
yum -y update curl -O https://lb1.centminmod.com/betainstaller82.sh && chmod 0700 betainstaller82.sh && bash betainstaller82.sh
default PHP 8.3 installation
yum -y update curl -O https://lb1.centminmod.com/betainstaller83.sh && chmod 0700 betainstaller83.sh && bash betainstaller83.sh
default PHP 8.0 installation - with backported security patches from PHP 8.1+
yum -y update curl -O https://lb1.centminmod.com/betainstaller.sh && chmod 0700 betainstaller.sh && bash betainstaller.sh
default PHP 7.4 installation - with backported security patches from PHP 8.1+
yum -y update curl -O https://lb1.centminmod.com/betainstaller74.sh && chmod 0700 betainstaller74.sh && bash betainstaller74.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 or DNF Time: 97.0663 seconds Total YUM Time: 40.502569401 seconds Total YUM or DNF + Source Download Time: 60.8252 Total Nginx First Time Install Time: 36.5120 Total PHP First Time Install Time: 180.5461 Download From Github Time: 1.8135 Total Time Other eg. source compiles: 197.6303 Total Centmin Mod Install Time: 475.5136 --------------------------------------------------------------------------- Total Install Time for curl yum + cm install + zip download: 574.3934 seconds --------------------------------------------------------------------------- AlmaLinux 8.10 Cerulean Leopard 4.18.0-553.5.1.el8_10.x86_64 16 AMD EPYC-Milan Processor 16 3393.624 PHP VERSION: 8.0.30 --------------------------------------------------------------------------- Centmin Mod Version: 131.00stable.b000 Install Summary Logs: /root/centminlogs/installer_summary_links.log ---------------------------------------------------------------------------
The summary log link /root/centminlogs/installer_summary_links.log
contains a summary of key logs you can use to troubleshoot your initial Centmin Mod installation. 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 16M -rw-r--r-- 1 root root 928 Jul 1 14:10 centminmod_swapsetup_installer_010724-141042.log -rw-r--r-- 1 root root 19 Jul 1 14:13 getcmtime_installtime_010724-141042.log -rw-r--r-- 1 root root 948 Jul 1 14:13 iconv_fix_20240701-141326.log -rw-r--r-- 1 root root 12K Jul 1 14:14 centminmod_140.00beta01.b000_010724-141322_yuminstall_centos8.log -rw-r--r-- 1 root root 34K Jul 1 14:14 centminmod_yumtimes_010724-141322.log -rw-r--r-- 1 root root 37 Jul 1 14:14 centminmod_profiletimes_010724-141322.log -rw-r--r-- 1 root root 2.3K Jul 1 14:14 cmm-login-git-checks_010724-141416.log -rw-r--r-- 1 root root 65K Jul 1 14:14 centminmod_downloadtimes_010724-141322.log -rw-r--r-- 1 root root 320 Jul 1 14:14 securedtmp.log -rw-r--r-- 1 root root 3.8K Jul 1 14:14 nginx_pcre_download_010724-141322.log -rw-r--r-- 1 root root 50K Jul 1 14:14 nginx-install-zlib_010724-141322.log -rw-r--r-- 1 root root 426 Jul 1 14:14 patch_patchnginx_010724-141322.log -rw-r--r-- 1 root root 29K Jul 1 14:14 centminmod_140.00beta01.b000_010724-141322_pcre-nginx_install.log -rw-r--r-- 1 root root 135 Jul 1 14:14 centminmod_140.00beta01.b000_010724-141322_nginx_zstd.log -rw-r--r-- 1 root root 8.9K Jul 1 14:15 nginx-configure-010724-141322.log -rw-r--r-- 1 root root 480K Jul 1 14:15 centminmod_ngxinstalltime_010724-141322.log -rw-r--r-- 1 root root 55 Jul 1 14:15 setmycnf_140.00beta01.b000_010724-141322.log -rw-r--r-- 1 root root 9.4K Jul 1 14:15 setio_innodbstatus-before-010724-141546.log -rw-r--r-- 1 root root 786 Jul 1 14:15 centminmod_setio_010724-141546.log -rw-r--r-- 1 root root 9.3K Jul 1 14:15 setio_innodbstatus-after-010724-141546.log -rw-r--r-- 1 root root 791 Jul 1 14:15 mariadb10.4-or-above-check-users-before.log -rw-r--r-- 1 root root 0 Jul 1 14:15 mariadb10.4-or-above-check-users-after.log -rw-r--r-- 1 root root 377 Jul 1 14:15 set-dot-my.cnf.log -rw-r--r-- 1 root root 11K Jul 1 14:15 patch_php_010724-141322.log -rw-r--r-- 1 root root 91 Jul 1 14:15 etc-centminmod-custom-config-settings_010724-141322.log -rw-r--r-- 1 root root 74K Jul 1 14:18 php-compile-config-010724-141322.log.gz -rw-r--r-- 1 root root 58 Jul 1 14:18 centminmod_phpinstalltime_010724-141322.log -rw-r--r-- 1 root root 472 Jul 1 14:18 zendopcache_passfile.txt -rw-r--r-- 1 root root 2.7K Jul 1 14:20 redis-server-install_010724-141322.log -rw-r--r-- 1 root root 1 Jul 1 14:21 centminmod_140.00beta01.b000_010724-141322_yum-log.log -rw-r--r-- 1 root root 2.9M Jul 1 14:21 centminmod_140.00beta01.b000_010724-141322_install.log -rw-r--r-- 1 root root 3.0M Jul 1 14:21 installer_cmm_010724-141042.log -rw-r--r-- 1 root root 55 Jul 1 14:21 firstyum_installtime_010724-141042.log -rw-r--r-- 1 root root 1.1K Jul 1 14:21 install_time_stats_010724-141042.log -rw-r--r-- 1 root root 3.2M Jul 1 14:21 installer_010724-141042.log -rw-r--r-- 1 root root 1.3M Jul 1 14:21 installer_010724-141042_minimal.log -rw-r--r-- 1 root root 3.0K Jul 1 14:21 sar-u-installstats.log -rw-r--r-- 1 root root 2.7K Jul 1 14:21 sar-q-installstats.log -rw-r--r-- 1 root root 4.4K Jul 1 14:21 sar-r-installstats.log -rw-r--r-- 1 root root 7.0K Jul 1 14:21 sar-d-installstats.log -rw-r--r-- 1 root root 2.4K Jul 1 14:21 sar-b-installstats.log -rw-r--r-- 1 root root 564 Jul 1 14:21 installer_summary_links.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 Menu 131.00stable centminmod.com -------------------------------------------------------- 1). Centmin Install 2). Add Nginx vhost domain 3). NSD setup domain name DNS 4). Nginx Upgrade / Downgrade 5). PHP Upgrade / Downgrade 6). MySQL User Database Management 7). Option Being Revised (TBA) 8). Option Being Revised (TBA) 9). Option Being Revised (TBA) 10). Memcached Server Re-install 11). MariaDB MySQL Upgrade & Management 12). Zend OpCache Install/Re-install 13). Install/Reinstall Redis PHP Extension 14). SELinux disable 15). Install/Reinstall ImagicK PHP Extension 16). Change SSHD Port Number 17). Multi-thread compression: zstd,pigz,pbzip2,lbzip2 18). Suhosin PHP Extension install 19). Install FFMPEG and FFMPEG PHP Extension 20). NSD Install/Re-Install 21). Data Transfer (TBA) 22). Add Wordpress Nginx vhost + Cache Plugin 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.