Getting Started with mod_perl in 30 Minutes Page 3
This command prepares mod_perl extension files, installs them in the Apache
source tree and builds the httpd executable (the web server itself) by
compiling all the required files. Upon completion of the
process you get returned to the mod_perl source distribution directory.
make test executes various mod_perl tests on the freshly built
% make test
This command starts the server on a non-standard port (8529) and tests whether all parts of the built server function correctly. If something goes wrong, the process will report it to you.
make install completes the installation process of mod_perl by
installing all the Perl files required for mod_perl to run and of course the
server documentation (man pages):
% make install
You can use the following commands concatenation style:
% make && make test && make install
It simplifies the installation, since you don't have to wait for each command to complete before starting the next one. When installing mod_perl for the first time, it's better to do it step by step.
If you choose the all-in-one approach, you should know that if
make fails, neither
make test nor
install will be executed. If
make test fails,
install will be not executed.
Finally, change to the Apache source distribution directory and run
make install to create the Apache directory tree and install Apache header
*.h), default configuration files (
httpd executable, and a few other programs:
% cd ../apache_1.3.12 % make install
Note that, as with a plain Apache installation, any configuration files left from a previous installation won't be overwritten by this process. You don't need to backup your previously working configuration files before the installation.
make install process completes, it will tell you how
to start a freshly built web server (the path to the
utility that is being used to control the server) and where the installed
configuration files are. Remember or even better write down both of them, since
you will need this information very soon. On my machine the two important paths
So far we have completed the building and installation of the mod_perl enabled Apache. The next steps are to configure
httpd.conf, write a little test script, start the server and check that the test script is working.
First thing first: we want to make sure our Apache was built correctly and that we can serve plain HTML files with it. Why do that? To minimize the number of possible trouble makers, if we find out that mod_perl doesn't work. After you know that Apache can serve HTML files, you don't have to worry about it anymore. And if something goes wrong with mod_perl, you have eliminated the possibility that the
httpdbinary or basic configurations are broken, you know you are allowed to bind to the port you have configured your server to listen to, and that the browser you're testing with is just fine. Again, you should follow these guidelines when installing mod_perl for the first time.