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.
- Install required packages for WordPress to function
- Download and install WordPress content
- Configure WordPress
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
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.
After that, run the line below to download the latest version of WordPress archived filewget http://wordpress.org/latest.tar.gz
Next, extract the downloaded file by running the commands below.tar -xvzf latest.tar.gz
After extracting, create a folder in the /var/www directory called myblog.comsudo mkdir -p /var/www/myblog.com
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/
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
After logging in, run the commands below to create a new database called myblog.create database myblog;
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';
Next, grant all privileges on the database you just created to the new user by running the commands belowGRANT ALL PRIVILEGES ON myblog.* TO 'bloguser'@'localhost' IDENTIFIED BY 'secretpassword';
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
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.
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
Install WordPress, login and enjoy! Don’t change nothing just yet. Next time, we’ll continue with our setup.