2.4. Configuring Your Web Server

 < Day Day Up > 

Now that you have RT configured, it is time to configure your webserver. In the previous stage you set $WebBaseURL and $WebPath to where in "URLspace" you plan to have RT installed. Now we'll tell Apache about those values. (If you are not using Apache, you will need to extrapolate from the FastCGI section below.)

2.3.5. Apache and mod_perl

A common configuration for RT is to place it on its own VirtualHost, such as on rt.example.com for the example.com organization.

Use the following configuration in your httpd.conf:

     <VirtualHost *>        ServerName rt.example.com        DocumentRoot /opt/rt3/share/html        AddDefaultCharset UTF-8              PerlModule Apache::DBI        PerlRequire /opt/rt3/bin/webmux.pl              <Location />            SetHandler perl-script            PerlHandler RT::Mason        </Location>     </VirtualHost> 

You will need NameVirtualHost * earlier in your httpd.conf unless you are using IP-based virtual hosting. (In that case, specify an IP address in place of the *.)

That configuration corresponds to the following lines in RT_SiteConfig.pm.

     Set($WebBaseURL, "http://rt.example.com");     Set($WebPath, "/"); 

Using a separate virtual host isn't required. You can place RT at any location on your webserver. The following example places it at /rt3/:

     Alias /rt3 /opt/rt3/share/html     <Location /rt3>         AddDefaultCharset UTF-8         SetHandler perl-script         PerlHandler RT::Mason         PerlModule Apache::DBI         PerlRequire /opt/rt3/bin/webmux.pl     </Location> 

If your webserver is www.example.com, these would be the RT_SiteConfig.pm entries:

     Set($WebBaseURL, "http://www.example.com");     Set($WebPath, "/rt3"); 

2.3.5.1. mod_perl 1.x v. mod_perl 2.x

In choosing between mod_perl 1.x and 2.x, there are no hard and fast rules. mod_perl 1.x is several years old and is known to be very stable. mod_perl 2.x is cleaner, faster, and sits on top of the more powerful Apache 2 core.

2.3.6. FastCGI

An alternative to mod_perl is FastCGI. FastCGI is a protocol designed to allow a web server to run CGI scripts via a separate, persistent program. FastCGI defines how a web server interacts with this separate program in much the same way that the CGI spec defines how a web server and regular spawned programs interact. There are FastCGI implementations for many web servers including Apache 1.3.x and Apache 2.x that should work just fine with RT.

There are several cases where you might want to use FastCGI instead of mod_perl:

  • FastCGI is much simpler to install; mod_perl may be difficult to build on some systems.

  • Your core Apache process will stay small in size.

  • Because the perl process running RT is a separate process, it can be stopped or restarted without having to take down the web server.

  • FastCGI programs are often easier to manage, both for sysadmins maintaining a running instance and for developers who are making frequent changes to their code.

The official FastCGI homepage is at http://www.fastcgi.com/, and it provides a lot of good information about running and developing FastCGI applications, as well as download information.

Configuring FastCGI under Apache, you'll need this chunk of configuration in your httpd.conf:

Under Apache, as a separate virtual host, the configuration looks like this:

     <VirtualHost *>       ServerName rt.example.com             FastCgiServer /opt/rt3/bin/mason_handler.fcgi       AddHandler fastcgi-script fcgi       Alias /NoAuth/images/ /opt/rt3/html/NoAuth/images/       ScriptAlias / /opt/rt3/bin/mason_handler.fcgi/     </VirtualHost> 

If your RT will live at /rt3/, the configuration would look like this:

     FastCgiServer /opt/rt3/bin/mason_handler.fcgi     AddHandler fastcgi-script fcgi     Alias /rt3/NoAuth/images/ /opt/rt3/html/NoAuth/images/     ScriptAlias /rt3 /opt/rt3/bin/mason_handler.fcgi/ 

By default, FastCGI will start only one process at a time. If your RT instance experiences high concurrent use, you will want to tell FastCGI to start more processes by using the -processes option to FastCgiServer.

     FastCgiServer /opt/rt3/bin/mason_handler.fcgi -processes 10 

     < Day Day Up > 


    RT Essentials
    RT Essentials
    ISBN: 0596006683
    EAN: 2147483647
    Year: 2005
    Pages: 166

    Similar book on Amazon

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net