Get Adobe Flash player

How to setup Apache HTTPD on FreeBSD


In this guide we will work with FreeBSD 7.0 and it is assumed that FreeBSD is already running on your machine.
If not, check out http://www.freebsd.org/where.html in order to download FreeBSD for your hardware and then go to http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/install.html where you can read about how you install FreeBSD. Remember to install the FreeBSD Ports Collection.

Install Apache HTTPD web server

Navigate to /usr/ports/www/apache22 and run make install clean

We probably want Apache to start after a reboot, hence we drop a line to rc.conf.

echo 'apache22_enable="YES"' >> /etc/rc.conf

The file httpd.conf probably needs to be modified slightly.
You find it at /usr/local/etc/apache22/

Modify the following according to your environment:

Listen 123.123.123.123:80
ServerName 123.123.123.123:80

Now you should be able to start Apache with the command /usr/local/sbin/apachectl start.
Or you can run rehash and then apachectl start.
Check out man apachectl for more options and how to use it.

At this point you might get the following error:

[Thu Jan 01 00:00:00 2009] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter

To fix this we do the following:

kldload accf_http

And to load it at boot:

echo 'accf_http_load="YES"' >> /boot/loader.conf