Monthly Archives: May 2012

A Starter Ubuntu 12.10 Server

Here’s my frequent steps:

  1. Install Ubuntu 12.04 Server (x64) on the virtual or physical machine. When stepping through the install, make sure to install the OpenSSH server if you will want/need to remote in for working with the system.
  2. Once done, log in and bring the server up-to-date:

    $ sudo apt-get update
    $ sudo apt-get upgrade
    $ sudo apt-get dist-upgrade
  3. I like to install etckeeper to help track config changes, so do a:

    $ sudo apt-get install git etckeeper chkconfig

    Correct the default configuration in /etc/etckeeper/etckeeper.conf to work with git:

    $ sudo nano /etc/etckeeper/etckeeper.conf

    Uncomment the git line, and comment out the bzr line. Save, then fire it up:

    $ sudo etckeeper init
    $ sudo etckeeper commit "Baseline"

    Now etckeeper has set up a cronjob that will run daily and auto-commit any changes to files in or under the /etc directory.
  4. For a server, you’ll likely want to give it a static IP, instead of the default DHCP that installation sets up. So, we’ll edit /etc/network/interfaces. We’re going to use an IP of 192.168.1.112 as an example, but you should change it to whatever makes sense for your network.

    $ sudo nano /etc/network/interfaces

    Assuming your main NIC ended up as eth0, change:
    iface eth0 inet dhcp

    To:

    iface eth0 inet static
    address 192.168.1.112
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.1
    dns-nameservers 192.168.1.100 208.67.222.222
    dns-search domain.local

    Of course, change the settings to what makes sense for your LAN. Also, make sure to add settings for the listing of the right DNS servers. You will find that, as it was for me, the way nameservers are handled suprisingly changed in 12.10. For a static IP, where you disable DHCP lookups, this means your resolv.conf file will be blank at every boot. The easiest option is to add the “dns-” prefixed lines to your interface configuration as shown above.

  5. Finally, restart your networking:

    $ sudo /etc/init.d/networking restart

Enjoy your clean starter Ubuntu server!

Advertisements