Installing WordPress on Rocky Linux 9 using Apache, MariaDB, and PHP8.3 (LAMP setup)
Welcome to our guide on deploying a secure and high-performance WordPress site on Rocky Linux 9, using the LAMP stack (Linux, Apache, MariaDB, PHP) for a robust hosting environment.
Prerequisites
Before you begin, ensure you have Rocky Linux 9 installed and access to your server via SSH. To connect, use the command followed by your IP address and username.
Steps to Deploy WordPress on Rocky Linux 9
- Update System Packages Start by updating existing packages to ensure stability and security:
- Install and Configure LAMP Stack
- Apache: Install Apache HTTP server and enable it:
- MariaDB: Install MariaDB server, enable it, and secure the installation:
- PHP 8.3: Install PHP 8.3 and required extensions for WordPress: Restart Apache to load PHP:
- Create WordPress Database and User Log into MariaDB and run commands to create a dedicated database and user with strong passwords: Then inside MariaDB shell:
- Download and Configure WordPress
- Download latest WordPress and extract it to Apache’s web root:
- Set appropriate permissions:
- Create file from sample and edit database credentials.
- Configure Apache for WordPress Create a virtual host file to enable URL rewriting and improve compatibility with WordPress permalinks: Example virtual host content: Enable mod_rewrite and restart Apache:
- Set Up Firewall Rules Allow HTTP and HTTPS traffic and reload firewall:
- Secure WordPress (Recommended)
- Use HTTPS/SSL (e.g., via Let's Encrypt certbot) for encrypted traffic.
- Keep PHP, Apache, MariaDB, and WordPress updated regularly.
- Use strong database and WordPress admin passwords.
- Limit file permissions and disable unnecessary PHP functions if possible.
- Install security plugins and configure backups.
- Complete WordPress Setup via Browser Open the server IP or domain in a browser and follow the WordPress installation wizard to finalize site details and admin account.
This process balances security with performance by using the latest PHP 8.3, properly configuring Apache with URL rewriting, securing MariaDB, and controlling firewall access. For more detailed commands and explanations tailored to Rocky Linux 9, see the step-by-step guide at GeeksforGeeks.
Summary of Commands for Quick Reference
```bash sudo dnf update -y sudo dnf install httpd mariadb-server -y sudo systemctl start httpd mariadb sudo systemctl enable httpd mariadb sudo mysql_secure_installation
sudo dnf module reset php -y sudo dnf module enable php:8.3 -y sudo dnf install php php-mysqlnd php-fpm php-xml php-mbstring php-json php-curl -y sudo systemctl restart httpd
sudo mysql -u root -p
cd /var/www/html sudo wget https://wordpress.org/latest.tar.gz sudo tar -xzf latest.tar.gz sudo mv wordpress/* . sudo rm -rf wordpress latest.tar.gz
sudo chown -R apache:apache /var/www/html sudo find /var/www/html -type d -exec chmod 755 {} \; sudo find /var/www/html -type f -exec chmod 644 {} \;
sudo vi /etc/httpd/conf.d/wordpress.conf
sudo firewall-cmd --permanent --add-service={http,https} sudo firewall-cmd --reload ```
This covers the essential steps to deploy a secure and performant WordPress site on Rocky Linux 9 using Apache, MariaDB, and PHP 8.3. For more detailed information, visit GeeksforGeeks and WordPress or Rocky Linux.
- GeeksforGeeks: How to Install WordPress on Rocky Linux 9
- WordPress: Installing WordPress on Rocky Linux 9
- Rocky Linux: Documentation
Technology plays a crucial role in developing a secure and high-performance WordPress site on Rocky Linux 9, as it employs the latest PHP 8.3, Apache, and MariaDB with appropriate configurations for improved security and performance.
In the process of setting up WordPress, essential technology components like a firewall are utilized for increased security, giving tea authors, bloggers, and businesses a robust hosting environment.