WordPress on CentOS 6

NOTE: You must have the LAMP stack installed before installing WordPress.

Create the WordPress database, user, and password

mysql -u root -p

Now, create the database and user for your WordPress installation. You can replace WPdatabase, WPuser, and WPpassword with your own database name, username, and password in the following commands:

CREATE DATABASE wordpressdb;


CREATE USER [email protected] IDENTIFIED BY 'WPpassword';


GRANT ALL PRIVILEGES ON WPdatabase.* TO [email protected];

Now, flush the privileges and restart the service:




Download WordPress

wget http://wordpress.org/latest.tar.gz

Now, extract the compressed file to your home directory:

tar -xzvf latest.tar.gz

Configure WordPress

Begin by copying the sample config file into a new file:

cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php

Now open the file in Nano so that it can be edited:

vi ~/wordpress/wp-config.php

Once you have the wp-config.php file open in vi, go through it and replace wpdatabase, wpuser and dbpassword with the database name, username and password you created in the first step. Then save your changes and exit vi.

Move WordPress to the web root

Now that WordPress is configured, you will need to move the contents of the WordPress directory to your website's web root directory:

sudo cp -r ~/wordpress/* /var/www/html

Install php-gd

If you have not already installed php-gd, you will need to do so for WordPress:

sudo yum install php-gd

Restart Apache

sudo service httpd restart

Now complete the WordPress setup now located at http://yourdomain.com/wp-admin/install.php, where 'yourdomain.com' is replaced with your actual domain.

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

IP rDNS/PTR records

You can configure PTR or Reverse DNS records via the VPS Control Panel under rDNS. The record...

Serial Console

You may wish to use the Serial Console if the SSH console becomes inaccessible. The Serial...

LAMP on CentOS 6

Install Apache Web sudo yum install httpd Edit Apache's httpd.confThe httpd.conf...

LAMP on Debian 7

Install Apache Web sudo apt-get install apache2 Edit Apache's httpd.confThe...

LAMP on Ubuntu 14.04

Install Apache sudo apt-get update sudo apt-get install apache2 Install MySQL...