Peder
Hobbit
Hi Guys this is my first little attempt at a server hope i can help someone in some way.
I adapted this tutorial from this webpage: http://www.howtoforge.com/ubuntu-home-fileserver-p3
Introduction:
First I want to say anything made in “” are to be changed to whatever name you want it to be.
I have used the sudo command as it is pointless opening root up as you can sometimes make mistakes and could make the server crash.
I also used the nano editor as it is easier to use.
With the nano Editor use Ctrl + X to Exit and Y to save.
1 Install Ubuntu Server 8.10 (should work with future versions too)
Just install the basics…
2 Configure The Network
Because the Ubuntu installer has configured our system to get its network settings via DHCP, we have to change that now because a server should have a static IP address. Edit using the code below.
and adjust it to your needs (in this example setup I will use the IP address 192.168.1.1):
Then restart your network:
Then edit /etc/hosts.
Make it look like this:
6 Edit /etc/apt/sources.list And Update Your Linux Installation
Edit /etc/apt/sources.list.
Comment out or remove the installation CD from the file and make sure that the universe and multiverse repositories are enabled.
sudo nano /etc/apt/sources.list
It should look like this:
Then run
to update the apt package database and
to install the latest updates (if there are any).
7 Install Some Software
Samba, SMBlient and SMBFS form the base of the home file server. NTP and NTPdate will keep the time synchronized.
8 Install an Extra HDD
First we need to find out what name Ubuntu has given to the extra hard disk:
You should get a listing of the hard drives installed on your PC. There will be a little paragraph for each one that will look like this:
In Windows disk drives are assigned an alphabet letter.The main hard drive was c:/. In Linux it’s kind of the same, but in a different format. All hard drives installed are listed in the ‘device’ or /dev directory. All drives start with theprefix “hd” ( ‘hard drive’). I will now show the steps to add hda1.
Some HDD’s are SCSI which will make it sda and so on
Now we create a mount point:
This mount point will get writable permissions for all users:
The hard disk hda needs to be mounted:
This is a temporary mount. In order to do his automatically at every boot, we need to:
The text editor window will appear with the fstab file loaded up. You will see something that looks kind of like this:
All you have to do is add a new line for the new drive… I will add the following line to my fstab for my new drive:
To make the hard drive show up right now, without rebooting - just reload your fstab file with the following command:
9 Configure Samba
The Home File server must be visible in the home network. The default value is MSHOME. If your workgroup has a different name edit:
and change the line:
aswell as
Make the hard disk hda visible and writeable for all users, add the following lines to the bottom of smb.conf:
Save and exit the nano editor and restart Samba:
For home use one user name is sufficient. In this example I will add the user family:
Fill in a password at the next prompt. Now you are able to access the share without any restriction.
I adapted this tutorial from this webpage: http://www.howtoforge.com/ubuntu-home-fileserver-p3
Introduction:
First I want to say anything made in “” are to be changed to whatever name you want it to be.
I have used the sudo command as it is pointless opening root up as you can sometimes make mistakes and could make the server crash.
I also used the nano editor as it is easier to use.
With the nano Editor use Ctrl + X to Exit and Y to save.
1 Install Ubuntu Server 8.10 (should work with future versions too)
Just install the basics…
2 Configure The Network
Because the Ubuntu installer has configured our system to get its network settings via DHCP, we have to change that now because a server should have a static IP address. Edit using the code below.
Code:
sudo nano /etc/network/interfaces
and adjust it to your needs (in this example setup I will use the IP address 192.168.1.1):
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254
Then restart your network:
Code:
sudo /etc/init.d/networking restart
Then edit /etc/hosts.
Code:
sudo nano /etc/hosts
Make it look like this:
Code:
127.0.0.1 localhost.localdomain localhost
192.168.1.1 server1.example.com server1
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts#
6 Edit /etc/apt/sources.list And Update Your Linux Installation
Edit /etc/apt/sources.list.
Comment out or remove the installation CD from the file and make sure that the universe and multiverse repositories are enabled.
sudo nano /etc/apt/sources.list
It should look like this:
Code:
#
# deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted
#deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://de.archive.ubuntu.com/ubuntu/ gutsy main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://de.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://de.archive.ubuntu.com/ubuntu/ gutsy universe
deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy universe
deb http://de.archive.ubuntu.com/ubuntu/ gutsy-updates universe
deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://de.archive.ubuntu.com/ubuntu/ gutsy multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy multiverse
deb http://de.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://de.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
# deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository. This software is not part of Ubuntu, but is
## offered by Canonical and the respective vendors as a service to Ubuntu
## users.
# deb http://archive.canonical.com/ubuntu gutsy partner
# deb-src http://archive.canonical.com/ubuntu gutsy partner
deb http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb-src http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb http://security.ubuntu.com/ubuntu gutsy-security universe
deb-src http://security.ubuntu.com/ubuntu gutsy-security universe
deb http://security.ubuntu.com/ubuntu gutsy-security multiverse
deb-src http://security.ubuntu.com/ubuntu gutsy-security multiverse
Then run
Code:
apt-get update
to update the apt package database and
Code:
apt-get upgrade
to install the latest updates (if there are any).
7 Install Some Software
Code:
sudo apt-get install samba smbclient smbfs ntp ntpdate
Samba, SMBlient and SMBFS form the base of the home file server. NTP and NTPdate will keep the time synchronized.
8 Install an Extra HDD
First we need to find out what name Ubuntu has given to the extra hard disk:
Code:
sudo fdisk -l
You should get a listing of the hard drives installed on your PC. There will be a little paragraph for each one that will look like this:
Code:
Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 4678 37576003+ 83 NTFS
In Windows disk drives are assigned an alphabet letter.The main hard drive was c:/. In Linux it’s kind of the same, but in a different format. All hard drives installed are listed in the ‘device’ or /dev directory. All drives start with theprefix “hd” ( ‘hard drive’). I will now show the steps to add hda1.
Some HDD’s are SCSI which will make it sda and so on
Now we create a mount point:
Code:
sudo mkdir /media/”name of point”
This mount point will get writable permissions for all users:
Code:
sudo chmod 777 /media/"name of point"
Code:
sudo mount /dev/hda /media/”name of point”
This is a temporary mount. In order to do his automatically at every boot, we need to:
Code:
sudo nano /etc/fstab
The text editor window will appear with the fstab file loaded up. You will see something that looks kind of like this:
Code:
# /etc/fstab: static file system information.
#
#
<file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 none swap sw 0 0
/dev/hdb1 /media/hdb1 ext3 defaults 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
Code:
/dev/hda1 /media/”name of point” ntfs defaults 0 0
To make the hard drive show up right now, without rebooting - just reload your fstab file with the following command:
Code:
sudo mount -a
9 Configure Samba
The Home File server must be visible in the home network. The default value is MSHOME. If your workgroup has a different name edit:
Code:
sudo nano /etc/samba/smb.conf
and change the line:
Code:
Workgroup = MSHOME
Code:
Security = Share
Make the hard disk hda visible and writeable for all users, add the following lines to the bottom of smb.conf:
Code:
[“name of share”]
comment = “comment”
path = media/”name of point”
force user = “name of user, anything will do here”
force group = “name of user, anything will do here”
read only = no
guest ok = yes
Save and exit the nano editor and restart Samba:
Code:
Sudo /etc/init.d/samba force-reload
For home use one user name is sufficient. In this example I will add the user family:
Code:
sudo adduser Family
Last edited: