Command Shortcuts

Quick one-word commands for editing configuration files, managing services, and performing common server administration tasks.

Table of Contents

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

Nginx Service Control

Stop, start, or restart the Nginx web server.

Stop Nginx
ngxstop
Start Nginx
ngxstart
Restart Nginx
ngxrestart

PHP-FPM Service Control

Stop, start, or restart the PHP-FPM process manager.

Stop PHP-FPM
fpmstop
Start PHP-FPM
fpmstart
Restart PHP-FPM
fpmrestart

MariaDB/MySQL Service Control

Stop, start, or restart the MariaDB MySQL database server.

Stop MySQL
mysqlstop
Start MySQL
mysqlstart
Restart MySQL
mysqlrestart

Combined Nginx + PHP-FPM Control

Control both Nginx and PHP-FPM together with a single command.

Stop Nginx + PHP-FPM
npstop
Start Nginx + PHP-FPM
npstart
Restart Nginx + PHP-FPM
nprestart

Memcached Service Control

Control the Memcached object caching daemon. Requires memcached to be installed.

Stop Memcached
memcachedstop
Start Memcached
memcachedstart
Restart Memcached
memcachedrestart

CSF Firewall Control

Control the ConfigServer Security & Firewall (CSF). Requires CSF to be installed.

Stop CSF Firewall
csfstop
Start CSF Firewall
csfstart
Restart CSF Firewall
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

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 y
Create vhost with self-signed SSL certificate via the nv CLI tool
/usr/bin/nv -d domain.com -s lelive
Create vhost with Let's Encrypt production SSL certificate
/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

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.