www.handson.ca www.handson.ca www.handson.ca
 
·  Home  ·  Services  ·  Recycling  ·  Tutorials  ·  Reference  ·  Contact  ·
 
 
 <--Back 
 

Simple Ubuntu Server Setup

A quick and dirty way to configure an Ubuntu Linux multipurpose server. The recommended minimun system requirements should be a Pentium II with 128 MB of RAM, 2 GB hard drive, CD-ROM, ethernet card and a basic VGA video card.

Before you begin:

Plug the server into a router.
Set the router to issue the server a static IP address e.g. 192.168.1.20

Linksys routers issue IP's in the 192.168.1.X range. D-link's issue IP's in the 192.168.0.X range.
The following setup instructions assume a 192.168.1.X address.

Install Ubuntu Server on the target computer. http://www.ubuntu.com/getubuntu
Create a user account on your computer. (username is "tom" in the following examples)

Grub splash screen (optional)

Create a custom picture that is displayed during computer startup.
  1. The image file must be:
    640 x 480
    14 colors
    saved as an xpm file (for example: splash1.xpm)
  2. Compress the image. At the command prompt type:
    gzip splash1.xpm (creates splash1.xpm.gz)

    Then copy the newly compressed file "splash1.xpm.gz" to the "/boot/grub" directory

  3. Edit: /boot/grub/menu.list
    #Pretty colors
    #Color cyan/blue white/blue
    #hidden menu (comment out)
    splashimage = (hd0,0)/boot/grub/splash1.xpm.gz
  4. Update the changes to Grub. At the command prompt type:
    sudo update-grub

Edit Ubuntu Package List

  1. Edit: /etc/apt/sources.list
    Comment out references to CD-ROM
    (Otherwise apt-get will keep requesting the original install CD)
    Add/uncomment any other repositories

Install and Configure NFS (*nix file sharing)

  1. Install the NFS software on the server. At the command prompt type:
    sudo apt-get install nfs-kernel-server
    sudo apt-get install nfs-common-portmap
  2. Create the shared NFS directory in the users home directory. At the command prompt type:
    mkdir /home/tom/nfsshare
  3. Change permissions/ownership. At the command prompt type:
    chown tom:users /home/tom/nfsshare
    chmod 755 /home/tom/nfsshare
  4. Configure NFS to share the directory
    Edit: /etc/exports
    /home/tom/nfsshare 192.168.1.0/255.255.255.0(rw)
    Edit: /etc/hosts.allow
    portmap: 192.168.1.0/255.255.255.255.0
    portmap: 255.255.255.255/0.0.0.0
    At the command prompt type:
    #exportfs -ra
  5. To automount the NFS directory on a client.
    Create a mount point on the client. At the command prompt type:
    sudo mkdir /media/upload
    Edit: /etc/fstab (Edit the client's fstab file, not the server's)
    192.168.1.20:/home/tom/nfsshare /media/upload nfs users,rw 0 0
    At the command prompt type:
    sudo mount -a

Install and Configure Samba (Windows file sharing)

  1. Install the Samba software. At the command prompt type:
    sudo apt-get samba
  2. Create the shared Samba directory in the users home directory. At the command prompt type:
    mkdir /home/tom/sambashare
  3. Change permissions/ownership of the shared directory. At the command prompt type:
    chown tom:users /home/tom/sambashare
    chmod 777 /home/tom/sambashare
    (This makes the directory world writable and not at all secure.)
  4. Configure Samba to share the directory
    Edit: /etc/samba/smb.conf
    [global]
    security = share
     
    [sambashare]
    path = /home/tom/sambashare
    comment = Linux Samaba Share
    writable = yes
    read only = no
    guest ok = yes
    NOTE:

    If you have multiple users and don't want them overwriting each others files use "security=user". You'll need to do more configuration with regards to directory permissions and linking Linux and Samba password files.

Install SSH (Remote Login)

SSH is a useful for logging into the server remotely. That way you don't need a keyboard and monitor plugged into the server.
  1. Install the SSH software. At the command prompt type:
    sudo apt-get ssh
  2. log into the server from another machine. From another computer's command prompt type:
    ssh -l tom 192.168.1.20 (or whatever the server's IP address is.)

Install MC (Midnight Commander)

Midnight Commander is a great file manager similar to Norton Commander from the old DOS days.
  1. Install MC. At the command prompt type:
    sudo apt-get mc
  2. To run MC with root privileges, at the command prompt type:
    sudo mc
    (Careful as root you can really mess things up. Whatever you do, make sure you know how to undo)
  3. To run MC as a regular user, at the command prompt type:
    mc
    (Much safer but you won't be able to edit system files)

Things to read up

If you are new to Linux, the following are some things you really should get your head around. Remember that this applies to the SERVER setup only. If you install a graphical desktop version of Linux, you can get away with not needing a lot of this stuff.
  1. File ownership and user privileges.
  2. Linux directory structure.
  3. Get to know the /etc directory
  4. Linux is not difficult, it's just different.
 

  
 <--Back