Installing WordPress on CentOS 5/6


  1. Article ID: 3643

  2. Last updated on August 14, 2013

  3. Authored by: Kyle Laffoon

WordPress is a content management system originally developed for blogging, but has beed greatly expanded through widgets, themes and plugins. Complete the following steps to install WordPress on a CentOS 5/6.

Pre-reqs

  1. Clean installation of CentOS 5/6MySQLApache and PHP on your server.

  2. WordPress software from http://wordpress.org/download/ uncompressed in a local repository

  3. User needs to have root privileges and be logged in as root or su.

  4. System packages installed:

yum -y install mysql-server httpd php php-mysql unzip wget  
chkconfig httpd on 
chkconfig mysqld on  
/etc/init.d/mysqld start 
/etc/init.d/httpd start

Create a WordPress database and MySQL User

Note: After the wordpress files are unzipped, they will be in a directory called wordpress in the home directory.

  1. Log in to the MySQL Shell and create a new MySQL directory for wordpress

    mysql -u root -p
  1. After logging in using your MySQL root password, create a WordPress database:

(For this example, we will use the database name WordPressdb.)

   CREATE DATABASE WordPressdb;
  1. Then we need to create the new user. You can replace the database, name, and password, with whatever you prefer:

    CREATE USER wordpressuser@localhost;
  1. Set the password for your new user:

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

Note: For security purposes, you would obviously not use “password” for your password. Be sure to assign a secure password in this line instead.

  1. Grant all applicable privileges to the new user. Without this command, the wordpress installer will not start up:

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


  1. Refresh MySQL:

FLUSH PRIVILEGES;
  1. Exit out of the MySQL shell:

   exit

Configure WordPress

  1. Copy the sample wordpress configuration file from the wordpress directory, into a new file.

  2. Edit the new file to create a new usable wordpress config file:

    cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php
  1. Open the wordpress config:

    vi ~/wordpress/wp-config.php
  1. Find the section that contains the field below and substitute in the correct name for your database, 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');
  1. Save and Exit.

Copy the Files

  1. Transfer the unzipped WordPress files to the website’s root directory.

    sudo cp -r ~/wordpress/* /var/www/html
  1. Install the following php module on your server, to enable the WordPress installation form online. Download php-gd:

    sudo yum install php-gd
  1. Restart Apache:

    sudo service httpd restart

Confirm setup

  1. Review your new set up at http://your-server-ip-or-hostname/wp-admin/install.php

0 views0 comments

Recent Posts

See All

Get NIC working in Hyper V for CentOS

Create a new VM in Hyper V – 2GB ram, 60GB disk, using CentOS-6.4x86_64-minimal.iso from Public Mirror list from www.centos.org (If moving VM – you will need to modify MAC address in the /etc/sysconfi

Get NIC working in Hyper V for CentOS

Create a new VM in Hyper V – 2GB ram, 60GB disk, using CentOS-6.4x86_64-minimal.iso from Public Mirror list from www.centos.org (If moving VM – you will need to modify MAC address in the /etc/sysconfi

Vi Text Editor Commands

As a brief introduction to vi, go through the following: First, type vi x at the Unix prompt. Assuming you did not already have a file named x, this command will create one. (If you have tried this ex