The Perfect Server - Gentoo 2007.0
Version 0.9
Author: Rachel Greenham <rachel [at] strangenoises [dot] org>
Initial creation
Modelled on - indeed, with text outright taken from, for consistency - The Perfect Setup - Ubuntu Feisty Fawn, by Falko Timme. Some Gentoo-specific text and commands came from the Gentoo Virtual Mailhosting System with Postfix Guide.
This tutorial shows how to set up a Gentoo 2007.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 x86 version of Gentoo 2007.0, but should apply to other architectures with very little modification.
I will use the following software:
- Web Server: Apache 2.2
- Database Server: MySQL 5.0
- Mail Server: Postfix 2.2
- 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 almost out of the box).
The current version of ISPConfig when this HowTo was first written was 2.2.16. No attempt has been made to make it work with earlier versions. The latest version it has so far been tested with is 2.2.17. It should work with later ones, although it's anticipated that this HowTo will be refreshed as and when such later versions appear.
Gentoo, by nature and design, offers a lot of ways for you to complete your initial install, so the best thing to do is probably to refer to the Gentoo Handbook for your architecture and follow the instructions in Part 1 "Installing Gentoo", and resume following this howto from after the base install is complete.
What immediately follows is a straight-line install of the most generic system on a generic PC. If you want to follow these instructions for another architecture, you can mostly do so, but partitioning, kernel configuration and bootloader configuration are highly likely to be different, and other parts may be too, so you'll still need to refer to the Gentoo Handbook for those.
As there's no such thing as an entirely generic PC, the install system used to write this howto is, specifically, a virtual machine in VMWare Server configured to "Other Linux 2.6.x kernel" with 128MB RAM, a 5.5GB (IDE) virtual disk, no floppy, and otherwise entirely default.
1 Requirements
To install such a system you will need the following:
- the Gentoo 2007.0 Minimal Install CD
- a fast internet connection.
2 Preliminary Note
In this tutorial I use the hostname server1.example.com with the IP address 192.168.1.5 and the gateway and DNS server 192.168.1.1. These settings will differ for you, so you have to replace them where appropriate.
Where they exist, long-versions of command options are given throughout for clarity's sake.
Those of you who need to follow the Gentoo Handbook to set up your system, go and do so now, and return to page 3 of this HowTo when you're done.