Install WordPress 5.x with Apache on Fedora 29/Fedora 28

|
Last Updated:
|
|

So WordPress 5.0, code-named, “Bebo” has just been released and you are looking at installing it for building your blog? Worry not because we are bringing to you a guide on how to Install WordPress 5.x with Apache on Fedora 29/Fedora 28.

Fedora has made the installation of WordPress a very easy task. It provides by default pre-packaged softwares that ensures WordPress is installed with the least effort. Let us see how this is true.

Install WordPress 5.0 with Apache on Fedora 29/Fedora 28

Update and upgrade your system packages

dnf update
dnf upgrade

Install LAMP Stack on Fedora 29/Fedora 28

As usual, LAMP stack is required in order to run WordPress. Therefore, the command below will install LAMP stack and all the required PHP extensions.

dnf install @"Web Server" php-mysqlnd mariadb-server

The @"Web Server" package group installs Apache Web server and other required tools such as PHP and the required extensions. If you do not want to do this, you can install the normal packages one by one, Apache (httpd), MySQL/MariaDB, PHP and other required extensions.

We covered how to install LAMP stack on Fedora 29/Fedora 28 in our previous guide.

Install WordPress 5.x on Fedora 29/Fedora 28

WordPress 5.0 is available on the default Fedora repositories.

dnf provides wordpress
Last metadata expiration check: 0:06:16 ago on Tue 08 Jan 2019 09:05:02 PM EAT.
wordpress-5.0.2-1.fc29.noarch : Blog tool and publishing platform
Repo        : updates
Matched from:
Provide    : wordpress = 5.0.2-1.fc29

Hence, WordPress 5.x can be installed by running the command;

dnf install wordpress
...
===============================================================================================================================================================
 Package                                         Arch                           Version                                  Repository                       Size
===============================================================================================================================================================
Installing:
 wordpress                                       noarch                         5.0.2-1.fc29                             updates                         8.2 M

Configure Apache Web Server

Allow Apache through firewall in case it is running on your system.

firewall-cmd --add-port=80/tcp --permanent
firewall-cmd --reload

If SELinux is running, run the commands below to allow Apache to connect to database and send mail as well. You may want to put SELinux on a permissive mode or leave it enforcing if you are conversant with how it operates;

setsebool -P httpd_can_network_connect_db=1
setsebool -P httpd_can_sendmail=1

By default, Apache is set to deny WordPress remote access. Hence to allow this, open the configuration file, /etc/httpd/conf.d/wordpress.conf and replace the line, Require local with the line Require all granted.

Start and enable Apache to run on system start.

systemctl start httpd
systemctl enable httpd

You can verify that Apache is ready to server your web content by navigation to the browser and entering your server IP address or the hostname. You should be able to see the default Fedora Apache web server page.

Start and enable MySQL to run on system start up.

systemctl enable mariadb
systemctl start mariadb

Once that is done, run MySQL security script to set the root password, remove the test databases, remove anonymous users and disable remote root login.

mysql_secure_installation
Enter current password for root (enter for none): Press ENTER
...
Set root password? [Y/n] y
New password: STRONGPASSWORD
Re-enter new password: STRONGPASSWORD
...
Remove anonymous users? [Y/n] y
...
Disallow root login remotely? [Y/n] y
...
Remove test database and access to it? [Y/n] y
...
Reload privilege tables now? [Y/n] y

Create WordPress 5.x Database

Login to MariaDB as root using the password set above.

mysql -u root -p

Then create a WordPress database.

create database testsite;

You can simply run the command below to create the database straight from the terminal.

mysqladmin create testsite -u root -p

Create Database user with all the privileges granted. After that, reload grant tables and quit.

grant all privileges on testsite.* to testadmin@localhost identified by 'P@SSWORD';
flush privileges;
quit

Configure WordPress 5.0

Open the WordPress configuration file, /etc/wordpress/wp-config.php, and configure database connection details.

vim /etc/wordpress/wp-config.php
...
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'testsite');

/** MySQL database username */
define('DB_USER', 'testadmin');

/** MySQL database password */
define('DB_PASSWORD', 'P@SSWORD');
...

Save the configuration file and restart the Apache web server.

systemctl restart httpd

To access, navigate to the address bar on your browser and type the URL of your WordPress like, http://server_IP/wordpress.

Install WordPress 5.0 with Apache on Fedora 29/Fedora 28

Perform the necessary configurations to finalize on WordPress 5.0 installation on Fedora 29/Fedora 28. After that, login to WordPress dashboard.

Install WordPress 5.0 with Apache on Fedora 29/Fedora 28

Magnificent!!! That is all it takes to install WordPress 5.0 with Apache on Fedora 29/Fedora 28. We hope this was informative.

SUPPORT US VIA A VIRTUAL CUP OF COFFEE

We're passionate about sharing our knowledge and experiences with you through our blog. If you appreciate our efforts, consider buying us a virtual coffee. Your support keeps us motivated and enables us to continually improve, ensuring that we can provide you with the best content possible. Thank you for being a coffee-fueled champion of our work!

Photo of author
koromicha
I am the Co-founder of Kifarunix.com, Linux and the whole FOSS enthusiast, Linux System Admin and a Blue Teamer who loves to share technological tips and hacks with others as a way of sharing knowledge as: "In vain have you acquired knowledge if you have not imparted it to others".

9 thoughts on “Install WordPress 5.x with Apache on Fedora 29/Fedora 28”

  1. Hi,
    I did the same steps but I didn’t get the same result!! I cann’t run WordPress!!
    always i get this message:
    “… // ** MySQL settings – You can get this info from your web host ** // /** The name of the database for WordPress */ define(‘DB_NAME’, ‘testsite’); /** MySQL database username */ define(‘DB_USER’, ‘testadmin’); /** MySQL database password */ define(‘DB_PASSWORD’, ‘P@SSWORD’); …”
    can you help me??

    Reply
    • Hello Amer.
      Does the database configurations on wp-config.php matches the db, user and password you created while setting the wordpress database?
      Kindly check and revert

      Reply
  2. Followed the tutorial. I installed WordPress in Fedora 31 server in VirtualBox. I have this error whne trying to install new plugins or themes:

    WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /usr/share/wordpress/wp-admin/includes/plugin-install.php on line 182

    I tried to check if IP of api.wordpress.org is in hosts, verify if ;extension=curl.so is in php.ini, temporally disabled firewall to check if any connections are rejected. I’m trying to figure out for three days now. Please help.

    Reply

Leave a Comment