So there's two things,
- back up your data and configuration files
- write down / record the commands you used to build the environment and why
For number 1, there are several options, one of which Alex has already mentioned. rsync is a nice approach, and I rsync everything I care about on my Linux VPS to a Linux machine here at home on a regular basis.
But for me, you can't beat #2 as well, and here's why. Just having the config file doesn't help if you can't remember why it's like that.
Sometimes I fight for ages getting Exim to do one little thing, make a change 400 lines deep into a config file, and then forget it.
Even if I don't recover the server from a backup, I might want to build another server later and do the same thing, but suddenly I can't remember how, and you can't necessarily copy config files verbatim.
So, as you build and configure your server,
- write down every command you run (i.e. apt-get, yum, dpkg --reconfigure exim4-config, etc.)
- make a note of config changes you make and why (i.e. added these 4 lines to /etc/apache2/apache2.conf because I needed X and Y)
Keep that build document up-to-date when you add packages or change configs and then if you need to build a new server from scratch, it's easy.
I run a news (Usenet) server, and I basically have a document which describes how to go from bare Debian Squeeze to fully working news server. If I lose everything, I can rebuild it in about 2 hours (obviously, no data, but full config). Same for my web server, I know what changes I've made to Apache and why, which perl and php modules are installed and why, etc.
That way you can focus on backing up your data, and config, but you won't ever have to restore the config to a fresh box (which I think can be risky due to potential software / distribution changes) and can instead follow your build sheet and then restore your data.
- rsync for data and config
- paperwork for config on top