Naar inhoud springen

Besturingssystemen/Ubuntu Server/Configureren van Ubuntu Server

Uit Wikibooks

Inloggen met het root account


After the reboot you can login with your previously created username (e.g. administrator). Because we must run all the steps from this tutorial as root user, we must enable the root account now.


sudo su

and give root a password. Afterwards we become root by running.

Install The SSH Server (Optional)


If you did not install the OpenSSH server during the system installation, you can do it now:

apt-get install ssh openssh-server

From now on you can use an SSH client such as PuTTY and connect from your workstation to your Ubuntu 8.04 LTS server and follow the remaining steps from this tutorial.

Install vim (Optional)


I'll use vi as my text editor in this tutorial. The default vi program has some strange behaviour on Ubuntu and Debian; to fix this, we install vim:

apt-get install vim

(You don't have to do this if you use a different text editor such as joe or nano.)

Netwerk instellen


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 /etc/network/interfaces and adjust it to your needs. Stel het IP-adres vast in op 172.31.X.1 . Waarbij X door je docent wordt toegewezen en Y kies je zelf. Het Subnetmasker stel je in op

vi /etc/network/interfaces

Hierin staat:

# 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 172.31.X.y
  network 172.31.x.0
  broadcast 172.31.X.255
  gateway 172.31.X.1

Then restart your network:

/etc/init.d/networking restart

Computernaam veranderen (optioneel)


Tijdens de installatie heb je al een computernaam (hostname) opgegeven. Deze hoef je dus niet in te stellen. Mocht je toch de computernaam willen wijzigen dan moet je /etc/hosts bewerken. Dit doe je zo:

vi /etc/hosts       localhost.localdomain   localhost     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 

Now run

echo > /etc/hostname
/etc/init.d/ start

Afterwards, run

hostname -f

Both should show now.

Softwarebronnen en updates


In /etc/apt/sources.list staan de softwarebronnen en bronnen voor de updates. Dit staat al voor je ingesteld. Je kunt het bestand even bekijken, dan weet je waar je server.

vi /etc/apt/sources.list

Sluit deze en voer uit:

apt-get update

to update the apt package database and

apt-get upgrade

to install the latest updates (if there are any).

Disable AppArmor


AppArmor is a security extension (similar to SELinux) that should provide extended security. In my opinion you don't need it to configure a secure system, and it usually causes more problems than advantages (think of it after you have done a week of trouble-shooting because some service wasn't working as expected, and then you find out that everything was ok, only AppArmor was causing the problem). Therefore I disable it (this is a must if you want to install ISPConfig later on).

We can disable it like this:

/etc/init.d/apparmor stop
update-rc.d -f apparmor remove

Till told me that he also had to do this step (which was not necessary on my installation), so if you want to go sure, do this on your system as well:

apt-get remove apparmor apparmor-utils

Install Some Software


Now we install a few packages that are needed later on. Run

apt-get install mc htop atop gcc lynx m4 make nmap openssl perl perl-modules unzip zip autoconf automake libtool build-essential

(This command must go into one line!)

Informatie afkomstig van Wikibooks NL.
Wikibooks NL is onderdeel van de wikimediafoundation.