WordPress is packaged for Fedora and can be installed as a regular RPM (with DNF/YUM). The benefits of this method are that you don’t need to mess around with configuration files, filesystem permissions and since everything is pre-packaged to work together, additional configurations are minimal. At the end of this 3 minutes tutorial, you’ll get a running WordPress under an SSL-enabled Apache using MariaDB as its backend.
All commands need to be executed as root.
Database preparation
- Install MariaDB server (not necessarily on the same machine that will run WordPress and the web server)
dnf install mariadb-server
- Start and prepare MariaDB server. Initial root password is blank (just hit enter on password prompt), answer the questions removing the test database
systemctl enable mariadb systemctl start mariadb mysql_secure_installation
- Create a database, items in red were invented for this tutorial and will be used again in step 5
mysql -u root -p -e "CREATE DATABASE blogdb; GRANT ALL PRIVILEGES ON blogdb.* TO 'bloguser'@'%' IDENTIFIED BY 'bloguserpassword'; FLUSH PRIVILEGES;"
WordPress preparation (may be configured on a machine other than the DB above)
- Install WordPress, MariaDB client and SSL support for Apache
dnf install wordpress mariadb mod_ssl
- Configure WordPress to use same DB name, DB user and DB password as created on step 3 above
sed -i 's/database_name_here/blogdb/; s/username_here/bloguser/; s/password_here/bloguserpassword/' /etc/wordpress/wp-config.php
- Optional but recommended: remove Fedora WordPress defaults that blocks access to anyone coming from the network
sed -i 's/Require local/Require all granted/' /etc/httpd/conf.d/wordpress.conf
- Enable and activate the web server
systemctl enable httpd systemctl start httpd
- Now continue regular WordPress configuration on the browser accessing the secure address https://your-webserver-address.com/wordpress/wp-admin/install.php
WordPress traditional wp-config.php file is located on /etc/wordpress/wp-config.php and you can make additional configurations there.
WordPress is configured in Fedora standard Apache on /etc/httpd/conf.d/wordpress.conf. You do not need to mess around with other standard Apache configuration files.
Install themes and plugins under /usr/share/wordpress/wp-content.
You can easily and safely update WordPress with a system standard command:
dnf update wordpress