How to Setup WordPress Blog on CentOS 6.3

Share this Article :

WordPress is an open-source blogging platform. It’s a free blogging tool and content management system (CMS) based on PHP and MySQL. This steps covers how to install the WordPress on linux CentOS 6.3. This post assumed that PHP, apache and MySQL server has been setup properly.

1. Login as a root, go to document’ root folder and download latest wordpress file :

[[email protected] ~]# cd /var/www/html/
[[email protected] html]# wget

2. Extract the lates.tar.gz files to current directory :

[[email protected] html]# tar xvzf latest.tar.gz

3. Now create wordpress database. Login to your mySQL database :

[[email protected] ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.61 Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

4. Create Database name “wordpressdb” :

mysql> CREATE DATABASE wordpressdb;
Query OK, 1 row affected (0.08 sec)

5. Create user “wordpressuser” with password “wordpresspassword” :

mysql> CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'wordpresspassword';
Query OK, 0 rows affected (0.06 sec)

6. Grant all privileges to “wordpressdb” to user ” wordpressuser” from localhost access :

mysql> GRANT ALL PRIVILEGES ON wordpressdb.* to [email protected];
Query OK, 0 rows affected (0.04 sec)

7. Check and verify the granted access for user “wordpressuser” :

mysql> SHOW GRANTS FOR 'wordpressuser'@'localhost';
| Grants for [email protected]                                                                                   |
| GRANT USAGE ON *.* TO 'wordpressuser'@'localhost' IDENTIFIED BY PASSWORD '*E62D3F829F44A91CC231C76347712772B3B9DABC' |
| GRANT ALL PRIVILEGES ON `wordpressdb`.* TO 'wordpressuser'@'localhost'                                               |
2 rows in set (0.08 sec)


8. For higher security, make wordpress folder readable only from browser :

[[email protected] ~]# chmod 755 /var/www/html/wordpress

9. Go to your web server terminal or ssh to web server. Copy and rename wp-config-sample.php to wp-config.php:

[[email protected] ~]# cp /var/www/html/wordpress/wp-config-sample.php /var/www/html/wordpress/wp-config.php

10. Modify the wp-config.php :

[[email protected] ~]# vi /var/www/html/blog/wp-config.php

Change below database details such as database’ name, database’ username, database’ password nand database’ hostname.

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpressdb');

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

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

/** MySQL hostname */
define('DB_HOST', 'localhost');

11. To configure wordpress, navigate the browser to http://servername/wordpress/. Please complete the form Click “Install WordPress”

Also Read :   How to Install Varnish 4 on CentOS 6 / CentOS 7

Site Title : Blog Title
Username : Prefered username
Password, twice : Your password
Your E-mail : Your Email


12. To login, navigate the browser to http://servername/wordpress/wp-login.php :

Leave a Reply