Steps to Install Wordpress on CentOS

How to Install Wordpress on CentOS

Wordpress is a popular free open source website and blogging tool that works by using PHP and MySQL.Before you begin work on Wordpress, you must ensure that Linux, Apache, MySQL, PHP (LAMP) stack is installed on your server. Once the above preconditions are fulfilled, you are good to go and you may begin the process of installing Wordpress on CentOS by following the steps below.

Step 1: Downloading the Wordpress

As first step in the process, you must download Wordpress from the website by using the wget command:

[root@localhost]# wget http://wordpress.org/latest.tar.gz

The above command shall help you download the zipped Wordpress package straightaway to the home directory of the user.

 

[root@localhost]# tar -xzvf latest.tar.gz

 The above command shall lead to unzipping of the downloaded Wordpress files. After you have managed to unzip the Wordpress files, you will find them in a directory called Wordpress within the home directory.

 

Step 2: Creating the WordPress Database and User

 

you need to create a new MySQL directory for Wordpress. For that, you need to log into the MySQL Shell using the following command:


[root@localhost]# mysql -u root -p

You must login here through your MySQL root password, and further create the following:

1. A Wordpress Database

2. A User in the created database

Subsequently, you would be required to assign new password for wordpress database.

Please use the following command to create the database:

mysql> CREATE DATABASE wordpress;

 

Query OK, 1 row affected (0.00 sec)

 

Next, you are required to create the new user.

mysql> CREATE USER wordpressuser@localhost;

Query OK, 0 rows affected (0.00 sec)

Once the user has been created, you need to set the password for the new user by using the following command:

mysql> SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password");

Query OK, 0 rows affected (0.00 sec)

After that you must granting all privileges to the newly created user. Please note that if you miss this step, you would not be able to start the Wordpress installer. Please use the following command to do the same:

 

mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';

Query OK, 0 rows affected (0.00 sec)

Subsequently, you need to refresh MySQL using the following command:

mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.00 sec)

Once done with the above steps, its now time to exit out of the MySQL shell by giving the following command:

mysql> exit

You have now successfully exited out of the MySQL shell,

Step 3: Configuration of WordPress

First you need to copy the sample Wordpress configuration file, which is located in the Wordpress directory, into an altogether new file which would need to be edited, thus creating a new and usable Wordpress config. Please use the following command to execute the same:

[root@localhost]# cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php

Further, you need to open the wordpress configuration by in the following command:

[root@localhost]# vi ~/wordpress/wp-config.php

You need to search for the section containing the fields given below, and replace with precise details for your database name, username, and password:

// ** MySQL settings - You can get this info from your web host ** //

/** The name of the database for WordPress */ define('DB_NAME', 'wordpress');

/** MySQL database username */ define('DB_USER', 'wordpressuser');

/** MySQL database password */ define('DB_PASSWORD', 'password');

You need to save the changes made above before exiting.

Step 4: Copying the Files

The process of uploading Wordpress to the server is almost complete. The final step remains to transfer the unzipped WordPress files onto the website's root directory by using the following command :

[root@localhost]# sudo cp -r ~/wordpress/* /var/www/html

You have now successfully installed Wordpress, then you are required to restart Apache server by using the following command:

[root@localhost]# sudo service httpd restart

Step 5: Wordpress Online Installation Page

The above steps shall lead you to the Wordpress Online Installation Page. All you need to do to access the page is add /wp-admin/install.phpto your website's domain or IP address (for instance. sample.com/wp-admin/install.php), and complete the short online form with the requested details.

 
 
  • 0 Kunder som kunne bruge dette svar
Hjalp dette svar dig?

Relaterede artikler

Increase PHP file Upload size in windows server 2008

The php.ini file is the default configuration file for running applications that require PHP. It...

Setup Basic POP3/IMAP Mail Server in Centos/RHEL

Setup Basic POP3/IMAP Mail Server in Centos/RHELSetting up a mail server can be quite...

How Do I access RDP

Remote Desktop Protocol (RDP) is a proprietary protocol developed by Microsoft, which provides a...

Update Time-Zone on OpenVZ VPS

OpenVZ will reflect the host server’s time by default, You can configure your VPS with custom...

Enable TUN/TAP in Solus VM

 TAP (as in network tap) simulates a link layer device and it operates with layer 2 packets such...