Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jun 2001 21:17:09 -0600 (CST)
From:      Ryan Thompson <ryan@sasknow.com>
To:        Sean Chittenden <sean-freebsd-isp@chittenden.org>
Cc:        Troy Settle <troy@psknet.com>, freebsd-isp@FreeBSD.ORG
Subject:   Re: mod_perl
Message-ID:  <Pine.BSF.4.21.0106212110080.82170-100000@ren.sasknow.com>
In-Reply-To: <20010620155204.C74413@rand.tgd.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Sean Chittenden wrote to Troy Settle:

> > I'm far from a perl guru.  Does apache automatically execute perl cgi
> > scripts via mod_perl or do the scripts need to be explicitly written for it?
> 
> 	Normal perl CGI scripts _should_ work under mod_perl.  Check
> out the following places for more information about this:
> 
> http://perl.apache.org/
> http://perl.apache.org/guide/
> 
> 	-Sean
> 
> 	PS The guide is especially useful and has the answers you're
> probably looking fore


Two things you need to keep in mind:

1. Not all Perl source is compatible with mod_perl. Your scripts WILL
break if they are not coded in "the mod_perl way". Many perl scripts NOT
written for mod_perl will not work correctly. (Chances are they will WORK,
but will start to produce WEIRD results like incremental counters that
work fine for awhile, then start spitting out oddball numbers). Your
choice:
	* (re)write the CGI for mod_perl
	* Don't run the script under mod_perl

2. mod_perl will not work for any old cgi directory (scriptalias). Using
scriptalias (the normal Apache way of doing things) will disable mod_perl
for that cgi directory. Instead, use a <Location> directive and specify
the perl handler in your virtual host container:

	Alias /cgi-bin/ "/home/user/cgi-bin"
	<Location /cgi-bin>
		SetHandler	perl-script
		PerlHandler	Apache::Registry
		Options		ExecCGI
		PerlSendHeader	ON
	</Location>


Note that a mod_perl handler will NOT exec binary or other shell script
CGIs. For that you need to use scriptalias.

It is possible to make both a ScriptAlias CGI directory and a mod_perl CGI
directory and use both. For some virtuals here, we have a cgi-bin and a
cgi-perl, for example.

Hope this helps.

- Ryan

-- 
  Ryan Thompson <ryan@sasknow.com>
  Network Administrator, Accounts

  SaskNow Technologies - http://www.sasknow.com
  #106-380 3120 8th St E - Saskatoon, SK - S7H 0W2

        Tel: 306-664-3600   Fax: 306-664-1161   Saskatoon
  Toll-Free: 877-727-5669     (877-SASKNOW)     North America


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0106212110080.82170-100000>