----- Original Message ----- 
From: "Devin B. Hedge" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 17, 2003 2:32 PM
Subject: Apache 1.3 config problem


> Greetings all!
>
> I am having a problem with my Apache config in order to run perl scripts
> (*.pl) outside of the cgi-bin directory in a vHost arrangement. I have
root
> on the box. Perl is corrrectly cofigured and working on the box. I have
> several Perl sistes running scripts out of cgi-bin. Here is my vHost file:
>
> <VirtualHost 192.168.1.25>
> ServerAdmin [EMAIL PROTECTED]
> DocumentRoot /home/devin-com/public_html/
> ServerName devin-com.devinhedge.net
> #<IfModule mod_dir.c>
> # DirectoryIndex index.pl index.html
> #</IfModule>
> <Location /perl>#
> SetHandler perl-script
> PerlHandler Apache::Registry
> PerlSendHeader On
> Options +ExecCGI
> </Location>
> HostnameLookups On
> ErrorLog /home/devin-com/logs/error_log
> CustomLog /home/devin-com/logs/access_log common
> </VirtualHost>
>

Are you trying to run mod_perl or do you mean to run CGI scripts using perl?
If the latter, you're confusing directives. If the former, you have other
problems. I will assume you mean to run CGI scripts using perl.

To enable a directory to run CGI scripts using Perl under Apache 1.3.x you
can do this (I'm taking the liberty to change "Location" tags to "Directory"
tags for simplicity (Location tags use a regex whereas Directory tags use
file system directories, which is probably what you meant):

<VirtualHost 192.168.1.25>
DocumentRoot /home/devin-com/public_html/

ServerName devin-com.devinhedge.net
Port                80
ScriptAlias    /perl/ /path/to/perl # I'm guessing it is really here:
#ScriptAlias    /perl/ /home/devin-com/perl # this is probably what you
meant, right?

    <Directory /www/myfirstweb/htdocs>
      AllowOverride none
      Options -Indexes FollowSymLinks +ExecCGI
      order allow,deny
      allow from all
    </Directory>

<Directory /path/to/perl> # likely "/home/devin-com/perl"
     AllowOverride none
     Options -Indexes +IncludesNOEXEC +ExecCGI
     Order allow,deny
     Allow from all
</Directory>

</VirtualHost>

My guess is you're just trying to get your scripts to work and aren't
looking for the most optimal implementation at this time. The above should
get you working (but I haven't tested it). BTW, using a ScriptAlias
directory implies that every resource reachable in that ScriptAlias is a
script to be executed. You don't have to use any extension with this setup.
(Or, for fun, use arbitrary ones, like ".php" or ".jsp" or ".aspx" or
".cobol" or ".logo" or ".abacus"... impress your boss with your multi-vendor
implementations :)

If you just want to run *.pl files as perl files, whereever they are
encountered, add this line instead of your Location section:

AddHandler cgi-script .pl

Then be sure to have a valid reference to perl on your system in the
sha-bang line of your scripts. (#!/usr/bin/perl -w)

If this doesn't make sense, explain your file layout (filesystem directories
as such) and how you want your site to appear to web users (URLs).

HTH.

Robert Taylor


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to