Archival Notice
This guide was written for legacy WordPress deployments on CentOS 7 using MariaDB and Apache. Please note that CentOS 7 has reached End of Life (EOL), and modern production WordPress releases require PHP 8.1+. Please adapt package installations and Virtual Host syntax to current environment standards.
When launching a lightweight WordPress blog or standalone marketing site, deploying complex container orchestration is often unnecessary. A clean, minimal Apache Virtual Host paired with MariaDB provides an incredibly robust, high-performance foundation.
In this guide, I will walk you through configuring a minimal Apache Virtual Host, provisioning MariaDB user schemas, setting up background wp-cron.php execution, and performing full database and web root backups.
Prerequisites
You will need a Linux server (CentOS/RHEL) with root privileges, configured with Apache HTTP Server, PHP, and MariaDB.
Step 1: Structuring the Minimal Apache Virtual Host
Create a dedicated web root directory /var/www/induslevel.com/html and configure a minimal Virtual Host manifest /etc/httpd/conf.d/induslevel.com.conf:
# /etc/httpd/conf.d/induslevel.com.conf
<VirtualHost *:80>
ServerName www.induslevel.com
ServerAlias induslevel.com
DocumentRoot /var/www/induslevel.com/html
ErrorLog /var/www/induslevel.com/log/error.log
CustomLog /var/www/induslevel.com/log/requests.log combined
<Directory "/var/www/induslevel.com/html">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Reload Apache to activate the site:
systemctl reload httpd
Step 2: Provisioning MariaDB Database Schema
Log into the MariaDB prompt and construct a dedicated database and user schema:
mysql -u root -p
CREATE DATABASE `wordpress-db`;
CREATE USER 'wordpress-user'@'localhost' IDENTIFIED BY 'Randompassword';
GRANT ALL PRIVILEGES ON `wordpress-db`.* TO 'wordpress-user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 3: Optimizing WordPress Cron Execution
By default, WordPress executes internal scheduled tasks (like publishing scheduled posts or checking for updates) by triggering wp-cron.php on every page load. On high-traffic sites, this degrades page load speed.
To optimize performance, disable default cron in wp-config.php (define('DISABLE_WP_CRON', true);) and configure a system cron job to execute the script cleanly in the background every 5 minutes:
# Add background wp-cron execution to crontab
echo "*/5 * * * * cd /var/www/induslevel.com/html/; php -q wp-cron.php >/dev/null 2>&1" >> /var/spool/cron/crontabs/root
Step 4: Executing Full Site Backups
Before performing operating system migrations or decommissioning server instances, execute a complete backup of your database schema and web root files.
# 1. Export full MariaDB database schema
mysqldump --add-drop-table -h localhost -u wordpress-user -p wordpress-db > /root/hadiqal_com_db.backup.sql
# 2. Compress entire web root directory into zip archive
zip -9 -r /root/hadiqal_blog_web.zip /var/www/induslevel.com/html/
Backup Completed
Your WordPress site is now fully backed up! You can safely download hadiqal_com_db.backup.sql and hadiqal_blog_web.zip to restore your site instantly on any destination server.