How To Install WordPress on Ubuntu Server 12.04 LTS

wordpress-logo-stacked-rgb

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 Official Ubuntu Software repository, Follow instructions how to install Wordpress in Ubuntu Server 12.04 LTS Precise Pangolin

How to install Wordpress in Ubuntu Server 12.04 LTS Precise Pangolin

 

Step 1. Install LAMP server on ubuntu server, to install LAMP Server in Ubuntu server 12.04 you can follow instructions @LAMP Ubuntu Server 12.04 LTS

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 to the Apache2 directory /var/www/

The WordPress installation placed in directory /usr/share/wordpress folder.

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

Step 4. install WordPress with the supplied script, the script placed in directory /usr/share/doc/wordpress/examples/. 

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

After execute this script, it will creates the MySQL database and user wordpress for the new MySQL database named localhost. If you have installed virtual host on 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.

sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress_preciseserver blog.preciseserver.com

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 and enter: http://localhost/wordpress

Install wordpress Manually in Ubuntu server 12.04

if you want to install latest WordPress manually 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 database with command below,in case we’ll create database with 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..

install wordpress

Reference:

The Deluge Bit Torrent Client

Deluge-1

Deluge is an extremely customizable Bit Torrent Client, that has a lot of features that play very nicely with a server situation:

  • It’s modular, which means the actual daemon is entirely separate from the client which controls it. This is awesome because we can choose from several different client types: A WebGUI, which will be available to any computer on our network via the browser. An installable GUI, which is available for all three major OS’s. And a console version which can be controlled from the command line. I’ll show you how to use all three.
  • It allows us to download files to one location, and then move them to another immediately. This way we can make sure files don’t show up in the File Share or various media servers until they finish downloading.
  • It will allow us to dynamically change the bandwidth provided to torrents depending on the time of day, so we don’t slow down the whole network during peak hours.
  • It can accept proxies, so we can use the wonderful BTGuard proxy, which anatomizes our downloading (Though I certainly would never advise you to do anything illegal. Please check the laws for your state and country before you download anything.)
  • It accepts plug-ins, which means we can add any additional functionality we may find lacking.

Installing Deluge Headless

At the time of writing, Deluge 1.3.x was the release available in the Ubuntu repositories. If a newer version has been released, these instructions may or may not still work.

Before downloading deluge, we need to create a user to run it as:

sudo adduser --disabled-password --system --home /home/deluge --group deluge

Then we can go ahead and download the Deluge:

sudo apt-get update && sudo apt-get install deluged deluge-webui

Configuring the Daemon to run at boot

To start deluge and the webui at boot, we need to have an init.d script set-up to start it during the boot process. Luckily for us, someone else has already written an init.d script, all we need to do is configure it, and copy it into our init.d directory. The first thing we need to do is create the /etc/default/deluge-daemon file. this is what passes the configuration to the OS.

sudo nano /etc/default/deluge-daemon

Inside it, we’ll paste the following:

# Configuration for /etc/init.d/deluge-daemon
# The init.d script will only run if this variable non-empty.
DELUGED_USER="deluge"
# Should we run at startup?
RUN_AT_STARTUP="YES"

Save off the file (Ctrl+X, then Y), and create the actual init.d script:

sudo nano /etc/init.d/deluge-daemon

Paste into it this init script, copied from here, and originally hosted here.

Now we need to make it executable, and update the boot process to reflect that we added it:

sudo chmod a+x /etc/init.d/deluge-daemon && sudo update-rc.d deluge-daemon defaults

From here, you should be able to reboot the server, and access the web interface from [hostnameofMediaServer]:8112. It will look like this:

Deluge Log-in Screen

The default password is “deluge”, though the WebUI will ask you to change it as soon as you log in.

Using an Installable Client

My favorite way to control deluge is from a client installed on my computer. This is because the WebGUI has only basic functionality, as it’s still in development. To control any plugins, such as the scheduler, the automatic torrent adder, etc., we need the full client. It’s also easier to navigate the settings page with scroll bars available, and you can associate .torrent files with the client, so you can just click on torrent files to open them on the server. That being said, it takes a few steps to get this “Thin Client” set-up working correctly.

Configuring the server for use with the Thin Client

First we need to download the console version of deluge so that we can configure a few settings:

sudo apt-get install deluge-console

Once it has finished installing go ahead and boot up deluge-console by typing:

sudo -H -u deluge deluge-console

in the console, allow remote connections to the daemon:

config -s allow_remote True

and exit:

exit

now we need to go ahead and shutdown the daemon

sudo /etc/init.d/deluge-daemon stop

and add a username and password for the daemon to the auth file:

sudo chmod -R 777 /home/deluge && sudo -H -u deluge echo username:password:10 >> /home/deluge/.config/deluge/auth

now we can go ahead and start the daemon back up:

sudo /etc/init.d/deluge-daemon start

Installing the Client

  • To install the client in Ubuntu, simply run sudo apt-get install deluge-gtk
  • To install the client in Arch Linux, simply run sudo pacman -Sy deluge
  • To install the client In Windows or Mac, just grab the installer from here.

Configuring the Client

Open the client and navigate to the interface tab in settings [Edit → Preferences → Interface]. Uncheck Enabled under Classic Mode. Go ahead and [File → Exit] When you start the client back up, you’ll see a screen that looks like this:

Deluge Connection Manager

Click Add and fill in the hostname of your media server, and the username and password you put in the auth file earlier. It should look like this:

Add Server

Once you add the server, you should be able to click connect, and log-in to the server. Now you can treat the deluge client as if it were hosted on your computer.

Deluge is an extremely customizable Bit Torrent Client, that has a lot of features that play very nicely with our server situation:

  • It’s modular, which means the actual daemon is entirely separate from the client which controls it. This is awesome because we can choose from several different client types: A WebGUI, which will be available to any computer on our network via the browser. An installable GUI, which is available for all three major OS’s. And a console version which can be controlled from the command line. I’ll show you how to use all three.
  • It allows us to download files to one location, and then move them to another immediately. This way we can make sure files don’t show up in the File Share or various media servers until they finish downloading.
  • It will allow us to dynamically change the bandwidth provided to torrents depending on the time of day, so we don’t slow down the whole network during peak hours.
  • It can accept proxies, so we can use the wonderful BTGuard proxy, which anatomizes our downloading (Though I certainly would never advise you to do anything illegal. Please check the laws for your state and country before you download anything.)
  • It accepts plug-ins, which means we can add any additional functionality we may find lacking.

Installing Deluge Headless

At the time of writing, Deluge 1.3.x was the release available in the Ubuntu repositories. If a newer version has been released, these instructions may or may not still work.

Before downloading deluge, we need to create a user to run it as:

sudo adduser --disabled-password --system --home /home/deluge --group deluge

Then we can go ahead and download the Deluge:

sudo apt-get update && sudo apt-get install deluged deluge-webui

Configuring the Daemon to run at boot

To start deluge and the webui at boot, we need to have an init.d script set-up to start it during the boot process. Luckily for us, someone else has already written an init.d script, all we need to do is configure it, and copy it into our init.d directory. The first thing we need to do is create the /etc/default/deluge-daemon file. this is what passes the configuration to the OS.

sudo nano /etc/default/deluge-daemon

Inside it, we’ll paste the following:

# Configuration for /etc/init.d/deluge-daemon
# The init.d script will only run if this variable non-empty.
DELUGED_USER="deluge"
# Should we run at startup?
RUN_AT_STARTUP="YES"

Save off the file (Ctrl+X, then Y), and create the actual init.d script:

sudo nano /etc/init.d/deluge-daemon

Paste into it this init script, copied from here, and originally hosted here.

Now we need to make it executable, and update the boot process to reflect that we added it:

sudo chmod a+x /etc/init.d/deluge-daemon && sudo update-rc.d deluge-daemon defaults

From here, you should be able to reboot the server, and access the web interface from [hostnameofMediaServer]:8112. It will look like this:

Deluge Log-in Screen

The default password is “deluge”, though the WebUI will ask you to change it as soon as you log in.

Using an Installable Client

My favorite way to control deluge is from a client installed on my computer. This is because the WebGUI has only basic functionality, as it’s still in development. To control any plugins, such as the scheduler, the automatic torrent adder, etc., we need the full client. It’s also easier to navigate the settings page with scroll bars available, and you can associate .torrent files with the client, so you can just click on torrent files to open them on the server. That being said, it takes a few steps to get this “Thin Client” set-up working correctly.

Configuring the server for use with the Thin Client

First we need to download the console version of deluge so that we can configure a few settings:

sudo apt-get install deluge-console

Once it has finished installing go ahead and boot up deluge-console by typing:

sudo -H -u deluge deluge-console

in the console, allow remote connections to the daemon:

config -s allow_remote True

and exit:

exit

now we need to go ahead and shutdown the daemon

sudo /etc/init.d/deluge-daemon stop

and add a username and password for the daemon to the auth file:

sudo chmod -R 777 /home/deluge && sudo -H -u deluge echo username:password:10 >> /home/deluge/.config/deluge/auth

now we can go ahead and start the daemon back up:

sudo /etc/init.d/deluge-daemon start

Installing the Client

  • To install the client in Ubuntu, simply run sudo apt-get install deluge-gtk
  • To install the client in Arch Linux, simply run sudo pacman -Sy deluge
  • To install the client In Windows or Mac, just grab the installer from here.

Configuring the Client

Open the client and navigate to the interface tab in settings [Edit → Preferences → Interface]. Uncheck Enabled under Classic Mode. Go ahead and [File → Exit] When you start the client back up, you’ll see a screen that looks like this:

Deluge Connection Manager

Click Add and fill in the hostname of your media server, and the username and password you put in the auth file earlier. It should look like this:

Add Server

Once you add the server, you should be able to click connect, and log-in to the server. Now you can treat the deluge client as if it were hosted on your computer.