To install WordPress on Fedora, you need to follow the below steps:
- Install Apache web server and PHP:
sudo dnf install httpd php php-mysqlnd php-gd php-json php-mbstring php-xml php-opcache
- Start and enable Apache to start at boot time:
sudo systemctl start httpd
sudo systemctl enable httpd
- Install MariaDB database server:
sudo dnf install mariadb mariadb-server
- Start and enable MariaDB to start at boot time:
sudo systemctl start mariadb
sudo systemctl enable mariadb
- Secure MariaDB installation by running the following command and following the on-screen instructions:
sudo mysql_secure_installation
- 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;
- Download and extract WordPress:
cd /var/www/html
sudo curl -O https://wordpress.org/latest.tar.gz
sudo tar -zxvf latest.tar.gz
- 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');
- Set proper permissions on the WordPress directory:
sudo chown -R apache:apache /var/www/html/wordpress
sudo chmod -R 755 /var/www/html/wordpress
- 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.