How to Run the Centmin Mod Menu (centmin.sh)
The centmin command is the recommended way to launch the Centmin Mod interactive menu. It is a shell alias installed at /usr/bin/centmin and can be run from any directory:
# Recommended: use the centmin alias (available system-wide)
centmin
# Alternative: run centmin.sh directly from its full path
cd /usr/local/src/centminmod && ./centmin.sh
For non-interactive vhost creation without entering the menu, use the nv command at /usr/bin/nv:
# Create vhost with Let's Encrypt SSL (recommended)
nv -d yourdomain.com -s lelived
# Create vhost with self-signed SSL (testing only)
nv -d yourdomain.com -s y
Centmin Mod installs command shortcuts that let you type a single word to edit configuration files or manage services via SSH. These shortcuts are installed during the initial Centmin Mod installation and are available system-wide.
The config editing shortcuts use the nano text editor. Services must be installed for their respective shortcuts to work (e.g., memcached shortcuts require memcached to be installed).
Configuration Editing
Config File Shortcuts
Edit server configuration files with a single command. Each shortcut opens the file in the nano text editor.
| Command | Description | File Path |
|---|---|---|
phpedit
|
Edit php.ini | /usr/local/lib/php.ini |
mycnf
|
Edit MariaDB/MySQL my.cnf | /etc/my.cnf |
fpmconf
|
Edit php-fpm.conf | /usr/local/etc/php-fpm.conf |
nginxconf
|
Edit nginx.conf | /usr/local/nginx/conf/nginx.conf |
vhostconf
|
Edit Nginx default virtual.conf | /usr/local/nginx/conf/conf.d/virtual.conf |
phpinc
|
Edit Nginx php.conf include | /usr/local/nginx/conf/php.conf |
dropinc
|
Edit Nginx drop.conf include | /usr/local/nginx/conf/drop.conf |
statfilesinc
|
Edit Nginx staticfiles.conf include | /usr/local/nginx/conf/staticfiles.conf |
The vhostconf shortcut only edits the default virtual.conf file, not additional vhost domain.com.conf files added later via menu option 2.
Service Management
Restart Nginx and PHP-FPM
Use these commands to restart Nginx and PHP-FPM in Centmin Mod. Always test the configuration with nginx -t before restarting Nginx to catch syntax errors. The nprestart shortcut restarts both together.
# Always test Nginx config before restarting
nginx -t
# Restart Nginx and PHP-FPM together
nginx -t && nprestart
# Restart Nginx only
nginx -t && ngxrestart
# or: nginx -t && systemctl restart nginx
# Restart PHP-FPM only
fpmrestart
# or: systemctl restart php-fpm
Nginx Service Control
Stop, start, or restart the Nginx web server.
ngxstop
ngxstart
ngxrestart
PHP-FPM Service Control
Stop, start, or restart the PHP-FPM process manager.
fpmstop
fpmstart
fpmrestart
MariaDB/MySQL Service Control
Stop, start, or restart the MariaDB MySQL database server.
mysqlstop
mysqlstart
mysqlrestart
Combined Nginx + PHP-FPM Control
Control both Nginx and PHP-FPM together with a single command.
npstop
npstart
nprestart
Memcached Service Control
Control the Memcached object caching daemon. Requires memcached to be installed.
memcachedstop
memcachedstart
memcachedrestart
CSF Firewall Control
Control the ConfigServer Security & Firewall (CSF). Requires CSF to be installed.
csfstop
csfstart
csfrestart
Updates & Vhosts
Updates & Maintenance
Update Centmin Mod code and Nginx to the latest versions.
| Command | Description |
|---|---|
cmupdate
|
Update Centmin Mod code base to the latest version |
nginx-update
|
Update Nginx to the latest version |
cminfo
|
Display comprehensive system information including server specs, software versions, and configuration details |
centmin.sh
|
Launch the Centmin Mod main menu interface for all management tasks |
centmin
|
Alias for centmin.sh — launches the Centmin Mod main menu from any directory (installed at /usr/bin/centmin) |
Vhost Management
Create new Nginx virtual host domains via the command line.
| Command | Description |
|---|---|
nginx-vhost domain.com
|
Set up a new Nginx virtual host for the specified domain (without the www prefix) |
/usr/bin/nv -d domain.com -s lelive
|
Create vhost with Let's Encrypt production SSL certificate (recommended) |
/usr/bin/nv -d domain.com -s y
|
Create vhost with self-signed SSL certificate (testing only) |
/usr/bin/nv -d domain.com -s n
|
Create vhost without SSL certificate |
Always use the domain name without the www. prefix when creating vhosts. Run /usr/bin/nv -h for the full list of SSL options and parameters.
System Tools
System Information & Diagnostics
Utility commands for system information, monitoring, and site status management.
| Command | Description |
|---|---|
cminfo
|
Display detailed system information (CPU, memory, software versions) |
/usr/bin/sitestatus on
|
Disable maintenance mode (bring sites online) |
/usr/bin/sitestatus off
|
Enable maintenance mode (take sites offline) |
nginx -t
|
Test Nginx configuration syntax for errors |
php-fpm -t
|
Test PHP-FPM configuration syntax for errors |
cminfo Command
The /usr/bin/cminfo command displays comprehensive system information at a glance. It is a quick way to check all component versions and server status without opening individual configuration files or running multiple commands.
Running cminfo via SSH shows:
- Centmin Mod version
- Nginx version
- PHP version
- MariaDB version
- Server specs (CPU, RAM, disk usage)
- Kernel info and OS version
Usage:
cminfo
For more details, see the forum discussion.
PHP Version Update Notifications
Centmin Mod can display PHP and Nginx version update alerts on every SSH login, helping you keep track of available updates without manually checking. The notification appears as part of the SSH login MOTD (Message of the Day).
To enable PHP and Nginx update notifications on SSH login, set DMOTD_PHPCHECK='y' in your persistent config file:
# /etc/centminmod/custom_config.inc
DMOTD_PHPCHECK='y'
The /etc/centminmod/custom_config.inc file persists across Centmin Mod updates. Settings placed here are not overwritten when you update Centmin Mod.
For more details, see the forum discussion.
Custom Aliases
Centmin Mod shortcuts are stored as files in /usr/bin/. For additional custom shortcuts, you can create bash aliases in /root/.bashrc.
Create a shortcut to change to the Centmin Mod directory:
alias cmod='pushd /usr/local/src/centminmod/'
Make the alias persistent by adding it to /root/.bashrc:
echo "alias cmod='pushd /usr/local/src/centminmod/'" >> /root/.bashrc
List all active aliases:
alias
Using pushd instead of cd lets you use popd to return to your previous directory. Always backup /root/.bashrc before editing.
Related Resources
Install Centmin Mod LEMP Stack Today
Get started with automated LEMP stack management including all command shortcuts for CentOS, AlmaLinux, and Rocky Linux.