WordPress is a powerful, free and open-source, highly pluggable and customizable CMS that’s being utilized by millions around the world to run blogs and totally functional web sites.
Before working with WordPress, it is advisable to have LAMP installed in your virtual private server.
Step 1: Download WordPress
Download the latest WordPress package and extract it by issuing the instructions below on the terminal:
wget -c http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
Step 2: Create WordPress Database
Create a new MySQL directory for WordPress and log into the MySQL Shell:
mysql -u root -p
Login using your MySQL root password, create a wordpress database, a user in that database, and give that user a new password. Remember the fact that all MySQL commands must end with semi-colon.
At the mysql shell, type the following instructions, press Enter after each line of a mysql command.
CREATE DATABASE wordpress;
CREATE USER wordpress_user@localhost;
SET PASSWORD FOR wordpress_user@localhost= PASSWORD(“password”);
GRANT ALL PRIVILEGES ON wordpress.* TO wordpress_user@localhost IDENTIFIED BY ‘password’;
Step 3: Setup The WordPress Configuration
Copy the sample wordpress configuration file in the wordpress directory to a new file which we are going to edit:
cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php
Then open the wordpress config:
sudo nano ~/wordpress/wp-config.php
update it with your database information
// ** MySQL settings – You can get this information from your web host ** //
/** The name of the WordPress database */
/** MySQL database username */
/** MySQL database password */
Save and Exit.
Step 4: Copy Files To Web site’s root Directory
sudo rsync -avP ~/wordpress/ /var/www/
Set the right permissions on the web site directory, that’s give ownership of the WordPress files to the web server as follows:
sudo chown username:www-data /var/www -R
sudo chmod g+w /var/www -R
From right here, WordPress has its own easy to follow installation form on-line.
Step 5: Access the WordPress Installation
The wordpress on-line installation page is up :
Access the page by including /wp-admin/install.php to site’s domain or IP address (eg. example.com/wp-admin/install.php) and fill out the online form
set the right permissions on the web site directory, that is give ownership of the WordPress files to the web server
Fill out the information for the site and click on the install button .WordPress will confirm installation, and ask to log in with the account you created:
Fill out your account information and it will be presented with the WordPress interface: