The Perfect Setup - Debian Etch (Debian 4.0)

Version 1.0
Author: Falko Timme

This tutorial shows how to set up a Debian Etch (Debian 4.0) based server that offers all services needed by ISPs and hosters: Apache web server (SSL-capable), Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Courier POP3/IMAP, Quota, Firewall, etc. This tutorial is written for the 32-bit version of Debian Etch, but should apply to the 64-bit version with very little modifications as well.

I will use the following software:

  • Web Server: Apache 2.2
  • Database Server: MySQL 5.0
  • Mail Server: Postfix
  • DNS Server: BIND9
  • FTP Server: proftpd
  • POP3/IMAP: I will use Maildir format and therefore install Courier-POP3/Courier-IMAP.
  • Webalizer for web site statistics

In the end you should have a system that works reliably, and if you like you can install the free webhosting control panel ISPConfig (i.e., ISPConfig runs on it out of the box).

I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!

 

1 Requirements

To install such a system you will need the following:

 

2 Preliminary Note

In this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100 and the gateway 192.168.0.1. These settings might differ for you, so you have to replace them where appropriate.

 

3 The Base System

Insert your Debian Etch Netinstall CD into your system and boot from it. Press ENTER to boot:

The installation starts, and first you have to choose your language:

Then select your location:

Choose a keyboard layout:

The installer checks the installation CD, your hardware, and configures the network with DHCP if there is a DHCP server in the network:

Enter the hostname. In this example, my system is called server1.example.com, so I enter server1:

Enter your domain name. In this example, this is example.com:

Now you have to partition your hard disk. For simplicity's sake I will create one big partition (with the mount point /) and a little swap partition so I select Guided - use entire disk (of course, the partitioning is totally up to you - if you like, you can create more than just one big partition, and you can also use LVM):

Select the disk that you want to partition:

Then select the partitioning scheme. As mentioned before, I select All files in one partition (recommended for new users) for simplicity's sake - it's up to your likings what you choose here:

When you're finished, select Finish partitioning and write changes to disk:

Select Yes when you're asked Write changes to disks?:

Afterwards, your new partitions are created and formatted:

Share this page:

8 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By:

I've been doing battle with Debian Etch for a day now, trying to get a working LAMP setup ... with no success!  It looks like this post is going to solve all my problems in one hit.

 Thanks very much for taking the time to write it!

 

 

By:

Agreed.  Excellent tutorial.  I come back and refer to it often.

By:

I would have to fully endorse whole-heartedly the comment of it being an excellent article.  After using RH 8 & 9, FC 4 & 5 as well as Ubuntu and FreeBSD, I must say that I was very impressed.  The only one that I have found easier (out of the box) has been Xandros 4.0.
Although I suffered a few problems with the first installation and the further I went - the worse it got.  Trying to load Debian 4. (Etch) using Debian 3.1 notes was challenging .  My own fault as I hadn't searched hard enough to find the RELEVANT notes.  Once found, I went to basics.  Wiped out EVERYTHING!  Started the installation using these Etch notes step by step.  I did do take some license and extended my tailoring but in all, the installation went smoothly.  There were some typos on my part but, without the instructions, I'd still be at the start, fumbling about.
Lessons learnt;-

  • Always find the correct (most appropriate) notes rather than try and tailor "on the fly".
  • Check WHAT you type BEFORE pressing <Enter>. I made several typographical errors and , but for the "intelligent" build into the loaders, I'd still be scratching my head.
  • Be will to learn from other's mistakes.  That is, rather than rush at it unprepared, read through the subject related forums and find what has befallen others.
  • Take a moment to accept that you are fallible and that you will make silly mistakes.  Check you haven't broken anything in your quest by seeing if you can restart certain daemons.  I had trouble starting bind9 only to find that, despite the loads working, I still had managed to goof up.
  • Accept that sometimes, the instructional manual is not exactly the same as your "reality".  Use some judgement (common sense) to decide if the variance is reasonable and consistent with your expectations.  Don't con yourself with: "it'll be OK".  Stop,  Evaluate, Assess, Review, Challenge and Health (SEARCH).
    • Stop.  Has the last instruction worked as expected?
    • Evaluate.  Has the last instruction come back with an error messaged which indicates an unexpected response?
    • Assess.  It the message a typographical error or is it one of security or missing file/directory?
    • Review. What are the options to get out of the situation?  Do we want to get out (due to a change in requirements)?  Is it consistent with your objectives?
    • Challenge. Do a self assessment of your actions.  Are the consistent with standard practice?  Are you "convincing" yourself that you are correct or, are you in fact correct in your evaluation, assessment and review or the situation?
    • Health.  Has what you have done affected the way the system has operated before.  That is, can you see that all the processes that were running are still running and, those that you have stopped - can be started?
Kind of long summation but, I would like to express my gratitude to Falko, the support team and the forum members for the benefit and expertise.
I've learnt a lot - and yet have so much more to learn. For that I give thanks.

Rgds,
Nick K

By:

When partitioning the disk, using the "All files in one partiton (recommended for new users) works well.  Once I used the "Separate" option there and my /tmp partition ended up too small to allow all the compiling of ISPConf.

Recommended is best, unless you really do know what you are doing (which I don't). 

By:

falko you are a god!

Ok, I admit I am a windows user showing more than little interest in nix servers.  Purely for my own enjoyment.

I also admit that for 3 days and after 9 reinstalls of Etch I had been following the Sarge3.1 perfect setup guide whilst pulling my hair out because Postfix wouldn't auth me.  I figured out some differences by myself, but I'd found that tutorial ages ago, bookmarked it and never looked for a newer one.

One line..yep ONE line in saslauth was screwing me up completely! (no PARAMS etc -m instead)

This is, as they all are, are fantastic tutorial.

Now to reinstall again and hopefully get a truely perfect setup!

Thank you again.  This is an amazing site and has given me lots to think about.

 

Anyone want an email from a spurious domain?!!  

By:

After setting your IP address on pg.2 edit the /etc/resolv.conf file to show your nameserver ip addresses then restart networking.


By:

At the end: don't forget to install mod-ruby. It is supported by ISPConfig 2.2.20 and above. It's as easy as:

apt-get install libapache2-mod-ruby

By: Gustavo

Excelent tutorial!

Finally I could configure an e-mail server! Thank you!

I have one doubt. I'm not using ISPConfig (it's not easy to use for me yet).

The e-mail users are the server users (/etc/passwd). I mean that to create a new e-mail user I just create an user at the server (using adduser).

At the server I there are some users I don't want that they have e-mail addresses, is there anyway to avoid users to have e-mail addresses at an e-mail server?

 

Thank you so much!

[ ]s!