
Install and configure wordpress on Cent OS 6
About WordPress
WordPress is an online, open source website creation tool written in PHP. But in non-geek speak, it’s probably the easiest and most powerful blogging and website content management system (or CMS) in existence today.
Set up
* Before working with wordpress, you need to have LAMP installed on your server.
* Once you have the user and required software, you can start installing wordpress.
Steps for installing and configuring wordpress in cent OS 6 as below
Step 1 :
Download wordpress
We can download WordPress using the below command
wget http://wordpress.org/latest.tar.gz
This command will download the zipped wordpress package straight to your user’s home directory.
Unzip wordpress package
We can unzip it to the next line
tar -xzvf latest.tar.gz
Step 2 :
Creating wordPress Database and User
After we unzip the wordpress files, they will be in a directory called wordpress in the home directory.
Now we need to switch gears for a moment and create a new MySQL directory for wordpress.
Log into the MySQL Shell:
mysql -u root -p
* Login using your MySQL root password
Then we need to create
* Wordpress database
* User in that database and
* Give that user a new password.
Note : All MySQL commands must end with semi-colon
CREATE DATABASE wordpress; Query OK, 1 row affected (0.00 sec)
* Then we need to create the new user.
* We can replace the database, name and password with our preference
CREATE USER wordpressuser@localhost; Query OK, 0 rows affected (0.00 sec)
Set the password for the new user:
SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password"); Query OK, 0 rows affected (0.00 sec)
Upon the process we have to grant all the privileges on wordpress
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.00 sec)
Then refresh MySQL:
FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)
Exit out of the MySQL shell:
exit
Step 3 :
WordPress configuration setup
The first step to is to copy the sample wordpress configuration file located in the wordpress directory into a new file which we will edit, creating a new usable wordpress config
cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php
Then open the wordpress config:
vi ~/wordpress/wp-config.php
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');
Save and Exit.
Step 4 :
Copy the files
The final move that remains is to transfer the unzipped WordPress files to the website’s root directory.
sudo cp -r ~/wordpress/* /var/www/html
From here, WordPress has its own easy to follow installation form online.
However, the form does require a specific php module to run. If it is not yet installed on your server, download php-gd:
sudo yum install php-gd
Last of all restart Apache:
sudo service httpd restart
Step 5 :
Access the WordPress Installation
Upon completion of above process we can access the wordpress admin page as below
domainname.com/wpadmin
Click continue and proceed further for the installation setup