Log into MySQL with the following command,
mysql -u root -p
You will be prompted for the password that you set for the root account when you installed MySQL.
First, we'll create a new database,
CREATE DATABASE wordpress;
Next, create a new MySQL user account that we will use to operate on WordPress's new database, with username "wordpressuser"
CREATE USER [email protected] IDENTIFIED BY 'password';
Link the user and DB together by granting our user access to the database,
GRANT ALL PRIVILEGES ON wordpress.* TO [email protected] IDENTIFIED BY 'password';
Flush the privileges so that MySQL knows about the privilege changes made:
Exit out of the MySQL command prompt by typing:
Install PHP, Apache and PHP-GD,
yum install httpd php php-mysql php-gd
Now we need to restart Apache so that it recognizes PHP:
service httpd restart
Download the latest version of wordpress,
cd ~ wget http://wordpress.org/latest.tar.gz
Extract the archived files to rebuild the WordPress directory,
tar xzvf latest.tar.gz
Move the unpacked files to Apache's document root,
mv /root/wordpress/ /var/www/html/
Create directory for uploads,
Use chown to grant ownership to Apache's user and group:
sudo chown -R apache:apache /var/www/html/*
Most of the configuration required to use WordPress will be completed through a web interface later on. However, we need to do some work from the command line to ensure that WordPress can connect to the MySQL database that we created for it.
Begin by moving into the Apache root directory where you installed WordPress:
The main configuration file that WordPress relies on is called wp-config.php. A sample configuration file that mostly matches the settings we need is included by default. All we have to do is copy it to the default configuration file location, so that WordPress can recognize and use the file:
cp wp-config-sample.php wp-config.php
Now that we have a configuration file to work with, let's open it in a text editor:
The only modifications we need to make to this file are to the parameters that hold our database information. We will need to find the section titled MySQL settings and change the DB_NAME, DB_USER, and DB_PASSWORD variables in order for WordPress to correctly connect and authenticate to the database that we created.
Fill in the values of these parameters with the information for the database that you created. It should look like this:
// ** 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'); These are the only values that you need to change, so save and close the file when you are finished.
You'll need to complete the WordPress installation through the web interface, Visit the following URL, replace server_domain_name_or_IP_Address with your VPS IP or domain name and follow the instructions on screen,