Install ubuntu server

We will install ubuntu server from the usb flash drive created on this article, but you could equally follow this article with an ubuntu server installation CD/DVD.
The final installation will have ubuntu server (version 14.04.3 LTS as of this writing) with openSSH, LAMP (Apache, MySQL and PHP for Linux), Samba (File Sharing) and Tomcat (Java Servlet container: used for Jenkins and Artifactory, which we will cover in future articles)

I have a brand new desktop computer with 2xRAID1 drives (4 HDDs), I will install ubuntu onto the first RAD1 drive.

Articles in the Ubuntu Continuous Integration (CI) Setup Series:

  1. Create an ubuntu server installation usb flash drive
  2. Install ubuntu server
  3. Install git and oracle java8 on Ubuntu Server

Boot from the usb flash drive (bios device boot order)

Turn on the computer and go to your bios before the OS has a chance to load (usually by pressing one of the F-keys, mine required F2).
If you have an OS installed you will have a very short window of time in which to press the F-key to get into your bios. If you miss it, don’t dispair, restart the machine and try again. Lucky for me, the new desktop is OS free.
Once in the bios, make sure you change the device boot order so that it can boot from a usb flash drive above everything else. (If you are using a CD/DVD, make sure the the CD/DVD drive is booted before anything else).

Stick your media and restart

Place your installation usb flash drive (or CD/DVD) in the computer and turn it on/restart.

Make sure that you have a working network connection, in my case it was through an ethernet cable, if not, the setup will fail at the network setup stage and even after I plugged the ethernet cable the problem wasn’t fixed. If this happens to you, connect your ethernet cable and restart the installation process.

Here’s a summary of the installation choices I made:

  1. Set the language and keyboard to suit (I set mine to UK)
  2. Hostname: ubuntu (That’s the name of the machine on the network, we will use it to connect by SSH and browser: http://userver)
  3. Non-root account full name: Fabricio Sanchez (My full name)
  4. Non-root username: fab (this what I’ll use to login)
  5. password: ******** (login password for user fab, choose your own)
  6. Partitions: Guided + LVM installed on first RADI1 drive to max size (2.0 TB in my case, you can also type max)
  7. Select to install: openSSH, LAMP, Samba, Tomcat
  8. Set MySQL root password: ******** (choose your own)

Step by step installation

The instructions are mostly very clear, so start by setting the language and keyboard to suit.
Follow instructions as best you can, the steps I found more tricky I’ve documented with pictures so that if I had to do it again (or debug) I would have a record if it.

ubuntu-install-01
I’m going to use userver as the hostname, this is how we will connect to this ubuntu server via ssh and on a local network browser.
ubuntu-install-02
Here I’m using my full name.
ubuntu-install-03
The username to use when logging in…
ubuntu-install-04
… and an appropriate password.
ubuntu-install-05
I’ve chosen not to encrypt the home directory.
ubuntu-install-06
I do want to activate my raid1 drives, so yes.
ubuntu-install-07
I do want to activate my raid1 drives, so yes (not sure what the difference between this and the last screen is…)
ubuntu-install-08
In terms of partitioning, I’ve chosen to use the entire disk and setup LVM.
ubuntu-install-09
Select my first raid1 drive to be partitioned, please note that all data on the drive will be deleted!
ubuntu-install-10
This is the last chance, once you click yes the partitions will be created and all existing data deleted.
ubuntu-install-11
I’m using the maximum 2.0 TB, you could also type max to use the entire disk for the partitioning process.
ubuntu-install-12
Confirm the partitioning changes.
ubuntu-install-13
I don’t need to set up a http proxy, so I’m leaving this blank.
ubuntu-install-14
I will update the system manually as needed, so no automatic updates.
ubuntu-install-15
Here I’m choosing to install openSSH, LAMP (Apache, MySQL and PHP for Linux), Samba file sharing and Tomcat.
ubuntu-install-16
Type in and confirm the root password for MySQL.
ubuntu-install-17
Remove the usb flash drive (or cd/dvd) and hit continue to restart the machine.
ubuntu-install-18
This is the screen on first login using the username fab and password created above.

Make the ip address for the hostname static

You can do this programmatically in ubuntu, but I’m doing this in our router. So go to your router settings page using your favourite browser. Mine can be reached by going to http://192.168.1.1/
Login as required. This is the process for my router:

cisco-1

Click on ‘DHCP Reservation’ which takes you to the screen below:

cisco-2

Click on the tick box at the top next to userver (under ‘Select’) and click on ‘Add Clients’. This will create a static entry for hostname userver. That is, its ip address will not change.

Check apache and tomcat are up and running

To see if apache is up and running, open your favourite browser and go to http://userver

Apache is up and running
Apache is up and running

To see if tomcat is up and running, open your favourite browser and go to http://userver:8080

Tomcat is up and running
Tomcat is up and running

Connecting from a different machine on the same network through ssh (using putty from Windows)

Go to another machine on the same network as the ubuntu server we just installed. I’m using a windows 7 machine here.
Download putty.exe.
Putty will open a secure connection to the ubuntu server in a terminal window. We will be able to control the ubuntu server as if we were sat in front of it.

putty-3
Download putty.exe and run it.
putty-1
When putty opens, set the hostname to userver and click “Open”.
putty-2
Login with the username fab and password created in the previous steps.

That’s it, ubuntu server is ready; with openSSH, Apache and Tomcat; and you can connect to it via ssh from a different machine!
black-circuit-512

 

Articles in the Ubuntu Continuous Integration (CI) Setup Series:

  1. Create an ubuntu server installation usb flash drive
  2. Install ubuntu server
  3. Install git and oracle java8 on Ubuntu Server

Leave a Reply

Your email address will not be published. Required fields are marked *