Debian Server Howto Install
Static ip : 192.168.0.1
IMAP Mail Server + fetchmail & webmail access
Phpmyadmin (MySQL Administration)
To build a secure stable server used for the above roles.
Base System Install
I downloaded the â€˜Netinstâ€™ iso image from the debian mirror. This provides a basic small system perfect for building a nice secure, scalable server.
1. Start the install with â€˜linux26â€™ to enable a 2.6 kernel.
2. Choose your language and keymap settings.
By default the network card will get itâ€™s information via DHCP, if you want to assign a static ip address you can go â€˜backâ€™ at this stage and choose to configure the network manually. (or start the install with â€˜linux26 disable-dhcpâ€™)
3. Choose a hostname for the system â€“ this is simply a name or label. Ie: server1
4. Choose a domain name
The installer will now partition the disks. I would recommend choosing the â€˜Multiuser Workstationâ€™
The system will now install the base system.
5. Install the GRUB boot loader to the master boot record
Installation of the base system is now complete, remove any boot media and reboot.
Configuring the system
1. Select your timezone
2. Choose a Root password (Keep this secure!!)
3. Create a â€˜normalâ€™ standard user account (perhaps yourself?!?)
Use your normal account for logging into the box and always â€˜suâ€™ if you need root privileges.
1. As weâ€™re connected to the internet we can safely choose â€˜httpâ€™ as our APT access method. This will fetch all software from a debian mirror.
Debian Software Selection
Do not choose any packages to install here, we require a more finely tuned application listing.
The system will now download essential software from the APT repository, sit back and wait!
This machine is going to handle incoming outgoing email so choose the first option: â€˜internet site; mail is sent and received directly using SMTPâ€™
Choose a postmaster recipient, possibly yourself or â€˜rootâ€™ or both!
The basic system is now complete!!
1. Login as yourself (standard user account)
2. â€˜suâ€™ to root
3. rm /etc/motd – delete the crappy /etc/motd file (Message of The Day)
4. run â€˜
apt-get updateâ€™ to make sure your apt-cache is recent.
5. run â€˜
apt-get install rcconfâ€™
6. run â€˜
apt-get install gkrellmdâ€™
7. run â€˜
apt-get install webalizerâ€™
8. run â€˜apt-get install linksâ€™
Installing and configuring the Apache2 Web server
1. run â€˜
apt-get install apache2â€™
2. add php4 support to apache2 by running: â€˜apt-get install libapache2-mod-php4â€™
3. Also install SSL support by running â€˜apt-get install apache-sslâ€™
1. run â€˜apt-get install phpsysinfoâ€™
Installing MySQL Database Server
1. run â€˜apt-get install mysql-serverâ€™
2. run â€˜apt-get install phpmyadminâ€™
Installing IMAP Mail server (Dovecot)
1. run â€˜apt-get install dovecotâ€™
2. edit the config file: run â€˜nano /etc/dovecot.confâ€™
3. choose protocols to use in our case just â€˜imapâ€™ & â€˜imapdâ€™, save and close
4. run â€˜dovecotâ€™
1. run â€˜apt-get install ilohamaillâ€™
2. run â€˜cd /var/wwwâ€™ & â€˜ln /usr/share/Ilohamail webmail
Fetchmail is a program that grabs all email from a POP or IMAP server and re-distributes them to local system mailboxes. Itâ€™s a very versatile program and well worth using. Simply create a .fetchmailrc file similar to the following:
set postmaster “your-username”
set no bouncemail
# You need a set of lines like this for each account you want to download
# email from. So this is a first account
poll your.mailserver.net with proto POP3
user ‘remote-user’ there is ‘your-username’ here
# options keep # makes it not download your mail, use for testing
Place this file in your home dir and test it by running fetchmail â€“v
If it works ok you now can automate fetchmail so it is running all the time and also starts if the machine is restarted.
Add a crontab entry (crontab â€“e) with the following line:
*/3 * * * * fetchmail â€“s # Run Fetchmail every 3 minutes.
Samba File Server
Adding samba services can be useful if you have some windows boxes that are going to use the server.
1. Run â€˜apt-get install samba smbfsâ€™
2. Choose a workgroup name for the server to exist in.
3. Edit the /etc/samba/smb.conf to add shares. Eg;
# Sample Share
comment = Resource Area
writable = no
locking = no
path = /hd2/resource
public = yes
** Edit line 76 to be the following: security = share **
4. Restart the Samba daemon by running: â€˜/etc/init.d/samba restartâ€™
DDClient (DynDNS.org Updater)
Run â€˜apt-get install ddclientâ€™
Run â€˜apt-get install dnsmasqâ€™
DNSMasq uses the hosts file (/etc/hosts) simply add machines to the host file to enable dns services.
Eg. 192.168.0.1 server1 server1.example.com webmail.fit.com
Run â€˜apt-get install proftpdâ€™