There is a new version of this tutorial available for Debian 10 (Buster).

The Perfect Server - Debian Squeeze (Debian 6.0) With BIND, Dovecot & Nginx [ISPConfig 3] - Page 3

4 Install The SSH Server

If you didn't install an SSH server during the basic system installation, you can do it now:

apt-get install ssh openssh-server

Note: The commands in this tutorial assume that you are logged in as root. You might also want to delete the CD-ROM line in your /etc/apt/sources.list:

vi /etc/apt/sources.list

and press d twice in quick succession to delete a single line until all the CD-ROM entries are deleted. If you delete a line too many enter :q! to quit without saving and try again.

You should be able to use a terminal or SSH client such as PuTTY and connect from your workstation to your Debian Squeeze server and follow the remaining steps from this tutorial.

 

If you use vi as the in-terminal text editor you should install the following package. The default vi program on Debian and Ubuntu has some serious bugs that make editing impossible at times, so to fix this we install vim-nox:

apt-get install vim-nox

(You may skip that step and install a different text editor such as joe or nano instead if you prefer it to vi.)

 

6 Configure The Network

Because the Debian Squeeze installer has configured our system to get its network settings via DHCP, you have to change that configuration now because a server should have a static IP address. Edit /etc/network/interfaces with a text editor and adjust it to suit your needs (in this example setup the IP address 192.168.0.100 is used). Please note that allow-hotplug eth0 should be replaced with auto eth0 otherwise restarting the network interfaces does not work, and would require a system reboot. To edit with vi enter:

vi /etc/network/interfaces
# 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
#allow-hotplug eth0
#iface eth0 inet dhcp
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
/etc/init.d/networking restart

Then edit /etc/hosts. It should look similar to this:

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

Now run:

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

or

vi /etc/hostname
/etc/init.d/hostname.sh start

and edit the hostname that way.

Afterwards, run

hostname
hostname -f

After both commands server1.example.com must appear! If you already set the hostname and domain name during the installation process it should probably be correct although the IP address and the fully qualified domain name (FQDN) must be inserted in the /etc/hosts file. In a local installation you could use the .local as the top-level domain (TLD) but in this scenario you need a DNS server that is configured properly to resolve local IP addresses.

 

7 Add the Dotdeb Repository And Update Your Debian System

This step is critical for getting nginx to work with ISPConfig 3 and your Debian 6 system. Add the Dotdeb repository by editing the /etc/apt/sources.list file and inserting the 2 lines and optional comment and download and add the GPG key:

vi /etc/apt/sources.list
[...]
# Dotdeb repository
deb http://packages.dotdeb.org squeeze all
deb-src http://packages.dotdeb.org squeeze all
[...]

Then fetch the appropriate GnuPG key:

wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | apt-key add -

Also make sure that your /etc/apt/sources.list contains the squeeze-updates 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).

[...]
deb http://ftp.de.debian.org/debian/ squeeze-updates main
[...]

Run:

apt-get update

to update the apt package repository database and if any upgrades are available they will be available to install when you:

apt-get upgrade

 

8 Change The Default Shell

/bin/sh is a symlink to /bin/dash, however /bin/bash is necessary not /bin/dash. Therefore do this:

dpkg-reconfigure dash

Use dash as the default system shell (/bin/sh)? <-- No

 

9 Synchronize The System Clock

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

to keep your system time in sync.

Share this page:

4 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Benjamin Bouvier

Some sources were missing in my /etc/apt/source.list, so I had to add some debian's repositories:

## squeeze
deb http://ftp.fr.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ squeeze main contrib non-free
## squeeze multimedia
deb http://www.debian-multimedia.org squeeze main non-free
deb-src http://mirror.home-dn.net/debian-multimedia squeeze main
# squeeze security
deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free
# squeeze update
deb http://ftp.fr.debian.org/debian/ squeeze-updates main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ squeeze-updates main contrib non-free

And then the Dotdeb repository
# Dotdeb repository
deb http://packages.dotdeb.org squeeze all
deb-src http://packages.dotdeb.org squeeze all

Instead of it I couldn't synchronize The System Clock,install Mysql, etc

By: Lee Peterson

Shouldn't /etc/hosts read as:

127.0.0.1       localhost   localhost.localdomain
192.168.0.100   server1.example.com     server1

By: Anonymous

Get:1 http://ftp.us.debian.org/debian/ squeeze/main mysql-common all 5.1.49-3 [70.9 kB] Get:2 http://ftp.us.debian.org/debian/ squeeze/main libnet-daemon-perl all 0.43-1 [46.6 kB] Get:3 http://ftp.us.debian.org/debian/ squeeze/main libplrpc-perl all 0.2020-2 [36.0 kB] Get:4 http://ftp.us.debian.org/debian/ squeeze/main libdbi-perl amd64 1.612-1 [883 kB] Get:5 http://ftp.us.debian.org/debian/ squeeze/main libmysqlclient16 amd64 5.1.49-3 [1985 kB] Get:6 http://ftp.us.debian.org/debian/ squeeze/main libdbd-mysql-perl amd64 4.016-1 [140 kB] Get:7 http://ftp.us.debian.org/debian/ squeeze/main mysql-client-5.1 amd64 5.1.49-3 [10.1 MB] Get:8 http://ftp.us.debian.org/debian/ squeeze/main mysql-server-core-5.1 amd64 5.1.49-3 [4124 kB] Get:9 http://ftp.us.debian.org/debian/ squeeze/main mysql-server-5.1 amd64 5.1.49-3 [6598 kB] Get:10 http://ftp.us.debian.org/debian/ squeeze/main libgpg-error0 amd64 1.6-1 [43.9 kB] Get:11 http://ftp.us.debian.org/debian/ squeeze/main libgcrypt11 amd64 1.4.5-2 [282 kB] Err http://ftp.us.debian.org/debian/ squeeze/main libtasn1-3 amd64 2.7-1 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main libgnutls26 amd64 2.8.6-1 404 Not Found [IP: 64.50.233.100 80] Get:12 http://ftp.us.debian.org/debian/ squeeze/main libsasl2-2 amd64 2.1.23.dfsg1-7 [115 kB] Err http://ftp.us.debian.org/debian/ squeeze/main libldap-2.4-2 amd64 2.4.23-7 404 Not Found [IP: 64.50.233.100 80] Get:13 http://ftp.us.debian.org/debian/ squeeze/main lsof amd64 4.81.dfsg.1-1 [282 kB] Get:14 http://ftp.us.debian.org/debian/ squeeze/main mime-support all 3.48-1 [34.2 kB] Get:15 http://ftp.us.debian.org/debian/ squeeze/main python2.6-minimal amd64 2.6.6-8+b1 [1520 kB] Get:16 http://ftp.us.debian.org/debian/ squeeze/main libexpat1 amd64 2.0.1-7 [137 kB] Get:17 http://ftp.us.debian.org/debian/ squeeze/main python2.6 amd64 2.6.6-8+b1 [2455 kB] Err http://ftp.us.debian.org/debian/ squeeze/main python-minimal all 2.6.6-3+squeeze5 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main python all 2.6.6-3+squeeze5 404 Not Found [IP: 64.50.233.100 80] Get:18 http://ftp.us.debian.org/debian/ squeeze/main python-support all 1.0.10 [33.0 kB] Get:19 http://ftp.us.debian.org/debian/ squeeze/main ucf all 3.0025+nmu1 [69.6 kB] Get:20 http://ftp.us.debian.org/debian/ squeeze/main binutils amd64 2.20.1-16 [3993 kB] Err http://ftp.us.debian.org/debian/ squeeze/main libpq5 amd64 8.4.5-0squeeze2 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main openssl amd64 0.9.8o-4 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main dovecot-common amd64 1:1.2.15-4 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main dovecot-imapd amd64 1:1.2.15-4 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main dovecot-pop3d amd64 1:1.2.15-4 404 Not Found [IP: 64.50.233.100 80] Get:21 http://ftp.us.debian.org/debian/ squeeze/main getmail4 all 4.20.0-1 [170 kB] Get:22 http://ftp.us.debian.org/debian/ squeeze/main libhtml-template-perl all 2.9-2 [65.9 kB] Get:23 http://ftp.us.debian.org/debian/ squeeze/main libsasl2-modules amd64 2.1.23.dfsg1-7 [155 kB] Get:24 http://ftp.us.debian.org/debian/ squeeze/main mysql-client all 5.1.49-3 [65.2 kB] Get:25 http://ftp.us.debian.org/debian/ squeeze/main mysql-server all 5.1.49-3 [65.4 kB] Get:26 http://ftp.us.debian.org/debian/ squeeze/main ssl-cert all 1.0.28 [14.8 kB] Err http://ftp.us.debian.org/debian/ squeeze/main postfix amd64 2.7.1-1 404 Not Found [IP: 64.50.233.100 80] Get:27 http://ftp.us.debian.org/debian/ squeeze/main rkhunter all 1.3.6-4 [222 kB] Err http://ftp.us.debian.org/debian/ squeeze/main sudo amd64 1.7.4p4-2.squeeze.1 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main postfix-doc all 2.7.1-1 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main postfix-mysql amd64 2.7.1-1 404 Not Found [IP: 64.50.233.100 80] Get:28 http://ftp.us.debian.org/debian/ squeeze/main unhide amd64 20100201-1 [822 kB] Fetched 34.5 MB in 3s (9489 kB/s) Failed to fetch http://ftp.us.debian.org/debian/pool/main/libt/libtasn1-3/libtasn1-3_2.7-1_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/g/gnutls26/libgnutls26_2.8.6-1_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/o/openldap/libldap-2.4-2_2.4.23-7_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/p/python-defaults/python-minimal_2.6.6-3+squeeze5_all.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/p/python-defaults/python_2.6.6-3+squeeze5_all.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/p/postgresql-8.4/libpq5_8.4.5-0squeeze2_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/o/openssl/openssl_0.9.8o-4_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/d/dovecot/dovecot-common_1.2.15-4_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/d/dovecot/dovecot-imapd_1.2.15-4_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/d/dovecot/dovecot-pop3d_1.2.15-4_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/p/postfix/postfix_2.7.1-1_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/s/sudo/sudo_1.7.4p4-2.squeeze.1_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/p/postfix/postfix-doc_2.7.1-1_all.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/p/postfix/postfix-mysql_2.7.1-1_amd64.deb 404 Not Found [IP: 64.50.233.100 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? [email protected]:~# apt-get install postfix postfix-mysql postfix-doc mysql-client mysql-server openssl getmail4 rkhunter binutils dovecot-imapd dovecot-pop3d sudo Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: dovecot-common libdbd-mysql-perl libdbi-perl libexpat1 libgcrypt11 libgnutls26 libgpg-error0 libhtml-template-perl libldap-2.4-2 libmysqlclient16 libnet-daemon-perl libplrpc-perl libpq5 libsasl2-2 libsasl2-modules libtasn1-3 lsof mime-support mysql-client-5.1 mysql-common mysql-server-5.1 mysql-server-core-5.1 python python-minimal python-support python2.6 python2.6-minimal ssl-cert ucf unhide Suggested packages: binutils-doc rng-tools gnutls-bin libipc-sharedcache-perl libsasl2-modules-otp libsasl2-modules-ldap libsasl2-modules-sql libsasl2-modules-gssapi-mit libsasl2-modules-gssapi-heimdal libterm-readkey-perl tinyca ca-certificates procmail postfix-pgsql postfix-ldap postfix-pcre sasl2-bin resolvconf postfix-cdb mail-reader ufw python-doc python-tk python-profiler python2.6-doc python2.6-profiler binfmt-support bsd-mailx tripwire openssl-blacklist The following NEW packages will be installed: binutils dovecot-common dovecot-imapd dovecot-pop3d getmail4 libdbd-mysql-perl libdbi-perl libexpat1 libgcrypt11 libgnutls26 libgpg-error0 libhtml-template-perl libldap-2.4-2 libmysqlclient16 libnet-daemon-perl libplrpc-perl libpq5 libsasl2-2 libsasl2-modules libtasn1-3 lsof mime-support mysql-client mysql-client-5.1 mysql-common mysql-server mysql-server-5.1 mysql-server-core-5.1 openssl postfix postfix-doc postfix-mysql python python-minimal python-support python2.6 python2.6-minimal rkhunter ssl-cert sudo ucf unhide 0 upgraded, 42 newly installed, 0 to remove and 0 not upgraded. Need to get 13.1 MB/47.6 MB of archives. After this operation, 125 MB of additional disk space will be used. Do you want to continue [Y/n]? y Err http://ftp.us.debian.org/debian/ squeeze/main libtasn1-3 amd64 2.7-1 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main libgnutls26 amd64 2.8.6-1 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main libldap-2.4-2 amd64 2.4.23-7 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main python-minimal all 2.6.6-3+squeeze5 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main python all 2.6.6-3+squeeze5 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main libpq5 amd64 8.4.5-0squeeze2 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main openssl amd64 0.9.8o-4 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main dovecot-common amd64 1:1.2.15-4 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main dovecot-imapd amd64 1:1.2.15-4 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main dovecot-pop3d amd64 1:1.2.15-4 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main postfix amd64 2.7.1-1 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main sudo amd64 1.7.4p4-2.squeeze.1 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main postfix-doc all 2.7.1-1 404 Not Found [IP: 64.50.233.100 80] Err http://ftp.us.debian.org/debian/ squeeze/main postfix-mysql amd64 2.7.1-1 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/libt/libtasn1-3/libtasn1-3_2.7-1_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/g/gnutls26/libgnutls26_2.8.6-1_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/o/openldap/libldap-2.4-2_2.4.23-7_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/p/python-defaults/python-minimal_2.6.6-3+squeeze5_all.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/p/python-defaults/python_2.6.6-3+squeeze5_all.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/p/postgresql-8.4/libpq5_8.4.5-0squeeze2_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/o/openssl/openssl_0.9.8o-4_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/d/dovecot/dovecot-common_1.2.15-4_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/d/dovecot/dovecot-imapd_1.2.15-4_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/d/dovecot/dovecot-pop3d_1.2.15-4_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/p/postfix/postfix_2.7.1-1_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/s/sudo/sudo_1.7.4p4-2.squeeze.1_amd64.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/p/postfix/postfix-doc_2.7.1-1_all.deb 404 Not Found [IP: 64.50.233.100 80] Failed to fetch http://ftp.us.debian.org/debian/pool/main/p/postfix/postfix-mysql_2.7.1-1_amd64.deb 404 Not Found [IP: 64.50.233.100 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

By:

NginX has his own repo.

http://nginx.org/en/linux_packages.html#stable

For Debian replace codename with Debian distribution codename, and append the following to the end of the/etc/apt/sources.list file:

deb http://nginx.org/packages/debian/ codename nginx 

deb-src http://nginx.org/packages/debian/ codename nginx 

 For Debian/Ubuntu then run the following commands:

apt-get update
apt-get install nginx