How to install WordPress on Rocky Linux

To install WordPress on Rocky Linux 9, follow these steps:

  1. Update System Packages:
   sudo dnf update -y
  1. Install Apache:
   sudo dnf install httpd -y
   sudo systemctl start httpd
   sudo systemctl enable httpd
  1. Install MariaDB:
   sudo dnf install mariadb-server mariadb -y
   sudo systemctl start mariadb
   sudo systemctl enable mariadb
   sudo mysql_secure_installation
  1. Install PHP:
   sudo dnf install php php-mysqlnd php-fpm -y
   sudo systemctl restart httpd
  1. Download WordPress:
   cd /var/www/html
   sudo wget https://wordpress.org/latest.tar.gz
   sudo tar -xzvf latest.tar.gz
   sudo chown -R apache:apache wordpress
   sudo chmod -R 755 wordpress
  1. Create WordPress Database:
   sudo mysql -u root -p
   CREATE DATABASE wordpress;
   CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'password';
   GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
   FLUSH PRIVILEGES;
   EXIT;
  1. Configure Apache:
   sudo vi /etc/httpd/conf.d/wordpress.conf

Add the following:

   <VirtualHost *:80>
       ServerAdmin admin@example.com
       DocumentRoot /var/www/html/wordpress
       ServerName example.com
       <Directory /var/www/html/wordpress/>
           Options FollowSymLinks
           AllowOverride All
           Require all granted
       </Directory>
       ErrorLog /var/log/httpd/wordpress_error.log
       CustomLog /var/log/httpd/wordpress_access.log combined
   </VirtualHost>
   sudo systemctl restart httpd
  1. Finalize Installation:
    Open your browser and navigate to http://your_server_IP/wordpress to complete the WordPress setup.

For more details, refer to the full guide on GeeksforGeeks.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post