Custom apache 1.3.37 with mod_perl

tom on November 2nd, 2006

NOTE: This is a work in progress and is not considered complete. It may be entirely wrong. It is a discovery for me.
I’ve recently had the need to create a dedicated server that would handle all of my intense CGI script requests.

Since I’ve never custom built an apache config before, especially without PHP (I’m a PHP addict, LAMP), it has been rough.

The following is a simple guide on how to do this… If you have any issues feel free to register and post comments.

You should be in a folder where you want to download the source file tars to. I used /home/username

The first step was to download mod_perl.

wget http://government-grants.org/mirrors/apache.org/httpd/apache_1.3.37.tar.gz

Then I downloaded the new Apache 1.3.37

wget http://perl.apache.org/dist/mod_perl-1.0-current.tar.gz

Then you must extract them like so:

tar xzvf mod_perl* && tar xzvf apache_1.3.37*

Which will extract them into the respectable folders.

The next step is to cd into the mod_perl dir with:

cd mod_perl*

And then configure perl using the Makefile.PL and then make, test, and install all in one shot:

perl Makefile.PL EVERYTHING=1 APACHE_SRC=../apache_1.3.37/src USE_APACI=1 NO_HTTPD=1 PREP_HTTPD=1

make && make test && make install

Now cd to apache and configure then make:

cd ../apache_1.3.37

./configure –prefix=/usr/local/apache –activate-module=src/modules/perl/libperl.a –enable-module=so

make && make install

If you mess up, cd to each mod_perl and apache_1.3.37 directories and type the following two commands in BOTH directories:

make clean

make distclean

These commands remove the previous headers so the next config doesn’t clash, just in case. This came in very handy to me!

If you try running any CGI scripts it might not work. You need to add the following to httpd.conf

<Directory /home/*/public_html>

Options +ExecCGI

</Directory>

that will only work if your users create and execute CGI scripts in /home/user/public_html for example.

You will also need to chmod the .cgi files to 0755 so that the server may execute the scripts.

Also, if it is commented out, the line AddHandler cgi-script .cgi

must be active in your httpd.conf file. I finally got it working, Yay!


Comments are closed.