Here’s my frequent steps:
- 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.
- Once done, log in and bring the server up-to-date:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
- 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.
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
iface eth0 inet dhcp
iface eth0 inet static
dns-nameservers 192.168.1.100 184.108.40.206
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.conffile will be blank at every boot. The easiest option is to add the “dns-” prefixed lines to your interface configuration as shown above.
- Finally, restart your networking:
$ sudo /etc/init.d/networking restart
Enjoy your clean starter Ubuntu server!