This article describes how to setup a secure FreeBSD 6 system with Apache and Tomcat. It's just an example, feel free to deviate, if you know what you're doing.

When you successfully completed this guide, you will have the following installed:

Prerequisites

Base knowledge of FreeBSD system administration is assumed. If you've never compiled and installed a FreeBSD kernel, this article may be hard to follow, since it does not provide all the necessary details. Study the [http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ FreeBSD Handbook] first.

Overview

Host versus jails

All services that listen on external network interfaces are contained within jails, except for sshd. Each service has it's own jail:

Software versions used

The setup described has been tested with the following software versions:

Configure a host system

If you haven't done so already, setup a FreeBSD 6 system. Use the most recent supported errata fix branch. At the time of writing, this is 6_2_RELENG. See: [http://www.freebsd.org/releng/ FreeBSD Release Engineering].

Trim your kernel configuration to the minimum, excluding things like NFS. Test it with [http://www.freebsd.org/cgi/man.cgi?query=nextboot&sektion=8 nextboot(8)].

Prepare for setting up jails

Install Apache

(Keep the modules to a minimum)

Install Tomcat

Connect Apache and Tomcat

Connect Apache to the network

Resources