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
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 file
wget 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.com
sudo 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 below
GRANT 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.
Enjoy!
Frequently Asked Questions
How to setup Wordpress CMS in Ubuntu 12.04?
To setup Wordpress CMS in Ubuntu 12.04, you need to install required packages like apache2, php5, libapache2-mod-php5, php5-mysql, and mysql-server. Then download the latest version of Wordpress and extract it in the /var/www directory.
What is the importance of having a domain name for a Wordpress blog?
Having a domain name is crucial for establishing a unique online identity for your Wordpress blog. In the tutorial, a locally assigned domain name 'myblog.com' is used for demonstration purposes.
How do you create a password for MySQL-Server in Ubuntu?
To create a password for MySQL-Server in Ubuntu, you will be prompted during the installation process. Simply follow the instructions to set up a secure password for accessing and configuring MySQL.
What is the purpose of downloading the latest version of Wordpress archived file?
Downloading the latest version of Wordpress archived file ensures that you have the most up-to-date features, security patches, and improvements for your Wordpress installation.
How do you extract a downloaded Wordpress file in Ubuntu?
To extract a downloaded Wordpress file in Ubuntu, you can use the 'tar' command followed by the necessary options. In the tutorial, the command 'tar -xvzf latest.tar.gz' is used for extraction.
What is the significance of creating a folder in the /var/www directory for Wordpress?
Creating a folder in the /var/www directory, such as 'myblog.com', allows you to host your Wordpress files locally on your Ubuntu system. This directory is commonly used for storing web content.
What are the key steps to installing and managing a Wordpress blog using Ubuntu?
The key steps include installing required packages, downloading Wordpress, configuring the setup, and managing the content of your Wordpress blog. Following these steps will help you get started with Wordpress on Ubuntu.
How does setting up Wordpress locally on Ubuntu help in managing an online Wordpress blog?
Setting up Wordpress locally on Ubuntu provides a hands-on experience in installing and managing your blog, which can be beneficial when transitioning to an online setup. It helps users gain familiarity with the process before going live.