Install WordPress in AlmaLinux 9

WordPress, a CMS (i.e. Content Management System), is available as a free and open-source application. It is one of the most popular content management systems that is used to publish websites. In this article, we cover how to install WordPress in AlmaLinux 9.

Note: The following operations require Administrative rights. Contact your System Administrator if you don’t have the necessary rights to make modifications to your system.

Install WordPress in AlmaLinux 9

First, we have to install the Apache HTTP Server. For that, open a terminal with superuser privileges and issue the following command:

# dnf install httpd

Start and enable the services:

# systemctl start httpd.service
# systemctl enable httpd.service

Then, install MySQL server:

# dnf install mysql-server

Use the following command to the setup:

# mysql_secure_installation

And, follow onscreen instructions.

Thereafter, install WordPress:

# dnf install wordpress

This will install PHP as a dependency.

Setup WordPress in AlmaLinux 9

Configure database through:

​# mysql -u root -p

And, create a database. Use the following commands:

CREATE DATABASE wp_database;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'Pqwertyd6*';
GRANT ALL PRIVILEGES ON wp_database.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
quit

And, enter the above commands in the msql> prompt to create a database – wp_database, user – wp_user, and password – Pqwertyd6*. You must change the database name, user, and password entries.

Now, edit the configuration file:

# nano /etc/httpd/conf.d/wordpress.conf

And, append the file with the following entries:

Alias /wordpress /usr/share/wordpress

<Directory /usr/share/wordpress>
     AllowOverride Options
     Require all granted
</Directory>

If you don’t have a nano text editor:

# dnf install nano

Restart web server:

# systemctl restart httpd.service

Configure website

Open a web browser and use the following URL in the address bar:

http://example.com/wordpress

You should see the WordPress welcome page.

In conclusion, we have covered here how to install WordPress in AlmaLinux 9.

Similar Posts