Here’s a quick and dirty tutorial on how to setup WordPress Content Management System in Ubuntu 12.04.

The reason I’m writing this is to help users get the feel of installing and managing a WordPress blog locally or online. This is the first step in getting your personal page or blog started. If you can install WordPress locally on your machine, you may be able to do it online.

Although most online setup may be different, if you can get your hands dirty by installing it locally, you may be confortable doing it online.

So, this brief tutorial is going to show you how to easily install, setup and manage your WordPress blog using Ubuntu.

Objectives:

  • Install required packages for WordPress to function
  • Download and install WordPress content
  • Configure WordPress
  • Enjoy!

The first thing you must do or have if you want to run a personal WordPress webpage or blog is to have a domain name. For this tutorial, we won’t need to worry about that just yet.  We’re going to use a locally assigned domain name for your system. It will be called. myblog.com

 

Next, logon to your machine and open the terminal. Then run the commands below to download and install all packages that are required for WordPress to function.

sudo apt-get install apache2 php5 libapache2-mod-php5 php5-mysql mysql-server

 

wordpress_precise_13

 

Next, you’ll get prompted to create a password for MySQL-Server. This password is used to logon an configure MySQL-server. Create one here and select Ok to continue.

 

wordpress_precise_5

 

After that, run the line below to download the latest version of WordPress archived file

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

 

wordpress_precise

 

Next, extract the downloaded file by running the commands below.

tar -xvzf latest.tar.gz

 

wordpress_precise_1

 

After extracting, create a folder in the /var/www directory called myblog.com

sudo mkdir -p /var/www/myblog.com

 

wordpress_precise_2

 

After creating your blog folder, run the commands below to copy all WordPress contents into myblog.com folder.

sudo cp -r ~/wordpress/* /var/www/myblog.com/

 

wordpress_precise_3

 

Now that WordPress folders and files in in place, go and create a database for the website. To logon to MySQL-server, run the commands below. When prompted for a password, type the password you entered when prompted earlier.

mysql -u root -p

 

wordpress_precise_6

 

After logging in, run the commands below to create a new database called myblog.

create database myblog;

 

wordpress_precise_7

 

Next, create a new username and password for the database user. This user is the one who will connect your website to the database.

CREATE USER 'bloguser'@'localhost' IDENTIFIED BY 'secretpassword';

 

wordpress_precise_15

 

Next, grant all privileges on the database you just created to the new user by running the commands below

GRANT ALL PRIVILEGES ON myblog.* TO 'bloguser'@'localhost' IDENTIFIED BY 'secretpassword';

 

wordpress_precise_16

 

After that, quit MySQL-Server.

 

Now you’re almost ready. What you need to do this time is rename one file by running the commands below.

sudo cp /var/www/myblog.com/wp-config-sample.php /var/www/myblog.com/wp-config.php

 

wordpress_precise_11

 

After renaming the file, open the renamed file and make these few changes to match your database settings.

sudo gedit /var/www/myblog.com/wp-config.php

 

Then change the settings highlighted below to match the database name, user and password. Save the file.

 

wordpress_precise_12

 

Finally, restart your computer or run the line below.

sudo service apache2 restart

 

Open your browser and go to http://localhost/myblog.com  to begin configuring WordPress

 

wordpress_precise_17

 

Install WordPress, login and enjoy! Don’t change nothing just yet. Next time, we’ll continue with our setup.

 

Enjoy!