How to install WordPress on Fedora

To install WordPress on Fedora, you need to follow the below steps:

  1. Install Apache web server and PHP:
    sudo dnf install httpd php php-mysqlnd php-gd php-json php-mbstring php-xml php-opcache
  2. Start and enable Apache to start at boot time:
    sudo systemctl start httpd
    sudo systemctl enable httpd
  3. Install MariaDB database server:
    sudo dnf install mariadb mariadb-server
  4. Start and enable MariaDB to start at boot time:
    sudo systemctl start mariadb
    sudo systemctl enable mariadb
  5. Secure MariaDB installation by running the following command and following the on-screen instructions:
    sudo mysql_secure_installation
  6. Create a database and user for WordPress:
    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;
  7. Download and extract WordPress:
    cd /var/www/html
    sudo curl -O https://wordpress.org/latest.tar.gz
    sudo tar -zxvf latest.tar.gz
  8. Copy the WordPress sample configuration file and make changes to it:
    sudo cp /var/www/html/wordpress/wp-config-sample.php /var/www/html/wordpress/wp-config.php
    sudo vi /var/www/html/wordpress/wp-config.php

    Replace the following lines with the database, username, and password that you have created:

    define('DB_NAME', 'wordpress');
    define('DB_USER', 'wpuser');
    define('DB_PASSWORD', 'password');
  9. Set proper permissions on the WordPress directory:
    sudo chown -R apache:apache /var/www/html/wordpress
    sudo chmod -R 755 /var/www/html/wordpress
  10. Restart Apache:
sudo systemctl restart httpd

You should now be able to access your WordPress installation by visiting your server’s IP address or domain name in a web browser.