How to: Install WordPress in Ubuntu Server 12.04 LTS

WordPress is a free and open source blogging tool and a dynamic content management system (CMS) based on PHP and MySQL. It has many features including a plug-in architecture and a template system. WordPress is used by over 14.7% of Alexa Internet’s “top 1 million” websites and as of August 2011 manages 22% of all new websites. WordPress is currently the most popular CMS in use on the Internet. It was first released on May 27, 2003, by Matt Mullenweg as a fork of b2/cafelog. As of December 2011, version 3.0 had been downloaded over 65 million times – Wikipedia

Currently, the latest version of WordPress is available in the Official Ubuntu Software repository. Following are the instructions for how to install Wordpress in Ubuntu Server 12.04 LTS.

Step 1. Install LAMP server on ubuntu server; instructions can be found here.

Step 2. If you do not have a problem when installing lamp server in ubuntu server 12.04, we proceed to install wordpress

sudo apt-get install wordpress

Step 3. Make a symbolic link from the WordPress installation directory /usr/share/wordpress  to the Apache2 directory /var/www/ .

sudo ln -s /usr/share/wordpress /var/www/

Step 4. Install WordPress with the supplied script, located at /usr/share/doc/wordpress/examples/. 

sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost

After executing this script, it will create the MySQL database and user wordpress for the new MySQL database named localhost. If you have installed virtual host on the server and/or already know your URL, it is best to name your database the same as your URL. Also if you plan on hosting multiple blogs with different virtual hosts, each needs a differently named database.

Step 5. For automatic updates to occur, the folder and all its files and subfolders wordpress must be owned by www-data:

chown -R www-data /usr/share/wordpress

Now, open your web browser to install wordpress, type on address bar http://localhost/

Install wordpress Manually in Ubuntu server 12.04

If you want to install latest WordPress manully on Ubuntu server, you can follow instructions below.

Login on your Ubuntu server, login as root.

sudo -i

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

tar -zxvf wordpress.tar.gz

cd wordpress

cp -R wordpress /var/www

chown -R www-data /var/www/wordpress

Log in to mysql server as root user

mysql -u root -p

Create the database with the command below, in this case we’ll create the database with the name “dbwordpress”

CREATE DATABASE dbwordpress;

Create a new user of username wordpressuser, with command below

CREATE USER wordpressuser;

Create password “wppassword” for user “wordpressuser”;

SET PASSWORD FOR wordpressuser = PASSWORD("wppassword");

Grant user wordpressuser all permissions on the database.

GRANT ALL PRIVILEGES ON dbwordpress.* TO wordpressuser@localhost IDENTIFIED BY ‘wppassword’;

FLUSH PRIVILEGES;

Log out from mysql server

exit

Now wordpress is ready to install.

Re-blogged from: ubuntuserverguide.com

About these ads

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 31 other followers