To install WordPress on a CentOS 7 server with the LEMP stack, follow these steps.
Step 1 : Install LEMP Stack
If you haven't installed the LEMP stack yet, please follow the instructions in the CentOS 7 Guides to set it up.
Step 2 : Create a Database
First, log in to your MySQL/MariaDB server:
Create a new database for WordPress:
Create a new user and grant them permissions on the database:
Step 3 : Download and Install WordPress
Create the WordPress directory:
Navigate to the directory and download WordPress:
Extract the WordPress archive:
Move the extracted files to the desired location:
Set the correct permissions:
Step 4 : Configure Nginx for example.devtutorial.io
Create a new Nginx server block configuration file:
Add the following configuration:
Step 5 : Test Configuration and Restart Nginx
Test the Nginx configuration:
Restart Nginx to apply the changes:
Step 6 : Configure SELinux (if enabled)
If SELinux is enabled, run the following command:
Step 7 : Complete the WordPress Installation via Browser
Open your browser and navigate to:
Select your preferred language and click "Let's go!".
Fill in the database details:
- Database Name: wordpress_db
- Username: wordpress_user
- Password: your_password
- Database Host: localhost
- Table Prefix: wp_
Click "Run the installation".
Fill in the site information and click "Install WordPress".
Step 8 : After installation, log in to WordPress with your credentials.
Step 9 :Once logged in, you will be redirected to the WordPress dashboard where you can start customizing your site.
Congratulations! You have successfully installed WordPress with LEMP on CentOS 7.