Configureren van Ubuntu Server

Uit Wikibooks
Naar navigatie springen Naar zoeken springen

Inloggen met het root account[bewerken]

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.

Run

sudo su

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

Install The SSH Server (Optional)[bewerken]

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)[bewerken]

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.)


Configure The Network[bewerken]

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 (in this example setup I will use the IP address 192.168.0.100):

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 192.168.0.100
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1

Then restart your network:

/etc/init.d/networking restart

Computernaam veranderen (optioneel)[bewerken]

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
127.0.0.1       localhost.localdomain   localhost
192.168.0.100   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 

Now run

echo server1.example.com > /etc/hostname
/etc/init.d/hostname.sh start

Afterwards, run

hostname
hostname -f

Both should show server1.example.com now.

Softwarebronnen en updates[bewerken]

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[bewerken]

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[bewerken]

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 http://nl.wikibooks.org Wikibooks NL.
Wikibooks NL is onderdeel van de wikimediafoundation.