How to Install Ubuntu Server 10.04 - Web Server

Ubuntu Server 10.04 (LTS) is an amazing server. The apt-get package manager makes things very easy to install and offers a large repository of open source software. The Lucid 10.04 server release is also a long term support release. This means the server edition will have security patches and updates for the next 5 years. This makes Ubuntu a great candidate for a production server. If you are looking for something a little more cutting edge but still running Ubuntu take a look at the development release such as 11.04 Natty Narwhal.

In this article we will cover how to install Ubuntu Server and get it setup as a web server. We will leverage the power of the LAMP stack (Linux, Apache, MySQL, and PHP) and work through installing several amazing open source web applications in later articles. You will not need any fancy hardware. You could run Ubuntu server on an old computer sitting down in the basement or on a cutting edge server.

If you don't have any extra hardware laying around and just want to play around with it, you could run it as a virtual machine using VirtualBox or VMware. This would allow you to easly take backups (snap-shots) before you makes changes. If you mess something up, you can quickly restore it back to the state it was in.

 

 

 

 

 

 

What you need:


You will need to download the Ubuntu 10.04 Server ISO image from Ubuntu.com and burn it to disc. They have some tools on how to burn the image to a disc or USB drive. If you have a really slow Internet connection you can also purchase an install disk for $1.98 at osdisc.com.

Download Ubuntu Server: http://www.ubuntu.com/server/get-ubuntu/download

 

 

 

 

 

Back up your data:


In this install tutorial we will wipe the drive clean and install just Ubuntu. If you have any other operating systems such as windows make sure you back your data up and have your install and license key in hand. If you want it back at a later time you can install all the needed software. You could also install this in a virtual machine with out the risk of loosing any data. The nice part about virtual machines is there is very little commitment. If you are going the virtual machine method, I would recommend VirtualBox because it open source, installs on any platform and is free as in beer.

If you are going to install on a machine that already has an operating system make sure you back up your data. A really great open source tool to do this is Clonezilla. It allows you to take a snapshot of exactly how your machine is today and put it on a external disc or drive. Then if your machine blows up or you need to do a restore you can have it back in a flash at the exact same state of when you took the backup.

Clonezilla : http://clonezilla.org/

Let’s get into it and start getting your new powerful server to work.

 

 

 

 

 

Installing Ubuntu Server:


The first thing you will need to do is set your machine to boot off the cd-drive or USB drive. This will depend on your install method. Every computer vender has their own special key to press when your computer is first powered on. Some computer you may have to go into the Bios and change this. I know on Dell computers you can do a one time change of the boot order by pressing the F12 key when you see the dell logo at boot-up. Check with your hardware vender on how to do this.

Once you successfully booted off your Ubuntu install media you should see a screen similar to the one below.

Select your preferred language

 

 

Install Ubuntu Server - Select Preferred Language

 

 

Note: I would recommend running a disc check before proceeding to the install process.

 

Select Install Ubuntu Server

 

 

Install Ubuntu Server - Select Install Ubuntu Server

 

 

Select the language you would like to use for the install

 

 

Install Ubuntu Server - Select Language For Install

 

 

Select your region of the world.

 

 

Install Ubuntu Server - Select Country

 

 

If you know your keyboard type select No, Otherwise you can use a few tools to help you find the correct keyboard layout.

 

 

Install Ubuntu Server - Select Keyboard Layout

 

Since I have selected no on the last question I will have to define a few things about my keyboard.

 

 

Install Ubuntu Server - Select Origin of Keyboard

 

 

Install Ubuntu Server - Select Keyboard Type

 

 

Create a name for your server. This is really up to you what you want to call the server. Many companies will come up with some sort of naming convention whether it is the south park characters names or just server01, server02..etc. In this article I will just leave it the default name of Ubuntu.

 

 

Install Ubuntu Server - Create A Name For The Server

 

 

If it finds the correct time zone for your location you can select Yes. If it says none or is not the time you wish to use, select No.

 

 

Install Ubuntu Server - Select Yes If Time Zone Is Correct

 

 

When selecting your time zone, find a major city near you that is in the same time zone.

 

 

 

Install Ubuntu Server - Select Major City Near By

 

 

To keep things simple we will use the guided install and use the entire disk. If you wanted to define your partitions and sizes you would select manual.

 

 

Install Ubuntu Server - Select Install Type - Hard Drive Setup

 

 

Select the hard drive you wish to install to the server on.

(Note: If you have an external hard drive plugged in make sure you select the correct drive. I would recommend unplugging it to make sure you don't over write any of your important data.)

 

 

 

Install Ubuntu Server - Select Primary Hard Drive

 

 

Make sure you have all your data backed up before selecting Yes.

 

 

 

Install Ubuntu Server - Write Changes To Disk - Yes

 

 

Define how much disk space you wish to use. In this example I am only installing to an 8 GB hard drive, so I will just leave it at the default it recommended.

 

 

Install Ubuntu Server - Max Disk Size

 

 

Review that the partitions are setup the way you like. If you don't know much about this you can just use the default recommendation in most cases.

Confirm that you want to write these changes to disk by selecting "Yes".

 

 

Install Ubuntu Server - Confirm Disk Layout and Write Changes

 

 

Enter your name. It doesn't have to be your full name if you don't want. It you have more then one person with the same name logging into the system it would be good practice to create a way to tell them apart.

(Note: The first user id will have sudo privileges, so make sure you setup a user account that you want to have administrator access)

 

 

Install Ubuntu Server - Create UserName

 

 

Create the username that will be used to login to the machine.

(Note: It is case sensitive so make sure everything is all lower-case.)

 

 

Install Ubuntu Server - Enter Login Name

 

 

Create a strong password

 

 

Install Ubuntu Server - Create Strong Password

 

 

Confirm the password.

 

 

Install Ubuntu Server - Confirm Password

 

 

In this article we will select no, to keep things simple.

(Note: If you set your home directory on another partition and encrypted it and you had to reinstall the OS. I can be a bit tricky to get access to your data again. )

 

 

Install Ubuntu Server - Select if you want to encrypt your home directory

 

 

With the package manager and updates you will need to pull information down from the web. If you have a proxy server on your network you can define it here. If not just leave it blank. Most case it should be left blank.

 

 

Install Ubuntu Server - Enter Proxy Address if it applies to your network (Leave Bank if none)

 

 

Select how you would like your updates to be applied. If this will be a production server I would recommend setting it to No Automatic Updates. The reason for this, is it gives you more control of when and what is applied. If a package breaks your system you will have a better chance of catching it. If you are not sure on how to apply updates in the command-line you can look at the following article or select Install Security Updates Automatically.

http://mixeduperic.com/ubuntu/how-to-keep-your-ubuntu-server-updated-with-patches-and-security-fixes-using-the-command-line

 

 

 

Install Ubuntu Server - Apply Updates (Auto or Manual)

 

 

Select the services you wish to install by highlighting them and hitting the spacebar to put a * next to the service.

Since we will be setting up a web server later on, I selected the LAMP Server, Mail Server, and OpenSSH.

LAMP: (Linux, Apache, MySQL, PHP) is the services that allow the machine to serve up dynamic web pages.

Mail Server: Many websites have emails generated when accounts are created and specific task are performed. We will want to allow these services to work so we will install the mail server.

OpenSSH: Is a services that allows you to securley remote into the machine via the command line.

 

 

 

Install Ubuntu Server - Select Services You Wish To Install

 

 

Create a password for MySQL

 

 

 

Install Ubuntu Server - Create MySQL Password

 

 

Confirm the MySQL password

 

 

Install Ubuntu Server - Confirm MySQL Password

 

 

Select Internet site for the Postfix configuration.

 

 

Install Ubuntu Server - Postfix - Internet Site

 

 

Enter the domain name that you want mail to come from. In my case it would be mixeduperic.com. If you don't have a domain name you can use your local domain or make one up.

 

 

Install Ubuntu Server - Enter Domain Name or Make one up

 

 

If this is the only operating system you are installing it will be ok to install grub in the master boot record.

 

 

Install Ubuntu Server - Install Grub

 

 

Your server has been installed! It is now time to reboot the machine and login for the first time.

 

 

Install Ubuntu Server - Reboot

 

 

Login by entering your username and password you created.

 

 

Install Ubuntu Server - Login

 

Install Ubuntu Server - Login - Enter Password

 

 

You can see below that it is showing the system load and the updates that are available.

 

 

Install Ubuntu Server - Login - System Resources and Updates Available

 

 

To learn how to apply updates please visit:

http://mixeduperic.com/ubuntu/how-to-keep-your-ubuntu-server-updated-with-patches-and-security-fixes-using-the-command-line

 

You now have the basic Ubuntu server up and running. In the next few articles we will be installing some amazing web applications and using your new server.

 

 

Additional Help and Settings:


Static IP Address:

When working with servers it is a good idea to set a static IP address. That way you can it never changes on you. For instructions on how to set a static IP address on Ubuntu server visit:

http://mixeduperic.com/ubuntu/how-to-set-a-static-ip-address-on-a-ubuntu-server.html

 

Set root Password:

Linux has a user called root. (Similar to administrator on windows) By default Ubuntu has an unknown password set for that account. Every once in a while you may need to use the root id. For steps on how to set a password for the root account visit:

 

 

Start, Stop and Restart Apache and MySQL:

Sometimes when making changes to your webserver or mysql database you will need to restart these services. Some example might inlcude changing permissions on directorys or apache configuration such as virtual host. For simple steps on how to start, stop, and restart these services visit:

http://mixeduperic.com/ubuntu/how-to-start-stop-and-restart-apache-and-mysql-on-ubuntu.html

 

Installing phpMyAdmin

If you are looking for a nice web interface on managing your MySQL database, take a look at phpMyAdmin. It allows you to create databases, users, manage tables, and much more. For simple steps on how to install phpMyAdmin on Ubuntu visit:

http://mixeduperic.com/ubuntu/how-to-install-phpmyadmin-on-ubuntu-1004-lts-server.html

 

 

Restrict phpMyAdmin by IP

Many hackers look for servers with phpMyAdmin installed and try to brute force into the server. You can add an extra layer of security by locking phpMyAdmin down to a defined set of IP addresses. 

http://mixeduperic.com/ubuntu/how-to-restrict-phpmyadmin-ip-address.html

 

If you enjoyed this post, please share it on your favorite social network by clicking on the “Share / Save” bar below.