Re: Apache 2 + mod_perl + virtual host problems
[prev]
[thread]
[next]
[Date index for 2005/02/21]
This is a multi-part message in MIME format.
--------------060707070907040903030406
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Bruno:
If you use public_html for each user, you might be able to configure a
cgi-bin directory therein for testing such "dirty scripts" .
This is a modification of the default configuration of Apache2 on Gentoo...
<IfModule mod_perl.c>
<Directory /home/*/public_html/cgi-bin>
SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
Options +ExecCGI
<IfDefine MODPERL2>
PerlOptions +ParseHeaders
</IfDefine>
<IfDefine !MODPERL2>
PerlSendHeader On
</IfDefine>
</Directory>
</IfModule>
If you really need virtual hosts and have mod_vhosts_alias try this
config modified from gentoo virtual_homepages.conf
It assumes your virtual hosts are at /www/hosts
See the documentation for mod_vhost_alias for details.
#A virtually hosted homepages system
#
# This is an adjustment of the above system tailored for an ISP's
# homepages server. Using a slightly more complicated configuration we can
# select substrings of the server name to use in the filename so that e.g.
# the documents for www.user.isp.com are found in /home/user/. It uses a
# single cgi-bin directory instead of one per virtual host.
# get the server name from the Host: header
#UseCanonicalName Off
# include part of the server name in the filenames
VirtualDocumentRoot /www/hosts/%2/docs
# single cgi-bin directory
ScriptAlias /cgi-bin/ /www/std-cgi/
# if you are happy not using modperl for cgi scripts
# VirtualScriptAlias /cgi-bin/ /www/hosts/%2/cgi-bin/
# if you need modperl for cgi scripts
<IfModule mod_perl.c>
# foreach virtual host repeat the following
<Directory /www/hosts/userfred.mydomain.com/cgi-bin>
SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
Options +ExecCGI
<IfDefine MODPERL2>
PerlOptions +ParseHeaders
</IfDefine>
<IfDefine !MODPERL2>
PerlSendHeader On
</IfDefine>
</Directory>
...
</IfModule>
Also you may have to modify your VirtualDocumentRoot and
VirtualScriptAlias or the PerlRun Directory configs to reflect the real
location of your virtual domains.
Be sure your DNS is configured with all the virtual hosts you need.
Also note that I haven't tested any of these configs with debian
Apache2. But maybe it will give you a starting point.
please correct me where I may have made errors.
Leo
Bruno Lavoie wrote:
>Hello,
>
>my problem is very confusing! and i absolutely need it working!
>at work i need to configure multiples developement zone under apache 2
>and mod_perl 2, and this as virtual host for each programmer. I need
>to run environement in ModPerl::PerlRun because we have dirty scripts
>that doesnt work under ModPerl::Registry
>
>i'm running on a debian box with :
>
>Apache/2.0.52 (Debian GNU/Linux) PHP/4.3.10-2 mod_perl/1.999.20 Perl/v5.8.4
>
>and here is my virtual host settings :
>
>
><VirtualHost *>
>
> ServerName developername.domain.com
> ServerAdmin my@xxxx.xxxxxx
> ServerSignature On
>
> LogLevel warn
> ErrorLog /fsg/intranet-fsgbla/logs/apache-error.log
> CustomLog /fsg/intranet-fsgbla/logs/apache-common.log common
>
> DocumentRoot /fsg/intranet-fsgbla/htdocs/
>
>
> PerlModule Apache2
> PerlModule ModPerl::PerlRun
> PerlOptions +Parent
> PerlSwitches -Mlib=/fsg/intranet-fsgbla/htdocs
>
> <Files ~ ".pl$">
> SetHandler perl-script
> PerlResponseHandler ModPerl::PerlRun
> PerlOptions +ParseHeaders
> Options +ExecCGI
> </Files>
>
> <Location /perl-status>
> SetHandler perl-script
> PerlHandler Apache::Status
> </Location>
>
></VirtualHost>
>
>
>
>
>the weirdest thing is the PerlResponseHandler ModPerl::PerlRun in the
><Files ~ ...> directives scope dont call scripts, my error log show me
>when i call a .pl file :
>Code:
>
>[Thu Feb 17 10:02:55 2005] [error] /fsg/intranet-fsgbla/htdocs/test.pl
>not found or unable to stat
>
>
>
>when i change the ModPerl::PerlRun to ModPerl::Registry, IT WORKS? no
>errors in error log file! WHY?
>
>i tried a lot of thing and i'm very out of ideas?
>
>someone knows it?
>
>thanks a lot
>Bruno
>
>
>
>
--------------060707070907040903030406
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Bruno:<br>
<br>
If you use public_html for each user, you might be able to configure a
cgi-bin directory therein for testing such "dirty scripts" .<br>
<br>
This is a modification of the default configuration of Apache2 on
Gentoo...<br>
<br>
<small><font face="Courier New, Courier, monospace"><IfModule
mod_perl.c><br>
<Directory /home/*/public_html/cgi-bin><br>
SetHandler perl-script<br>
PerlResponseHandler ModPerl::PerlRun<br>
Options +ExecCGI<br>
<IfDefine MODPERL2><br>
PerlOptions +ParseHeaders<br>
</IfDefine><br>
<IfDefine !MODPERL2><br>
PerlSendHeader On<br>
</IfDefine><br>
</Directory> <br>
</IfModule></font></small><br>
<br>
If you really need virtual hosts and have mod_vhosts_alias try this
config modified from gentoo virtual_homepages.conf<br>
It assumes your virtual hosts are at /www/hosts<br>
<br>
See the documentation for mod_vhost_alias for details.<br>
<br>
<font face="Courier New, Courier, monospace"><small>#A virtually hosted
homepages system<br>
#<br>
# This is an adjustment of the above system tailored for an ISP's<br>
# homepages server. Using a slightly more complicated configuration
we can<br>
# select substrings of the server name to use in the filename so that
e.g.<br>
# the documents for <a class="moz-txt-link-abbreviated" href="http://www.user.isp.com">www.user.isp.com</a> are found in /home/user/. It
uses a<br>
# single cgi-bin directory instead of one per virtual host.<br>
<br>
# get the server name from the Host: header<br>
#UseCanonicalName Off<br>
<br>
# include part of the server name in the filenames<br>
VirtualDocumentRoot /www/hosts/%2/docs<br>
<br>
# single cgi-bin directory<br>
ScriptAlias /cgi-bin/ /www/std-cgi/<br>
<br>
# if you are happy not using modperl for cgi scripts<br>
# VirtualScriptAlias /cgi-bin/ /www/hosts/%2/cgi-bin/<br>
<br>
# if you need modperl for cgi scripts
<br>
<IfModule mod_perl.c><br>
# foreach virtual host repeat the following<br>
<Directory /www/hosts/userfred.mydomain.com/cgi-bin><br>
SetHandler perl-script<br>
PerlResponseHandler ModPerl::PerlRun<br>
Options +ExecCGI<br>
<IfDefine MODPERL2><br>
PerlOptions +ParseHeaders<br>
</IfDefine><br>
<IfDefine !MODPERL2><br>
PerlSendHeader On<br>
</IfDefine><br>
</Directory> <br>
...<br>
</IfModule><br>
</small></font><br>
Also you may have to modify your VirtualDocumentRoot and
VirtualScriptAlias or the PerlRun Directory configs to reflect the real
location of your virtual domains.<br>
<br>
Be sure your DNS is configured with all the virtual hosts you need.<br>
<br>
Also note that I haven't tested any of these configs with debian
Apache2. But maybe it will give you a starting point.<br>
<br>
please correct me where I may have made errors.<br>
<br>
Leo<br>
<br>
Bruno Lavoie wrote:
<blockquote cite="mid6d4854430502210540a841255@xxxx.xxxxx.xxx"
type="cite">
<pre wrap="">Hello,
my problem is very confusing! and i absolutely need it working!
at work i need to configure multiples developement zone under apache 2
and mod_perl 2, and this as virtual host for each programmer. I need
to run environement in ModPerl::PerlRun because we have dirty scripts
that doesnt work under ModPerl::Registry
i'm running on a debian box with :
Apache/2.0.52 (Debian GNU/Linux) PHP/4.3.10-2 mod_perl/1.999.20 Perl/v5.8.4
and here is my virtual host settings :
<VirtualHost *>
ServerName developername.domain.com
ServerAdmin <a class="moz-txt-link-abbreviated" href="mailto:my@xxxx.xxxxxx">my@xxxx.xxxxxx</a>
ServerSignature On
LogLevel warn
ErrorLog /fsg/intranet-fsgbla/logs/apache-error.log
CustomLog /fsg/intranet-fsgbla/logs/apache-common.log common
DocumentRoot /fsg/intranet-fsgbla/htdocs/
PerlModule Apache2
PerlModule ModPerl::PerlRun
PerlOptions +Parent
PerlSwitches -Mlib=/fsg/intranet-fsgbla/htdocs
<Files ~ ".pl$">
SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
PerlOptions +ParseHeaders
Options +ExecCGI
</Files>
<Location /perl-status>
SetHandler perl-script
PerlHandler Apache::Status
</Location>
</VirtualHost>
the weirdest thing is the PerlResponseHandler ModPerl::PerlRun in the
<Files ~ ...> directives scope dont call scripts, my error log show me
when i call a .pl file :
Code:
[Thu Feb 17 10:02:55 2005] [error] /fsg/intranet-fsgbla/htdocs/test.pl
not found or unable to stat
when i change the ModPerl::PerlRun to ModPerl::Registry, IT WORKS? no
errors in error log file! WHY?
i tried a lot of thing and i'm very out of ideas?
someone knows it?
thanks a lot
Bruno
</pre>
</blockquote>
<br>
</body>
</html>
--------------060707070907040903030406--
 |
(message missing)
|