This guide documents a clean, modern baseline for building reusable AlmaLinux 10 server templates. It is designed to serve as the shared foundation for both WordPress (PHP) and ColdFusion (Lucee or Adobe CF) environments.
1. Update and Prepare the System
dnf update -y
dnf install iproute -y
ip addr
This ensures the system is fully patched and provides the modern ip networking tools used for interface and routing inspection.
2. Install and Configure Apache
dnf install httpd -y
systemctl enable --now httpd
systemctl status httpd
Create directories for modular site configuration:
mkdir /etc/httpd/sites-available
mkdir /etc/httpd/sites-enabled
For cleaner configuration management, add the following line to /etc/httpd/conf/httpd.conf:
IncludeOptional sites-enabled/*.conf
3. Install Useful Apache Tools
dnf install -y httpd-tools
- ab – load testing and benchmarking
- htpasswd – basic authentication management
- logresolve – resolve IPs in access logs
4. Install and Secure MariaDB
dnf install mariadb-server -y
systemctl enable --now mariadb
mysql_secure_installation
Recommended responses during setup:
- Press Enter for no root password on first run
- Answer n to reconfiguring unix_socket authentication
- Remove anonymous users
- Disallow remote root login
- Reload privilege tables
5. Basic Firewall Configuration
systemctl status firewalld
Open standard web ports:
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
Verify:
firewall-cmd --list-all
6. Open Application Port Range (Optional)
If your environment requires internal services or application ports:
firewall-cmd --permanent --add-port=5000-6000/tcp
firewall-cmd --reload
Note: Keep ports internal unless external access is explicitly required.
7. Optional Database Setup
mysql -u root -p
SHOW DATABASES;
CREATE DATABASE myapp;
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'strongpassword';
GRANT ALL PRIVILEGES ON myapp.* TO 'myuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
8. Template Variations
| Template Type | Notes |
|---|---|
| WordPress | Install PHP-FPM and required PHP extensions |
| ColdFusion | Skip PHP; configure Apache reverse proxy to Lucee or Adobe CF |
| Both | Optional Redis support for caching (can be added later) |
9. Verification
systemctl status httpd
systemctl status mariadb
firewall-cmd --list-all
10. Maintenance Notes
- Run
dnf update -yregularly - Back up
/etc/httpdand/etc/my.cnf.d - Verify SELinux contexts after service changes
- Create VM snapshots before cloning templates
Posted in Technical Guides