LAMP Stack for WordPress

Introduction

WordPress is a free and open source blogging platform or content management system based on PHP and MySQL. Currently WordPress is the most popular CMS all over the world, and has 20000 plus plugins to extend its functionality.You can easily create a simple website, blog or complex portals and enterprise websites using WordPress.

WordPress provides lots of features. Some of them are listed below:

  • WordPress is available in more than 70 languages. So you can build a website in a language as your choice.
  • You can easily manage your content, schedule, look and publication using WordPress, and also secure your posts and content with a password.
  • WordPress comes with thousands of themes for you to create a beautiful website. You can also upload your own theme with the click of a button.
  • With the importers feature you can easily import your blog from another website to WordPress.
  • WordPress provides search engine optimization out of the box, and also provides many SEO plugins.

In this tutorial, we will discuss how to install and configure WordPress on a CentOS 7 server.

Requirements

  • A server running CentOS 7.
  • A non-root user with sudo privilege setup on your server.

Getting Started

Update your system with the latest package versions by running the following command:

Once your system is up-to-date, you can proceed to the next step.

Installing LAMP

Before installing WordPress itself, you will need to install the LAMP stack and other required packages on your server.

You can install all the necessary packages with the following command:

Once installation is complete, start the Apache and MariaDB services and enable them to start at boot with the following commands:

Configuring MariaDB for WordPress

By default MariaDB is not secured, so you will need to secure it first. You can do this by running mysql_secure_installation script:

Answer all the questions as shown below:

Once you have finished, login to MariaDB console with the following command:

Enter your MariaDB root password and hit Enter. After login, create a database for WordPress:

Installing and Configuring WordPress

You can download the latest version of the WordPress source from the official website. You can get the latest version of WordPress by running the following command:

Once download is finished, extract the downloaded file with the following command:

Next, move the extracted files to the Apache web root directory:

Next, create a directory for WordPress to store uploaded files:

Next, assign proper ownership and permissions to your WordPress files and folders:

Next, you will need to make some changes in the WordPress main configuration file, so it can be connected with the database and user.

First, rename and edit the WordPress main configuration file:

Change the DB_NAME, DB_USER, and DB_PASSWORD variables as shown below:

Save and close the file when you are finished.

Accessing WordPress Web Installation Wizard

Before starting, you will need to allow access to the Apache ports using firewalld.

You can do this by running the following command:

Next, open your web browser and type the URL http://your-server-ip to finish the installation.

暂无评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注