WordPress is a popular Content Management System (CMS) that allows you to build and maintain websites without any coding knowledge. In this guide, we will walk you through the step-by-step process of installing WordPress on AlmaLinux 9. By following these instructions, you’ll be able to create a stunning website and take advantage of the powerful features WordPress has to offer.
Prerequisites
Before we begin, there are a few prerequisites that need to be met in order to install WordPress on AlmaLinux 9. Firstly, you need to have the LAMP stack (Linux, Apache, MySQL, PHP) installed and running on your server. If you haven’t set up the LAMP stack yet, you can refer to our guide onHow to Install LAMP Stack on AlmaLinux 9.
Additionally, it’s important to ensure that your firewall settings are properly configured to allow HTTP (port 80) and HTTPS (port 443) traffic. To do this, you can run the following commands:
firewall-cmd --permanent --zone=public --add-service=http firewall-cmd --permanent --zone=public --add-service=https firewall-cmd --reload
Secure MariaDB Installation
Next, we’ll secure our MariaDB installation and set a root password. This step is crucial for ensuring the security of your database. To secure your MariaDB installation, run the following command:
mysql_secure_installation
This command will prompt you to enter the current password for the root user. If you haven’t set a password yet, simply press Enter. You will then be asked if you want to set a root password. Type “Y” and follow the prompts to set a strong password.
Creating the Database
Once MariaDB is secured, we can proceed to create a new database for WordPress. To do this, log into the MySQL command prompt using the following command:
mysql -u root -p
Enter your MySQL root password when prompted. Once logged in, you can create a new database by running the following command:
CREATE DATABASE wordpress;
Next, we’ll create a new MySQL user account that will be used to operate on WordPress’s new database. For this example, we’ll use the username “admin”. Replace <Enter Strong Password here>
with a strong password of your choice.
CREATE USER `admin`@`localhost` IDENTIFIED BY '<Enter Strong Password here>';
To link the user and database together, grant the user access to the database using the following command:
GRANT ALL ON wordpress.* TO `admin`@`localhost`;
After granting the privileges, flush the privileges so that MySQL recognizes the changes:
FLUSH PRIVILEGES;
Finally, exit the MySQL command prompt by typing exit
.
Download and Extract WordPress
Now that the database is set up, we can proceed to download and extract the WordPress files. Start by downloading the latest version of WordPress using the curl
command:
curl https://wordpress.org/latest.tar.gz --output wordpress.tar.gz
Once the download is complete, install the tar
command if it’s not already installed:
dnf install tar -y
Extract the WordPress files from the downloaded archive:
tar xf wordpress.tar.gz
Copy the extracted WordPress directory to the web server’s document root:
cp -r wordpress /var/www/html
Configure Permissions and SELinux
To ensure that WordPress functions properly, we need to adjust the permissions and SELinux security context of the files. Run the following commands to change the ownership of the WordPress files:
chown -R apache:apache /var/www/html/wordpress chcon -t httpd_sys_rw_content_t /var/www/html/wordpress-R
Installing WordPress
With the necessary files in place, we can now proceed to the WordPress installation. Open your web browser and navigate to http://server_IP/wordpress
. Replace server_IP
with the IP address or domain name of your server.
On the WordPress installation page, click on the “Run the installation” button to start the installation process. You will be prompted to provide some information, including the site title, username, password, and email address.
Once you’ve entered the required details, click on the “Install WordPress” button. WordPress will then set up the database and complete the installation process. After the installation is complete, you can log in to your WordPress dashboard using the username and password you specified during the installation.
Congratulations! You have successfully installed WordPress on AlmaLinux 9. You can now start customizing your website, installing themes and plugins, and creating engaging content.
Conclusion
WordPress is a powerful CMS that allows you to create and manage websites with ease. By following the steps outlined in this guide, you can install WordPress on AlmaLinux 9 and start building your online presence. If you have any questions or run into any issues during the installation process, don’t hesitate to reach out to our expert support team at Shape.host. We offer reliable and scalable Linux SSD VPS hosting solutions to help you succeed in the digital world.