WordPress is a popular content management system (CMS) that allows users to create and manage websites with ease. If you’re looking to install WordPress on AlmaLinux 8, this step-by-step guide will walk you through the process. By following these instructions, you’ll have your WordPress website up and running in no time.
Prerequisites
Before you begin the installation process, make sure you have the following prerequisites in place:
- LAMP stack: WordPress requires the LAMP stack to be installed and running. You can refer to the LAMP Stack on AlmaLinux 8 installation guide for detailed instructions on how to set it up.
- Open ports: Open ports 80 and 443 on your firewall to allow HTTP and HTTPS traffic. If you’re using the firewalld service, you can use the following commands to allow the necessary services:
firewall-cmd --permanent --zone=public --add-service=http firewall-cmd --permanent --zone=public --add-service=https firewall-cmd --reload
Step 1: Installing and Configuring Apache Webserver
To start the installation process, you need to install and configure the Apache webserver. Follow these steps:
- Start the Apache webserver:
systemctl start httpd
- Enable the Apache webserver to start automatically after system reboot:
systemctl enable httpd
Step 2: Installing and Configuring MariaDB
Next, you’ll need to install and configure MariaDB, a popular open-source relational database management system. Here’s how you can do it:
- Start the MariaDB service:
systemctl start mariadb
- Enable MariaDB to start automatically after system reboot:
systemctl enable mariadb
- Secure your MariaDB installation by setting a root password:
mysql_secure_installation
Follow the on-screen prompts to set a secure password for the root user and answer the security-related questions.
Step 3: Creating a Database for WordPress
Now, you’ll create a new database and a MySQL user account for WordPress to use. Here’s how:
- Log into the MySQL command prompt:
mysql -u root -p
- Create a new database for WordPress:
CREATE DATABASE wordpress;
- Create a new MySQL user account for WordPress:
CREATE USER 'admin'@'localhost' IDENTIFIED BY '<Enter Strong Password here>';
Replace <Enter Strong Password here>
with a strong password of your choice.
- Grant the necessary privileges to the user:
GRANT ALL ON wordpress.* TO 'admin'@'localhost';
- Flush the privileges to apply the changes:
FLUSH PRIVILEGES;
Exit the MySQL command prompt:
exit
Step 4: Downloading and Extracting WordPress
In this step, you’ll download and extract the latest version of WordPress onto your server. Use the following commands:
curl https://wordpress.org/latest.tar.gz --output wordpress.tar.gz tar xf wordpress.tar.gz
Step 5: Copying WordPress Files
Now, you’ll copy the extracted WordPress files to the appropriate directory. Use the following command:
cp -r wordpress /var/www/html/
Step 6: Setting File Permissions
To ensure proper file permissions, use the following commands:
chown -R apache:apache /var/www/html/wordpress chcon -t httpd_sys_rw_content_t /var/www/html/wordpress -R
Step 7: Installing WordPress
With all the necessary files in place, you’re ready to install WordPress. Follow these steps:
- Open your web browser and navigate to
http://server_IP/wordpress
. - Click on the “Run the installation” button to start the WordPress installation process.
- Provide the requested information, including the site title, username, password, and email address.
- Click on the “Install WordPress” button to complete the installation.
Step 8: Logging in to WordPress
Once the installation is complete, you can log in to your WordPress dashboard using the credentials you provided during the installation process.
Congratulations! You have successfully installed WordPress on AlmaLinux 8. You can now start customizing your website and creating content.