Installing WordPress on a Linux VPS

WordPress blogging software

Having setup my Linux VPS server ( see previous blog ) it’s time to install some web applications.

I wanted to install a blog so I could recount my experiances with a Linux VPS server. WordPress was chosen as it is open source and had very good reviews.

WordPress needs PHP and mysql – both of which were installed already.

Note current versions of WordPress require a later version of PHP than that shipped by default with Centos 5, If you are using Centos 5  update php to version 5.3 see here

First setup Apache so it will use PHP files

vi /etc/httpd/conf/httpd.conf and search for DirectoryIndex

Add index.php index.php3 index.pl index.htm index.cgi

( they are not all needed for WordPress but as I’m going to add other software I put them in )

Restart apache :-

service httpd restart

Create the database

As this is the first application I’m installing that uses mysql there a few steps needed to get msql up and running.

chkconfig  mysqld on

/etc/init.d/mysqld start

mysqladmin -u root password ‘apassword’

‘apassword’ is the password you want to set for the mysql root user

mysqladmin -u root -p -h localhost password ‘apassword’

Now create a database and a user for the database

mysql  -u root -p

create database wordpress ;

grant all privileges on wordpress.* to “wordpressadmin”@”localhost” identified by “passwd” ;

flush privileges ;

exit

passwd” is the password you want the wordpressadmin user to have. You don’t have to call the database wordpress or the user wordpressadmin.

Get the latest WordPress version :-

cd /root

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

cd /var/www/html

tar xvfz /root/latest.tar.gz

Now for the setup and install

cd wordpress

cp wp-config-sample.php wp-config.php

vi wp-config.php

change DB_NAME , DB_USER, DB_PASSWORD    to the values you used above in mysql.

Assuming you have your site enabled for SSL then add the following to force all login and admin sessions to be over SSL ( https )

define('FORCE_SSL_ADMIN', true);

Point your browser to https://yourhostname/wordpress/wp-config.php

Fill in the blog name  and an email address ( you can change these later ) then click install.

If successful you will get a password for the admin user displayed – make a note of this and login as user admin with that password.

Click on the Settings link at the left hand side and fill in the Blog Title , Tag Line , Worpress Address URL ( http://yourdomain/wordpress ) , Blog Address ( http://yourdomain/wordpress ).

Check and change any of the other settings such as date format as you want then save the changes.

Next setup your profile – click Users and Edit the admin user, fill in your first and last names ( these are not made public ) , a nick name  , select from the drop-down box the name you want to appear as and  an email address.

Finally change your password , then click on Update Profile

Now you are ready to blog. Click on Posts at the left hand side – you will see the is already one post which you can either edit or delete. Once you have created your post hit the Publish or Update Post button at the right hand side.

There are loads of different themes and plugins available for WordPress – give them a go.

Leave a Reply

Your email address will not be published. Required fields are marked *