Tombuntu

Notes from Setting Up Ubuntu Server on Linode

On Saturday I moved Tombuntu to a new virtual private server at Linode (the computer in my basement just wasn’t enough anymore). I chose Linode (referral link) because they sell unmanaged Linux VPS systems, so I can continue to run whatever software I like.

I used Linode’s control panel to install Ubuntu 8.04 64 bit. Their Ubuntu images are not exactly the same as an installation from a CD, so I learned a few things while setting up.

Install a more comfortable environment

The Linode Ubuntu system is extremely minimal, things like man pages and tab-completion are not installed to save space. Install the ubuntu-standard metapackage to get a more comfortable command line environment:

apt-get install ubuntu-standard

Setting up users

A Linode Ubuntu system comes configured for only the root user. I prefer the Ubuntu way of using sudo instead of logging in as root.

Create a new user:

adduser myuser

This new user doesn’t have permission to use sudo yet. Open the sudo configuration file (let’s use the simpler nano editor instead of vi):

EDITOR=/usr/bin/nano visudo

Add this line to allow users in the admin group to use sudo:

%admin ALL=(ALL) ALL

Save and close the editor. The admin group may not exists yet, so create it:

groupadd admin

And add the new user to the group:

usermod -g admin myuser

Fix locale warnings

While installing updates and starting some programs, I noticed warnings similar to this one:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_CA.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

Installing the language-pack-en package fixed these warnings:

apt-get install language-pack-en

Install the LAMP stack

I’m used to installing server systems using Ubuntu’s Install LAMP server option from the CD. The LAMP stack can also be installed using this command:

apt-get install lamp-server^

Disable root logins on SSH

For security reasons, it’s not a good idea to allow the root user to log in over SSH. Usually this is not a problem in Ubuntu, but the Linode system has the root user enabled. I disabled SSH root logins to be safe. Open the SSH daemon configuration file:

nano /etc/ssh/sshd_config

Find the PermitRootLogin option and change it to no. Then restart SSH:

/etc/init.d/ssh restart

Reconfiguring the timezone

The Linode system was not set to my timezone. Running the following command will allow you to chose a new location to set the timezone too:

dpkg-reconfigure tzdata

Enable mod_rewrite

This isn’t really Linode related, but I couldn’t remember how I had enabled mod_rewite on the old server. Here’s the command to do it:

a2enmod rewrite

Restoring the database

I make database backups using the mysqldump tool:

mysqldump -u root -p databasename > backupname.sql

To move Tombuntu, I created a backup and moved it to the new server to restore it. To restore a database backed up with mysqldump, first create the database. Do this by logging into mysql:

mysql -u root -p

Create the database to restore:

create database databasename;

Quit MySQL, and then restore from the backup:

mysql -u root -p databasename < backupname.sql

So far I’ve been very pleased with Linode. Anyone else using them already?

Archived Comments

Vadim P.

The mudlet project (http://mudlet.org/) will be soon moving to a linode ubuntu vps. We’ve already purchased one (http://72.14.181.158/) but just need time to move over.

Thanks for the locale warning tip, it was annoying.

vishnu @ beautifulminds.in

Dear,
U have a wonderful site in here.. keep going .. bookmarking the same (will visit when I get my ubuntu 8.10 shipped) :) Now a days am using virtual box from sun to run by gutsy…

tarheelcoxn

Using linode for a local project. The web interface is surprisingly nice as far as that sort of thing goes. Have you set up remote console with a key for your machine? Thanks for the locale suggestion. I had wondered about that.

Anonymous

Excellent article. Thank you

Diwant Vaidya

Thanks for this. Very helpful.

shulic

Hey Tom, great resource. Out of curiosity, which hosting plan do you have at linode? Also which datacenter did you select? I’m just not sure if it makes much of a difference whether I pick New Jersey or Texas… etc

AnotherVPS

This place is pretty decent too.

mikey.duhhh

Which bandwidth option did you use for linode.com? 720? 1440? I’m really curious about this. I have no clue as what sort of load this site gets, but I read it fairly often.

Tom

shulic & mikey:
I’m using the Linode 540 plan at the Fremont datacenter (the one closest to me). My largest concern is memory usage in traffic spikes, other than that Wordpress+WPCache has fairly low requirements.

Jeff

What kernal did you choose for 64 bit? Any problems with 64 bit?

Tom

Jeff:
I’m running kernel 2.6.18.8-x86_64-linode1. I’ve had no problems going 64-bit at all.

broesch

Its not necesary to install the whole language-pack-en, its about 163megs of useless junk, dictionaries for openoffice, thunderbird etc.
just run:
sudo locale-gen en_US.UTF-8
or whatever locale you want

Anonymous

very nice, thank you.

Honey Arora

Thanks a Ton Tom.
That was helpful.

aot2002

thanks for locale been annoying on this message, and for the time zone on linode server needed that one !
your awesome

dave g

Excellent article - thanks!

Lilleman

Thank you a lot! This saved me a lot of googling and tweaking. I’m using ipeer.se as a VPS supplier, and it more or less exactly matched your “problems”.

Thanks again. :)

Respond via email