If you’re looking to build and maintain a website without any coding knowledge, WordPress is the perfect solution for you. As a Content Management System (CMS), WordPress allows you to customize every aspect of your site easily. In this comprehensive guide, we will walk you through the step-by-step process of installing WordPress on Rocky Linux 9, ensuring that you have a seamless experience in setting up your website.
Prerequisites
Before we dive into the installation process, let’s go over the prerequisites for installing WordPress on Rocky Linux 9.
- LAMP Stack Installation: WordPress requires a LAMP (Linux, Apache, MySQL, PHP) stack to be installed and running on your Rocky Linux 9 server. If you haven’t set up a LAMP stack yet, refer to our detailed guide on LAMP Stack Installation on Rocky Linux 9.
- Firewall Settings: To enable access to your WordPress site, you need to open or allow HTTP (port 80) and HTTPS (port 443) on your firewall. Run the following commands to configure your firewall:
firewall-cmd --permanent --zone=public --add-service=http firewall-cmd --permanent --zone=public --add-service=https firewall-cmd --reload
Securing MariaDB Installation
Next, we need to secure our MariaDB installation and set a root password. This will ensure that unauthorized users cannot access your MariaDB database. Follow these steps:
- Run the following command to secure your MariaDB installation:
mysql_secure_installation
- You will be prompted to enter the current password for the root user. Press Enter as there is no password set initially.
- Set a root password for MariaDB and follow the prompts to secure your installation.
Creating a New Database and User
Now that we have secured our MariaDB installation, let’s create a new database and user for WordPress to operate on. Follow these steps:
- Log into MySQL with the following command:
mysql -u root -p
- Once logged in, create a new database for WordPress:
CREATE DATABASE wordpress;
- Next, create a new MySQL user account that will be used to operate on WordPress’s new database. Replace
<Enter Strong Password here>
with a strong password of your choice:
CREATE USER 'admin'@'localhost' IDENTIFIED BY '<Enter Strong Password here>';
- Link the user and database together by granting the user access to the database:
GRANT ALL ON wordpress.* TO 'admin'@'localhost';
- Flush the privileges so that MySQL recognizes the user permissions we just added:
FLUSH PRIVILEGES;
- Exit the MySQL command prompt:
exit
Downloading and Extracting WordPress
With the database and user set up, we can now proceed to download and extract the latest version of WordPress. Follow these steps:
- Use the
curl
command to download the latest version of WordPress:
curl -O https://wordpress.org/latest.tar.gz
- Install the
tar
command if it is not already installed:
dnf install tar -y
- Extract the WordPress tarball:
tar xf latest.tar.gz
- Copy the extracted WordPress directory to the appropriate location:
cp -r wordpress /var/www/html
Configuring File Permissions and SELinux Security Context
To ensure that WordPress functions correctly, we need to configure file permissions and the SELinux security context. Execute the following commands:
chown -R apache:apache /var/www/html/wordpress chcon -t httpd_sys_rw_content_t /var/www/html/wordpress-R
WordPress Installation
We are now ready to start the WordPress installation process. Follow these steps:
- Open your preferred web browser and navigate to
http://server_IP/wordpress
, replacingserver_IP
with the IP address of your Rocky Linux 9 server. - Click on the “Run the installation” button to begin the installation process.
- Provide the requested information, including the site title, username, password, and email address.
- Click on the “Install WordPress” button to finalize the installation.
Logging In to WordPress
Once the installation is complete, you can log in to your WordPress dashboard using the following steps:
- Open your web browser and navigate to
http://server_IP/wordpress/wp-admin
. - Enter the username and password you set during the installation process.
- Click on the “Log In” button to access your WordPress dashboard.
Congratulations! You have successfully installed WordPress on Rocky Linux 9. You can now start customizing your website and creating engaging content to attract visitors.
Remember to regularly update WordPress, themes, and plugins to ensure the security and stability of your site. If you encounter any issues during the installation process or have any questions, feel free to reach out to our support team at Shape.host.
Conclusion
In this comprehensive guide, we walked you through the process of installing WordPress on Rocky Linux 9. We covered the prerequisites, securing the MariaDB installation, creating a new database and user, downloading and extracting WordPress, configuring file permissions and SELinux security context, and finally, the WordPress installation process.
By following these steps, you can set up a powerful and customizable website on Rocky Linux 9 using WordPress. Harness the full potential of this popular CMS and start building your online presence today!
For reliable and scalable cloud hosting solutions, consider Shape.host’s Linux SSD VPS services. With our expert support and cutting-edge infrastructure, we empower businesses to thrive in the digital landscape. Visit Shape.host for more information on our services.