In my last article we discussed installing a web server (Apache), PHP, MySQL and securing your server for live environment. This time around, I would like to go even further and talk about setting up a Wordpress Blog. Wordpress is probably the most popular blogging tool on the web, but the setup steps given on the Wordpress site can be a little unclear for a novice user. So let's jump right in and start setting up the blog.

Before doing anything, we have to set up the database Wordpress will use to store content. Since MySQL is already installed we can connect to the monitor and use is to create the database. The alternative would be to use a database administration tool such as phpMyAdmin. Start by connecting to MySQL as root using the password you specified during MySQL installation

# mysql -u root -p

You will get a new prompt that will let you perform MySQL operations. Go ahead and create a new database and a new user that will have privileges to access and modify it

mysql> CREATE DATABASE wordpress; mysql> GRANT ALL PRIVILEGES ON wordpress.* TO 'wpadmin'@'localhost' IDENTIFIED BY 'somepassword’ WITH GRANT OPTION; mysql> exit;

After your database is created and configured, download and extract the latest version from the Wordpress site

# wget http://wordpress.org/latest.tar.gz # tar -xvf latest.tar.gz

Move into the Wordpress directory and rename the wp-config-sample.php file to wp-config.php.

# cd wordpress # mv wp-config-sample.php wp-config.php

Edit wp-config.php and change the login information to match your database

// ** 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', 'wpadmin'); /** MySQL database password */ define('DB_PASSWORD', 'somepassword'); /** MySQL hostname */ define('DB_HOST', 'localhost');

Now move your wordpress directory to your web root

# mv * /var/www/

You can now access your blog from your server's IP or domain name, if you registered one. You will be prompted with a short configuration wizard that will let you name your blog and set your email address, as well as give you a temporary password. After the wizard is completed you can log in and create content. Also, don't forget to change your password. You're all set, now go out there and start blogging!

About the author of this post

I'm Carlos Taborda, I'm a 24 year old Engineer/Developer/Designer from Barranquilla, Colombia @ Miami,FL. I'm the founder of Webbynode, and have a great passion for the Design & (rails & php) Developer Community.