How to Setup WordPress Blog on CentOS 6.3

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 :

[root@centos63 ~]# cd /var/www/html/
[root@centos63 html]# wget

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

[root@centos63 html]# tar xvzf latest.tar.gz

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

[root@centos63 ~]# 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 wordpressuser@localhost;
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 wordpressuser@localhost                                                                                   |
| 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 :

[root@centos63 ~]# 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:

[root@centos63 ~]# cp /var/www/html/wordpress/wp-config-sample.php /var/www/html/wordpress/wp-config.php

10. Modify the wp-config.php :

[root@centos63 ~]# 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”

See also  How to Fix MySQL Database Error: Can't create database 'newdbname' (errno: 28)

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 :



  • Avatar Joseph Donahue says:

    I’m surprised you didn’t mention joining travel blog success like all the other bloggers do – which is impressive! I love how you personality just shows through your delicate writing! I started blogging about my travel experience recently as well, but I am a photographer and I have my name as the domain for my portfolio site – so I just built a blog page on top of what I already have – I’m still debating if I should just create a separate domain for blogging or just keep it as is.

  • Avatar Kelly Hubbard says:

    I actually started another blog in wordpress and I highly recommend it because of its graphics and visuals. I am having trouble though with domain and hosting because I can’t afford maintenance, yet being a student. But I will surely come back to this once I get my own website done. This is really helpful for me!

  • Avatar Holly Hooper says:

    I am so glad I found your post on pinterest! I have been flirting with the idea of starting a blog to develop my writers platform online. However, I am a bit lost on how to do that; your post has helped me. I also might look into your consulting services if I get in a jam later on. Great post! Thanks for posting!

  • Avatar Akshay says:

    WordPress is the best recommendations CMS for blogger, e-commerce websites etc and the best part, with the bunch of themes and plugins, you can create website with ease.

    We need to move on Centos7 installation as Centos 6 is already dead at end of life

Leave a Reply

Your email address will not be published. Required fields are marked *