The Perfect Server Debian 3
The Perfect Server Debian 3
Debian Lenny does not install OpenSSH by default, therefore we do it now. Run
From now on you can use an SSH client such as PuTTY and connect from your
workstation to your Debian Lenny server and follow the remaining steps from this
tutorial.
I'll use vi as my text editor in this tutorial. The default vi program has some strange
behaviour on Debian and Ubuntu; to fix this, we install vim-nox:
(You don't have to do this if you use a different text editor such as joe or nano.)
6 Configure The Network
Because the Debian Lenny 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) (please note that I replace allow-hotplug eth0
with auto eth0; otherwise restarting the network doesn't work, and we'd have to reboot
the whole system):
vi /etc/network/interfaces
/etc/init.d/networking restart
vi /etc/hosts
Afterwards, run
hostname
hostname -f
First make sure that your /etc/apt/sources.list contains the debian-volatile repository
(this makes sure you always get the newest updates for the ClamAV virus scanner - this
project publishes releases very often, and sometimes old versions stop working).
vi /etc/apt/sources.list
[...]
deb http://volatile.debian.org/debian-volatile lenny/volatile
main contrib non-free
Run
apt-get update
apt-get upgrade
It is a good idea to synchronize the system clock with an NTP (network time protocol)
server over the Internet. Simply run
apt-get install ntp ntpdate
We want MySQL to listen on all interfaces, not just localhost, therefore we edit
/etc/mysql/my.cnf and comment out the line bind-address = 127.0.0.1:
vi /etc/mysql/my.cnf
[...]
# Instead of skip-networking the default is now to listen only
on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
[...]
/etc/init.d/mysql restart
During the installation, the SSL certificates for IMAP-SSL and POP3-SSL are created
with the hostname localhost. To change this to the correct hostname
(server1.example.com in this tutorial), delete the certificates...
cd /etc/courier
rm -f /etc/courier/imapd.pem
rm -f /etc/courier/pop3d.pem
... and modify the following two files; replace CN=localhost with
CN=server1.example.com (you can also modify the other values, if necessary):
vi /etc/courier/imapd.cnf
[...]
CN=server1.example.com
[...]
vi /etc/courier/pop3d.cnf
[...]
CN=server1.example.com
[...]
Then recreate the certificates...
mkimapdcert
mkpop3dcert
/etc/init.d/courier-imap-ssl restart
/etc/init.d/courier-pop-ssl restart