Configuration Files

Complete reference of configuration file paths for all Centmin Mod LEMP stack components. Nginx vhost configs live at /usr/local/nginx/conf/conf.d/ — Centmin Mod uses a custom source-compiled Nginx install path, not the distro package manager path.

Table of Contents

Dynamic Configuration

Many Centmin Mod configuration file settings are dynamically configured based on detected server hardware — CPU cores, installed memory, available disk space, and server environment type (dedicated, OpenVZ, KVM, Xen). When migrating configuration files between servers, you may need to adjust settings for the new environment.

Command Shortcuts

Centmin Mod provides command line shortcuts for many config file paths. See the full list at Command Shortcuts and FAQ item 16.

Nginx Configuration Files

Where Is the Main Nginx Configuration File?

In Centmin Mod, the main Nginx configuration file is located at /usr/local/nginx/conf/nginx.conf. Centmin Mod compiles Nginx from source and installs it to /usr/local/nginx/ — this is the custom Centmin Mod install path, not the distro package manager Nginx path. Per-domain vhost configuration files are stored at /usr/local/nginx/conf/conf.d/yourdomain.com.conf.

# Main Nginx config (Centmin Mod custom source-compiled path) /usr/local/nginx/conf/nginx.conf # Per-domain vhost configs (Centmin Mod path) /usr/local/nginx/conf/conf.d/yourdomain.com.conf

Core Nginx server configuration files and directories.

File Path Description
/etc/init.d/nginx Nginx service init.d startup file
/usr/local/nginx/conf/nginx.conf Main Nginx configuration file (nginx.conf). Controls worker processes, connection limits, gzip, log formats, and includes all vhost configs from conf.d/. The worker_processes value is dynamically configured based on CPU cores available. Edit this file with nano /usr/local/nginx/conf/nginx.conf and test with nginx -t before restarting.
/usr/local/nginx/conf/conf.d/ Directory containing each Nginx vhost domain config file, created via centmin.sh menu option 2 or /usr/bin/nv.
/usr/local/nginx/conf/conf.d/virtual.conf Default main Nginx vhost config for the server hostname. Web root at /usr/local/nginx/html with dynamically generated admin/stats files.
/usr/local/nginx/conf/ssl/ SSL certificate directory. Letsencrypt certificates are stored per-domain in /usr/local/nginx/conf/ssl/yourdomain.com/.
/usr/local/nginx/conf/staticfiles.conf Default static files include file, included in each Nginx vhost config file.
/usr/local/nginx/conf/php.conf Main PHP include file, included in each Nginx vhost config file for PHP-FPM upstream processing.
/usr/local/nginx/conf/pre-staticfiles-global.conf Global custom Nginx rules between location / {} and staticfiles.conf. Applies to all vhosts.
/usr/local/nginxbackup/ Auto-backup directory for Nginx configs. Created each time you run centmin.sh menu option 4 to upgrade/downgrade Nginx.
/var/log/nginx/localhost.access.log Default vhost access log (localhost-prefixed).
/var/log/nginx/localhost.error.log Default vhost error log (localhost-prefixed).

Nginx Site Domain Files

Per-domain configuration and web root files created when you add a new site via centmin.sh menu option 2 or /usr/bin/nv.

File Path Description
/home/nginx/domains/yourdomain.com/ Domain directory structure root.
/home/nginx/domains/yourdomain.com/public Web root directory for the domain. Place your site files here.
/usr/local/nginx/conf/conf.d/yourdomain.com.conf HTTP Nginx vhost configuration file for the domain.
/usr/local/nginx/conf/conf.d/yourdomain.com.ssl.conf HTTPS Nginx vhost configuration file (created if SSL is set up at vhost creation time).
/home/nginx/domains/yourdomain.com/log/ Per-domain Nginx access.log and error.log for troubleshooting site-specific errors (404, 502, 504, 500).
/usr/local/nginx/conf/pre-staticfiles-local-domain.com.conf Per-domain custom Nginx rules between location / {} and staticfiles.conf. Applies only to this vhost.
/usr/local/nginx/conf/ssl/yourdomain.com/ Per-domain SSL certificate directory, including Letsencrypt certificates obtained via acmetool.sh.

PHP-FPM Configuration Files

Centmin Mod installs PHP-FPM to /usr/local/etc/NOT /etc/php-fpm.d/. The default pool config is at /usr/local/etc/php-fpm.d/www.conf.

PHP-FPM process manager and PHP configuration files.

File Path Description
/etc/init.d/php-fpm PHP-FPM service init.d startup file.
/usr/local/etc/php-fpm.conf Main PHP-FPM configuration file. Values are dynamically configured based on available server memory. Restart php-fpm after editing.
/etc/centminmod/php.d/ Directory for php.ini override files. Use this to customize PHP settings. See PHP custom ini guide.
/usr/local/nginx/conf/phpfpmd/ Optional additional PHP-FPM pool configuration files (not enabled by default). Contains numbered pool templates (phpfpm_pool2.conf on port 9002, phpfpm_pool3.conf on port 9003, etc.) and Unix domain socket pool variants. Enable by uncommenting include=/usr/local/nginx/conf/phpfpmd/*.conf in /usr/local/etc/php-fpm.conf. By default, all vhosts share the single [www] pool via php.conf include.
/var/log/php-fpm/www-error.log PHP-FPM process error log.
/var/log/php-fpm/www-php.error.log PHP application error log (for PHP app-level errors).

MariaDB MySQL Configuration Files

MariaDB MySQL server configuration and data files.

File Path Description
/etc/my.cnf MariaDB MySQL main configuration file. Values are dynamically configured based on server memory. Restart mysql service after editing.
/root/.my.cnf MySQL root user credentials file. Update this whenever you change the MySQL root password. Required by some Centmin Mod addons (e.g., dbbackup.sh).
/var/lib/mysql/ MySQL database data directory. Do not directly backup these files — use mysqldump for safe backups.
/var/log/mysqld.log MariaDB error log (before MariaDB 10.0.29/10.1.21).
/var/lib/mysql/YOURHOSTNAME.err MariaDB error log (after MariaDB 10.0.29/10.1.21). Replaces the /var/log/mysqld.log path.

Database Backup Warning

Never directly copy files from /var/lib/mysql/ — this will corrupt your data. Always use mysqldump for reliable database backups.

CSF Firewall Configuration

ConfigServer Security & Firewall (CSF) configuration files and logs.

File Path Description
/etc/csf/csf.conf Main CSF Firewall config file. Some settings are dynamically configured per server environment (e.g., OpenVZ restrictions). Restart csf after editing.
/etc/csf/ Directory containing all CSF config files (allow/deny lists, port configs, etc.). Restart csf after editing any file in this directory.
/var/log/lfd.log Login Failure Daemon (lfd) log. Records auto-banned IPs from SSH brute force attacks and login failures.

Memcached Configuration

Memcached in-memory caching server configuration.

File Path Description
/etc/init.d/memcached Memcached config settings are located within this init.d startup file itself. Restart memcached service after editing.

NSD DNS Configuration

NSD authoritative DNS server files. Only relevant if you set up local DNS via centmin.sh menu option 3. If using third-party DNS nameservers, NSD is not used.

File Path Description
/etc/nsd/nsd.conf Main NSD configuration file for local domain DNS setup.
/etc/nsd/ Directory for NSD config files and DNS zone files. Restart nsd service after editing any file here.

Centmin Mod Configuration

Core Centmin Mod persistent configuration files that survive updates.

File Path Description
/etc/centminmod/custom_config.inc Persistent custom settings file that survives Centmin Mod updates. Place your custom centmin.sh variable overrides here.
/etc/centminmod/php.d/ PHP ini override files directory. Custom php.ini settings placed here persist across PHP updates.
/usr/local/src/centminmod/ Centmin Mod installation directory containing centmin.sh and all supporting scripts.

Persistent Configuration

Always use /etc/centminmod/custom_config.inc for your custom settings. This file persists across Centmin Mod updates, unlike editing centmin.sh directly which gets overwritten on update.

Need help?

Join the community forums for configuration help, migration tips, and server optimization advice.