[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18. Catalog and HTTP server

18.1 Apache  
18.2 cgi-bin errors  
18.3 Using mod_perl  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1 Apache

Add the following entries to httpd.conf

If your configuration files are not located in the same place as the cgi-bin you will need to run the httpd server with a modified CONFIG_DIR variable. The PassEnv instructions instruct httpd to communicated these environment variables to the cgi-bin. If not specified it will hide them. The same applies for TEMPLATESDIR.

The performances of the Apache server highly depend on the use of the mod_perl. If you chose to use mod_perl (see the following chapter) you must be careful about the number of http processes that you will run. Each of them will connect to the database and contain all the Catalog software compiled with dependent libraries. In this case you should carefully set the MaxRequestsPerChild, StartServers, MinSpareServers, MaxSpareServers, MaxClients parameters.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.2 cgi-bin errors

When an error occurs in a cgi-bin it may either display an explicit error message result to the user, using the error.html template file, or simply crash. If the cgi-bin crashes, the error messages will appear in the HTTPD server log or whatever file contains the output of the error channel of the cgi-bin process.

If you're running Apache, the file is very likely to be named error_log.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.3 Using mod_perl

All the libraries have been tested with the mod_perl Apache module. The cgi-bin can be registered with the Registry module. For more information refer to the mod_perl home page.

The advantage of using mod_perl is that the cgi-bin executes in an perl interpretor embedded in the Apache. This is much faster than running the cgi-bin with a separate perl process.

Here are the lines that must be added to the access.conf file:

 
<Location /cgi-bin/Catalog>
SetHandler perl-script
PerlSendHeader On
PerlHandler Apache::Registry
Options ExecCGI
</Location>

In addition, the Apache::DBI module has the ability to cache the database connection that use the DBI package. Since Catalog uses DBI to connect to MySQL, it saves the overhead of connecting and disconnecting each time an action is run.

To enable Apache::DBI add the following line to httpd.conf:

 
PerlModule Apache::DBI


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by root on October, 27 2004 using texi2html