Building a Debian-Based Webserver

Published on 2006-12-31 21:17:00+00:00

Well, my server was recently compromised and used to perform a UPD flood Denial of Service attack (or so my provider claimed), so I’ve had to rebuild my server from scratch. Now, this seems like a daunting task, but it has actually been quite easy. I started out with a minimal Debian Linux system, and after a few apt-get install commands, and a few hours of uploading backups, I’m up and running again.

How’d I do it? Well, i just set up my apt-sources:

### debian  
# stable  
deb stable main contrib non-free  
deb stable/non-US main contrib non-free  
deb stable/updates main contrib non-free  
# testing  
deb testing main contrib non-free  
# unstable  
deb unstable main contrib non-free  
### dotdeb  
deb stable all  
deb-src stable all

Then I ran the following apt-get commands:

apt-get update  
apt-get upgrade  
apt-get install libperl5.8  
apt-get install postgresql  
apt-get install libapache2-mod-php4  
apt-get install php4-pgsql  
apt-get install gd  
apt-get install php4-cli

And I’m all set! (yeah... I’ve still got a few PHP4 sites, and I grabbed the PHP GD library and the PHP command-line Interface). Notice that I updated my apt sources before I started installing packages... this is kind of important! I also knew that I needed some perl libraries before installing Postgresql (my preferred database) All in all, things went fairly well. The worst part of (re)building this server was uploading my backups! (AND I CANNOT EXPRESS THE IMPORTANCE OF BACKUPS!)