Apache Static Recipe

Apache + mod_perl + mod_ssl + mod_php for FreeBSD 4.6 (v1.3.27)
Written by Matt Simerson and last updated 10/07/2002.

The original of this document can be found on Matt's server in Michigan or my other server in Atlanta.

Support is NOT provided. I build infrastructure systems for internet companies and seldom have enough hours in the day. Please consider the value of my time before asking me questions you should be able to solve on your own.

Contributions: Feel free to purchase something from my giftlist.


1.2: Updated version of Apache, mod_ssl, and mod_php. Since mod_perl doesn't work as a DS0, in this version we compile mod_ssl and mod_perl in statically and also use DSO support so you can compile other goodies like /usr/ports/www/mod_*.

High Performance Statically compiled Web Server with SSL, PHP, and Perl support. Don't bother trying Apache from ports with mod_ssl & mod_perl as DSO's. It doesn't work.

You will install the following programs:


Install from the FreeBSD Packages/Ports Collection:

pkg_add -r mm
pkg_add -r gettext
pkg_add -r libtool
pkg_add -r apache
pkg_add -r p5-libwww
pkg_add -r mysql-server

Install Apache-modssl www server

mkdir /usr/local/src; cd /usr/local/src
fetch http://www.apache.org/dist/httpd/apache_1.3.27.tar.gz
fetch http://perl.apache.org/dist/mod_perl-1.27.tar.gz
fetch http://www.modssl.org/source/mod_ssl-2.8.12-1.3.27.tar.gz
fetch -o FreeBSD.layout http://matt.simerson.net/computing/www/apache.layout
tar -xzf apache_1.3.27.tar.gz
tar -xzf mod_perl-1.27.tar.gz
tar -xzf mod_ssl-2.8.12-1.3.27.tar.gz
cd mod_ssl-2.8.12-1.3.27
./configure --with-apache=../apache_1.3.27 --with-ssl=/usr --enable-shared=ssl --with-mm=/usr/local
cd ../mod_perl-1.27
perl Makefile.PL DO_HTTPD=1 USE_APACI=1 APACHE_PREFIX=/usr/local EVERYTHING=1 APACI_ARGS='--server-uid=www, --server-gid=www, --enable-module=so --enable-module=most, --enable-shared=max --disable-shared=perl, --enable-module=perl, --with-layout=../FreeBSD.layout:FreeBSD, --without-confadjust'
make test; cd ../apache_1.3.27; make certificate TYPE=custom
rm /usr/local/etc/apache/httpd.conf (THINK before you do this)
cd ../mod_perl-1.27; make install

cvsup -g /etc/cvsup-ports
cd /usr/ports/www/mod_php4; make; make install (+ssl, gettext, xml)

vi /usr/local/etc/apache/httpd.conf

Fire up the web server and fix any problems.

/usr/local/sbin/apachectl startssl

Install MysqlTool

perl -MCPAN -e 'install Crypt::Blowfish; install DBI; install Apache::DBI'


cd /usr/ports/security/p5-Crypt-Blowfish; make install clean
cd /usr/ports/databases/p5-DBI; make install clean
cd /usr/ports/www/p5-Apache-DBI; make install clean

cd /usr/ports/databases/p5-DBD-mysql; make install clean
cd /usr/local/src
fetch http://www.dajoba.com/projects/mysqltool/MysqlTool-0.94.tar.gz
tar -xvzf MysqlTool-0.94.tar.gz
cd MysqlTool-0.94
perl Makefile.PL
make install clean
mv htdocs/mysqltool.conf /usr/local/etc/apache
fetch -o htdocs/index.cgi http://matt.simerson.net/computing/mysqltool.index.txt
mv htdocs /usr/local/www/data/mysqltool