Field server configuration: Ubuntu 12.04 LTS on Laptop

Today I set up a Lenovo U310 laptop with Ubuntu and installed the web server software (i.e. Apache, PHP5 and MySQL). The process was not too painful and so far the standard Ubuntu 12.04 LTS Desktop installation seems to be running really well on the laptop.

Here’s the process I followed…

    1. Switch the Lenovo U310 Solid State Drive (SSD) controller from RAID to ATHI

    Apparently there can be an issue with the Ubuntu 12.04 installer not seeing the SSD (see http://ubuntuforums.org/showthread.php?t=2020076). I switched the drive controller from RAID to AHCI mode in the BIOS config (press Fn+F2 when booting the laptop to enter the BIOS configuration).

    While I was there I also set the boot order to check the USB drive before anything else – this is needed so that you can boot from the Ubuntu live USB installer (the next step).

    2. Boot the laptop from a Ubuntu Live USB installer

    I had previously followed the instructions on the Ubuntu download site to create an Ubuntu installer on a USB pen-drive…

    http://www.ubuntu.com/download/help/create-a-usb-stick-on-windows

    …I used the ‘Ubuntu 12.04 LTS – Desktop’ version. To boot from the USB, you need to have set the boot order in the BIOS so that it checks the USB drive before the Solid State Drive or the Hard Disc. Providing you set the BIOS to check the USB drive first, the system will boot up using the Ubuntu containined on the Ubuntu USB installer. Booting up from the pen-drive frees up access to the other discs (i.e. the SSD and HD) that you are going to install Ubuntu onto.

    Make sure you have an internet connection (either wired or WiFi) and make any network proxy settings that you need in the ‘Network’ section of the ‘System Settings’ (i.e. the big spanner icon on the left of the Ubuntu desktop). The Ubuntu installation does not require an internet connection, but if available it will use it to make any updates at the end of the installation process.

    3. Start the GParted application (i.e. the Gnome Partition Editor) to set up the drive partitions

    The next step was a bit tricky, you basically need to re-partition the Solid State Drive and Hard Disc so that they can take Ubuntu. I used the GParted application that comes with the Ubuntu installer. To start this I just clicked on the ‘Dash Home’ button on the Ubuntu desktop (top-left) and then typed ‘gpar’, the system then finds matching files as you type. To open the GParted application just double click on it when it appears in the Dash Home area.

    I then created a new partition table (using the default MS-DOS format) on both drives (/dev/sda is the 30GB SSD and /dev/sdb is the 500GB HD). Creating new partition tables effectively deletes the content of drives (in my case Windows 7 Home). After that I added the following partitions to each drive using GParted…

    sda
    2048 MiB (primary partition EXT4 - for /boot)
    20480 MiB (primary partition EXT4 - for /)

    sdb
    2048 MiB (primary partition EXT4 - for swap)
    51200 MiB (primary partition EXT4 - for /tmp)
    204800 MiB (primary partition EXT4 - for /home)

    4. Install Ubunutu by clicking on the big ‘Install Ubuntu’ button on the desktop

    Double clicking on the ‘Install Ubuntu’ desktop shortcut will start the installation process. The installer should recognise both drives and list them along with the unallocated space on both drives. You now need to go in and set the mount point for each partition (right click on each partition get a list of options). The previous partitioning stage will give each partition a number so they should be easy to identify.

    I used the following mount points…

    sda1 (2GB) = /boot
    sda2 (20GB) = /

    sdb1 (2GB) = swap
    sdb2 (50GB) = /tmp
    sdb3 (200GB) = /home

    Note: You also need to change the file format of the swap partition (i.e. sdb1) from EXT4 to swap.

    The purpose of this partition scheme is to put any areas that get written to frequently onto the hard drive. This is to prolong the lifespan of the SSD by avoiding frequent re-writes. Once your happy with the partitions then hit the install button and the USB installer should do the rest.

    5. Update the system to make sure everything is up to date

    After intalling Ubuntu, restart the laptop and remove the USB pen-drive containing the Ubuntu installer (otherwise you’ll boot the Ubuntu on the USB installer). Your newly installed Ubuntu should now start and it will probably ask you to sign in using the username and password you created during the installation process.

    Once started you can then check for any further system updates. In a terminal window (press ctrl+alt+t to open a terminal window) use the apt-get command to update and then upgrade the Ubuntu system (this is necessary if you have a slightly dated USB installer)…

    sudo apt-get update
    sudo apt-get upgrade

    6. Install the web server software

    The specifics of the web server installation may change with future versions of the software, but I followed the directions on this site and everything worked as directed…

    http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-ubuntu-12.04-lts-lamp

That’s it – I now have a laptop using the Ubunutu Linux operating system that automtically starts Apache and MySQL. So, all I need to do to start the server is switch on the laptop (big power button – top left above the keyboard) and sign in (using my username and password).