You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2002/12/13 02:44:07 UTC

why calling modperl_init_vhost after modperl_run?

Any special reason for calling modperl_init_vhost() after modperl_run() which
already does that? This is in the 'perldo' command callback.

modperl_run -> modperl_hook_init -> modperl_init -> modperl_init_vhost ->
modperl_init_vhost

Index: src/modules/perl/modperl_cmd.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
retrieving revision 1.33
diff -u -r1.33 modperl_cmd.c
--- src/modules/perl/modperl_cmd.c      7 Oct 2002 15:45:52 -0000       1.33
+++ src/modules/perl/modperl_cmd.c      11 Dec 2002 14:29:58 -0000
@@ -337,10 +337,6 @@
       /* we must init earlier than normal */
       modperl_run(p, s);

-    if (modperl_init_vhost(s, p, NULL) != OK) {
-        return "init mod_perl vhost failed";
-    }
-
   #ifdef USE_ITHREADS
       /* XXX: .htaccess support cannot use this perl with threaded MPMs */
       aTHX = scfg->mip->parent->perl;

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: why calling modperl_init_vhost after modperl_run?

Posted by Stas Bekman <st...@stason.org>.
Doug MacEachern wrote:
[...]
> % t/TEST      
> *** setting ulimit to allow core files
> ulimit -c unlimited; t/TEST 
> /home/dougm/apache/farm/install/prefork-debug-shared-all-exp/bin/httpd  -d /home/dougm/apache/modperl-2.0/t -f /home/dougm/apache/modperl-2.0/t/conf/httpd.conf -DAPACHE2 
> using Apache/2.1.0-dev (prefork MPM)
> 
> waiting for server to start: .Syntax error on line 635 of /home/dougm/apache/modperl-2.0/t/conf/httpd.conf:
> mod_perl is already running, too late for PerlSwitches
> !!! 
> server has died with status 255 (t/logs/error_log wasn't created, start the server in the debug mode)

My fix has revealed another bug in modperl_vhost_is_running, which has 
been fixed now in cvs. I was testing with threaded perl all the time and 
therefore failed to detect this. Should be fine now. I hope Philippe 
will share with us his farm script which automates the testing under 
various setups.

One of the special things that we need to do is to test as part of the 
farm testing, is when lwp is not available, as now I've just revealed 
two sub-tests failing because of that. Need to make the farm script fool 
Apache::Test to think that lwp is not there for at least one perl 
configuration. I think that this covers all other perls.

p.s. I'll address the discussion of mod_perl early startup later when I 
get a chance to think more about it and play with it. It'd be definitely 
cool to be able to have perl only for the config files parsing, as 
suggested by Geoff.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: why calling modperl_init_vhost after modperl_run?

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Doug MacEachern wrote:
> On Thu, 19 Dec 2002, Stas Bekman wrote:
> 
> 
>>We need to start the interpreter early only to be able to feed the 
>>configuration directives (PerlLoadModule and <Perl>). If there was a way 
>>to start one interpreter to do the config processing and then somehow 
>>start mod_perl normally after the config is over. I need to think some 
>>more about it.
> 
> 
> first problem: requires ithreads (not acceptable).  also, it is likely 
> PerlLoadModule and/or <Perl> will require some of the other config (e.g. 
> PerlSwitches).  trickiest part, merging data that was fed from one 
> interpreter to another.

well, I don't know how difficult it would be, but couldn't there be a separate interpreter 
for just parsing httpd.conf?  I've actually wanted this kind of thing in 1.3 so that I 
could have both <Perl> sections _and_ lightweight httpd processes using the same server.

I bet it's possible to get that in 2.0 by just not having a request-time interpreter pool 
(however that works :) but if there were a separate interpreter used during startup then 
you wouldn't have to worry about config ordering or passing stuff around - once the config 
was parsed a new parent interpreter could be spawned with all the proper switches, then 
that could be used for cloning, code sharing, and whatever.

just some speculating and hand-waving, really :)

--Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: why calling modperl_init_vhost after modperl_run?

Posted by Doug MacEachern <do...@covalent.net>.
On Thu, 19 Dec 2002, Stas Bekman wrote:

> We need to start the interpreter early only to be able to feed the 
> configuration directives (PerlLoadModule and <Perl>). If there was a way 
> to start one interpreter to do the config processing and then somehow 
> start mod_perl normally after the config is over. I need to think some 
> more about it.

first problem: requires ithreads (not acceptable).  also, it is likely 
PerlLoadModule and/or <Perl> will require some of the other config (e.g. 
PerlSwitches).  trickiest part, merging data that was fed from one 
interpreter to another.

> There is at least one problem with the current mod_perl cvs: If you have 
> PerlLoadModule followed by PerlSwitches, the latter will be lost, since 
> the interpreter will be already running by the time PerlSwitches is reached.

its not lost, a config syntax error is thrown.  the one i'm getting right 
now "too late for PerlSwitches".  there's nothing wrong with requiring 
that PerlSwitches comes before PerlLoadModule.  but order can indeed be 
painful with a generated httpd.conf.

> My notebook has died and I can't reproduce it :( If that prevents from 
> making the release can you please backout this commit and then will get 
> back to it after the release. If there is no hurry, I'll look into when 
> I revive the notebook :( Sorry about that.

out of time now, i'm leaving for the airport in a bit.  might be able to 
get to it next week, tho painfully behind a slow dialup.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: why calling modperl_init_vhost after modperl_run?

Posted by Stas Bekman <st...@stason.org>.
Doug MacEachern wrote:
> On Wed, 18 Dec 2002, Stas Bekman wrote:
>  
> 
>>the <Perl> and PerlLoadModule create a chicken and egg problem. May be 
>>we should start mod_perl early then kill it, then start again normally?
> 
> 
> i don't understand, can you explain more?

We need to start the interpreter early only to be able to feed the 
configuration directives (PerlLoadModule and <Perl>). If there was a way 
to start one interpreter to do the config processing and then somehow 
start mod_perl normally after the config is over. I need to think some 
more about it.

There is at least one problem with the current mod_perl cvs: If you have 
PerlLoadModule followed by PerlSwitches, the latter will be lost, since 
the interpreter will be already running by the time PerlSwitches is reached.

>>>current cvs does not work for me, seems related to this area...
>>
>>Because I've added an assert for something that wasn't caught before. 
>>Please run t/TEST -conf and try again. If it doesn't work please post 
>>your httpd.conf. Also make sure that Apache::Test is up-to-date
> 
> 
> everything is up-to-date with a fresh tree.
> i just tried again, same httpd, fresh modperl tree, vanilla perl 5.6.1, 
> same problem:
> /home/dougm/apache/farm/install/prefork-debug-shared-all-exp/bin/httpd  -d 
> /home/dougm/apache/mp-build/modperl-2.0/t -f 
> /home/dougm/apache/mp-build/modperl-2.0/t/conf/httpd.conf -DAPACHE2 
> using Apache/2.1.0-dev (prefork MPM)
> 
> waiting for server to start: .Syntax error on line 643 of 
> /home/dougm/apache/mp-build/modperl-2.0/t/conf/httpd.conf:
> mod_perl is already running, too late for PerlSwitches
> !!! 

My notebook has died and I can't reproduce it :( If that prevents from 
making the release can you please backout this commit and then will get 
back to it after the release. If there is no hurry, I'll look into when 
I revive the notebook :( Sorry about that.


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: why calling modperl_init_vhost after modperl_run?

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 18 Dec 2002, Stas Bekman wrote:
 
> the <Perl> and PerlLoadModule create a chicken and egg problem. May be 
> we should start mod_perl early then kill it, then start again normally?

i don't understand, can you explain more?
 
> > current cvs does not work for me, seems related to this area...
> 
> Because I've added an assert for something that wasn't caught before. 
> Please run t/TEST -conf and try again. If it doesn't work please post 
> your httpd.conf. Also make sure that Apache::Test is up-to-date

everything is up-to-date with a fresh tree.
i just tried again, same httpd, fresh modperl tree, vanilla perl 5.6.1, 
same problem:
/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/bin/httpd  -d 
/home/dougm/apache/mp-build/modperl-2.0/t -f 
/home/dougm/apache/mp-build/modperl-2.0/t/conf/httpd.conf -DAPACHE2 
using Apache/2.1.0-dev (prefork MPM)

waiting for server to start: .Syntax error on line 643 of 
/home/dougm/apache/mp-build/modperl-2.0/t/conf/httpd.conf:
mod_perl is already running, too late for PerlSwitches
!!! 
server has died with status 1 (t/logs/error_log wasn't created, start the 
server in the debug mode)
make: *** [run_tests] Error 143

% cat t/conf/httpd.conf
# WARNING: this file is generated, do not edit
# 01: /home/dougm/apache/mp-build/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfig.pm:696
# 02: /home/dougm/apache/mp-build/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfig.pm:713
# 03: /home/dougm/apache/mp-build/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfig.pm:1192
# 04: /home/dougm/apache/mp-build/modperl-2.0/t/../Apache-Test/lib/Apache/TestRun.pm:398
# 05: /home/dougm/apache/mp-build/modperl-2.0/t/../Apache-Test/lib/Apache/TestRunPerl.pm:32
# 06: /home/dougm/apache/mp-build/modperl-2.0/t/../Apache-Test/lib/Apache/TestRun.pm:569
# 07: /home/dougm/apache/mp-build/modperl-2.0/t/../Apache-Test/lib/Apache/TestRun.pm:569
# 08: t/TEST:19

LoadModule authn_file_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_authn_file.so"
LoadModule authn_dbm_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_authn_dbm.so"
LoadModule authn_anon_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_authn_anon.so"
LoadModule authn_default_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_authn_default.so"
LoadModule authz_host_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_authz_host.so"
LoadModule authz_groupfile_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_authz_groupfile.so"
LoadModule authz_user_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_authz_user.so"
LoadModule authz_dbm_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_authz_dbm.so"
LoadModule authz_default_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_authz_default.so"
LoadModule auth_basic_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_auth_basic.so"
LoadModule auth_digest_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_auth_digest.so"
LoadModule echo_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_echo.so"
LoadModule cache_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_cache.so"
LoadModule example_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_example.so"
LoadModule case_filter_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_case_filter.so"
LoadModule case_filter_in_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_case_filter_in.so"
LoadModule ext_filter_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_ext_filter.so"
LoadModule include_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_include.so"
LoadModule deflate_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_deflate.so"
LoadModule log_config_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_log_config.so"
LoadModule env_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_env.so"
LoadModule mime_magic_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_mime_magic.so"
LoadModule cern_meta_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_cern_meta.so"
LoadModule expires_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_expires.so"
LoadModule headers_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_headers.so"
LoadModule usertrack_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_usertrack.so"
LoadModule unique_id_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_unique_id.so"
LoadModule setenvif_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_setenvif.so"
LoadModule proxy_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_proxy.so"
LoadModule proxy_connect_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_proxy_connect.so"
LoadModule proxy_ftp_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_proxy_ftp.so"
LoadModule proxy_http_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_proxy_http.so"
LoadModule ssl_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_ssl.so"
LoadModule bucketeer_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_bucketeer.so"
LoadModule mime_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_mime.so"
LoadModule dav_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_dav.so"
LoadModule status_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_status.so"
LoadModule autoindex_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_autoindex.so"
LoadModule asis_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_asis.so"
LoadModule info_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_info.so"
LoadModule cgi_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_cgi.so"
LoadModule dav_fs_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_dav_fs.so"
LoadModule vhost_alias_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_vhost_alias.so"
LoadModule negotiation_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_negotiation.so"
LoadModule dir_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_dir.so"
LoadModule imap_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_imap.so"
LoadModule actions_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_actions.so"
LoadModule speling_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_speling.so"
LoadModule userdir_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_userdir.so"
LoadModule alias_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_alias.so"
LoadModule rewrite_module "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/modules/mod_rewrite.so"
<IfModule !mod_perl.c>
    LoadModule perl_module "/home/dougm/apache/mp-build/modperl-2.0/src/modules/perl/mod_perl.so"
</IfModule>


User    dougm
Group    dougm
ServerName localhost:8529
Listen     8529

ServerRoot   "/home/dougm/apache/mp-build/modperl-2.0/t"
DocumentRoot "/home/dougm/apache/mp-build/modperl-2.0/t/htdocs"

PidFile     /home/dougm/apache/mp-build/modperl-2.0/t/logs/httpd.pid
ErrorLog    /home/dougm/apache/mp-build/modperl-2.0/t/logs/error_log
LogLevel    debug
TransferLog /home/dougm/apache/mp-build/modperl-2.0/t/logs/access_log

ServerAdmin you@your.address

#needed for http/1.1 testing
KeepAlive       On

HostnameLookups Off

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<IfModule worker.c>
    StartServers         1
    MaxClients           1
    MinSpareThreads      1
    MaxSpareThreads      1
    ThreadsPerChild      1
    MaxRequestsPerChild  0
</IfModule>

<IfModule perchild.c>
    NumServers           1
    StartThreads         1
    MinSpareThreads      1
    MaxSpareThreads      1
    MaxThreadsPerChild   1
    MaxRequestsPerChild  0
</IfModule>

<IfModule prefork.c>
    StartServers         1
    MaxClients           1
    MaxRequestsPerChild  0
</IfModule>

<IfModule mpm_winnt.c>
    ThreadsPerChild      10
    MaxRequestsPerChild  0
</IfModule>

<Location /server-info>
    SetHandler server-info
</Location>

<Location /server-status>
    SetHandler server-status
</Location>

#so we can test downloading some files of various size
Alias /getfiles-perl-pod          /usr/lib/perl5/5.6.1/pod

#and some big ones
Alias /getfiles-binary-httpd      /home/dougm/apache/farm/install/prefork-debug-shared-all-exp/bin/httpd
Alias /getfiles-binary-perl       /usr/bin/perl

TypesConfig "/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/conf/mime.types"
Include "/home/dougm/apache/mp-build/modperl-2.0/t/conf/extra.conf" 
PerlSwitches -Mlib=/home/dougm/apache/mp-build/modperl-2.0/t
PerlRequire /home/dougm/apache/mp-build/modperl-2.0/t/conf/modperl_startup.pl
<Location /TestModules::cgiupload>
    PerlResponseHandler TestModules::cgiupload
    PerlOptions +GlobalRequest
    SetHandler perl-script
</Location>

<Location /TestModules::cgi>
    PerlResponseHandler TestModules::cgi
    SetHandler perl-script
</Location>

PerlSetVar TestModperl__request_rec_Key_set_in_Base BaseValue 
 
PerlSetVar TestModperl__server_rec_Key_set_in_Base 1_SetValue 
PerlAddVar TestModperl__server_rec_Key_set_in_Base 2_AddValue 3_AddValue 
<Location /TestModperl::dir_config>
    PerlSetVar TestModperl__request_rec_Key0 SetValue0
    PerlSetVar TestModperl__request_rec_Key1 ToBeLost
    PerlSetVar TestModperl__request_rec_Key1 1_SetValue
    PerlSetVar TestModperl__server_rec_Key_set_in_Base SubSecValue
    PerlResponseHandler TestModperl::dir_config
    SetHandler modperl
    PerlAddVar TestModperl__request_rec_Key1 2_AddValue
    PerlAddVar TestModperl__request_rec_Key1 3_AddValue 4_AddValue
</Location>

<Location /TestModperl::endav>
    PerlResponseHandler TestModperl::endav
    SetHandler perl-script
</Location>

<Location /TestModperl::env>
    PerlResponseHandler TestModperl::env
    SetHandler perl-script
</Location>

<Location /TestModperl::exit>
    PerlResponseHandler TestModperl::exit
    SetHandler modperl
</Location>

<Location /TestModperl::getc>
    PerlResponseHandler TestModperl::getc
    SetHandler modperl
</Location>

<Location /TestModperl::method>
    PerlResponseHandler TestModperl::method
    SetHandler modperl
</Location>

<Location /TestModperl::methodname>
    PerlResponseHandler TestModperl::methodname->response
    SetHandler modperl
</Location>

<Location /TestModperl::methodobj>
    PerlResponseHandler $TestModperl::MethodObj->handler
    SetHandler modperl
</Location>

<Location /TestModperl::pnotes>
    PerlResponseHandler TestModperl::pnotes
    SetHandler modperl
</Location>

<Location /TestModperl::print>
    PerlResponseHandler TestModperl::print
    SetHandler modperl
</Location>

<Location /TestModperl::printf>
    PerlResponseHandler TestModperl::printf
    SetHandler modperl
</Location>

<Location /TestModperl::readline>
    PerlResponseHandler TestModperl::readline
    SetHandler modperl
</Location>

<Location /TestModperl::sameinterp>
    PerlFixupHandler Apache::TestHandler::same_interp_fixup
    PerlResponseHandler TestModperl::sameinterp
    SetHandler modperl
</Location>

<Location /TestModperl::setauth>
    PerlResponseHandler TestModperl::setauth
    SetHandler modperl
</Location>

<Location /TestModperl::subenv>
    PerlResponseHandler TestModperl::subenv
    PerlOptions -SetupEnv
    SetHandler modperl
</Location>

<Location /TestDirective::perldo>
    PerlResponseHandler TestDirective::perldo
    SetHandler modperl
</Location>

PerlSetEnv TestDirective__env_srv1 env_srv1 
 
PerlSetEnv TestDirective__env_srv2 env_srv2 
 
PerlPassEnv APACHE_TEST_HOSTNAME 
<Location /TestDirective::env>
    PerlResponseHandler TestDirective::env
    PerlSetEnv TestDirective__env_srv1 env_dir1
    PerlSetEnv TestDirective__env_dir2 ToBeLost
    PerlSetEnv TestDirective__env_dir2 env_dir2
    PerlOptions +SetupEnv
    SetHandler modperl
</Location>

PerlInitHandler TestHooks::init::first 
<Location /TestHooks::init>
    PerlInitHandler TestHooks::init::second
    PerlResponseHandler TestHooks::init
    PerlResponseHandler TestHooks::init::response
    SetHandler modperl
</Location>

PerlTransHandler TestHooks::trans
<Location /TestHooks::trans>
    PerlResponseHandler Apache::TestHandler::ok1
    SetHandler modperl
</Location>

<Location /TestFilter::buckets>
    PerlResponseHandler TestFilter::buckets::response
    SetHandler modperl
    PerlOutputFilterHandler TestFilter::buckets
</Location>

<Location /TestFilter::api>
    PerlResponseHandler TestFilter::api::response
    SetHandler modperl
    PerlOutputFilterHandler TestFilter::api
</Location>

<Location /TestFilter::input_body>
    PerlResponseHandler TestFilter::input_body::response
    PerlInputFilterHandler TestFilter::input_body
    SetHandler modperl
</Location>

Listen 8530
<VirtualHost _default_:8530>
ServerName localhost:8530
 
  PerlInputFilterHandler TestFilter::input_msg 
 
  <Location /TestFilter::input_msg::response> 
     SetHandler modperl 
     PerlResponseHandler TestFilter::input_msg::response 
  </Location> 
 
</VirtualHost> 
<Location /TestFilter::input_msg>
    PerlInputFilterHandler TestFilter::input_msg
</Location>

<Location /top_dir>
  PerlOutputFilterHandler TestFilter::lc 
</Location> 
Alias /top_dir /home/dougm/apache/mp-build/modperl-2.0
<Location /TestFilter::lc>
    PerlOutputFilterHandler TestFilter::lc
</Location>

<LocationMatch "/filter/reverse.txt"> 
PerlOutputFilterHandler TestFilter::reverse 
</LocationMatch> 
<Location /TestFilter::reverse>
    PerlResponseHandler TestFilter::reverse::response
    SetHandler modperl
    PerlOutputFilterHandler TestFilter::reverse
</Location>

<Location /TestDirective::pod>
    PerlResponseHandler TestDirective::pod
    SetHandler modperl
</Location>

<Location /TestDirective::setupenv>
    PerlResponseHandler TestDirective::setupenv
    PerlOptions +SetupEnv
    SetHandler modperl
</Location>

<Location /TestCompat::apache>
    PerlResponseHandler TestCompat::apache
    SetHandler modperl
</Location>

<Location /TestCompat::apache_file>
    PerlResponseHandler TestCompat::apache_file
    PerlOptions +GlobalRequest
    SetHandler modperl
</Location>

<Location /TestCompat::apache_table>
    PerlResponseHandler TestCompat::apache_table
    SetHandler modperl
</Location>

<Location /TestCompat::apache_util>
    PerlResponseHandler TestCompat::apache_util
    PerlOptions +GlobalRequest
    SetHandler modperl
</Location>

<Location /TestCompat::request>
    PerlResponseHandler TestCompat::request
    SetHandler modperl
</Location>

<Location /TestCompat::request_body>
    PerlResponseHandler TestCompat::request_body
    PerlOptions +GlobalRequest
    SetHandler modperl
</Location>

<Location /TestCompat::send_fd>
    PerlResponseHandler TestCompat::send_fd
    SetHandler modperl
</Location>

<IfDefine PERL_ITHREADS>
    PerlInterpScope handler 
</IfDefine> 
<Location /TestApache::cgihandler>
    PerlResponseHandler TestApache::cgihandler
    SetHandler perl-script
</Location>

<Location /TestApache::conftree>
    PerlResponseHandler TestApache::conftree
    SetHandler modperl
</Location>

<Location /TestApache::post>
    PerlResponseHandler TestApache::post
    SetHandler modperl
</Location>

<Location /TestApache::read>
    PerlResponseHandler TestApache::read
    SetHandler modperl
</Location>

<Location /TestApache::scanhdrs>
    PerlResponseHandler TestApache::scanhdrs
    PerlOptions +ParseHeaders
    SetHandler perl-script
</Location>

<Location /TestApache::scanhdrs2>
    PerlResponseHandler TestApache::scanhdrs2
    PerlOptions +ParseHeaders
    SetHandler perl-script
</Location>

<Location /TestApache::subprocess>
    PerlResponseHandler TestApache::subprocess
    SetHandler modperl
</Location>

<Location /TestApache::write>
    PerlResponseHandler TestApache::write
    SetHandler modperl
</Location>

<Location /TestAPR::base64>
    PerlResponseHandler TestAPR::base64
    SetHandler modperl
</Location>

<Location /TestAPR::date>
    PerlResponseHandler TestAPR::date
    SetHandler modperl
</Location>

<Location /TestAPR::netlib>
    PerlResponseHandler TestAPR::netlib
    SetHandler modperl
</Location>

<Location /TestAPR::os>
    PerlResponseHandler TestAPR::os
    SetHandler modperl
</Location>

<Location /TestAPR::perlio>
    PerlResponseHandler TestAPR::perlio
    SetHandler modperl
</Location>

<Location /TestAPR::pool>
    PerlResponseHandler TestAPR::pool
    SetHandler modperl
</Location>

<Location /TestAPR::string>
    PerlResponseHandler TestAPR::string
    SetHandler modperl
</Location>

<Location /TestAPR::table>
    PerlResponseHandler TestAPR::table
    SetHandler modperl
</Location>

<Location /TestAPR::threadmutex>
    PerlResponseHandler TestAPR::threadmutex
    SetHandler modperl
</Location>

<Location /TestAPR::util>
    PerlResponseHandler TestAPR::util
    SetHandler modperl
</Location>

<Location /TestAPR::uuid>
    PerlResponseHandler TestAPR::uuid
    SetHandler modperl
</Location>

<Location /TestAPI::access>
    PerlResponseHandler TestAPI::access
    AuthType none
    Options None
    Options Indexes FollowSymLinks
    AuthName modperl
    SetHandler modperl
</Location>

<Location /TestAPI::aplog>
    PerlResponseHandler TestAPI::aplog
    SetHandler modperl
</Location>

<Location /TestAPI::conn_rec>
    PerlResponseHandler TestAPI::conn_rec
    SetHandler modperl
</Location>

<Location /lookup_uri>
   SetHandler modperl 
   PerlResponseHandler Apache::TestHandler::ok1 
</Location> 
<Location /TestAPI::lookup_uri>
    PerlResponseHandler TestAPI::lookup_uri
    SetHandler modperl
</Location>

<Location /TestAPI::lookup_uri2::myplan>
    SetHandler modperl 
    PerlResponseHandler TestAPI::lookup_uri2::myplan 
</Location> 
<Location /TestAPI::lookup_uri2::ok3>
    SetHandler modperl 
    PerlResponseHandler TestAPI::lookup_uri2::ok3 
</Location> 
<Location /TestAPI::lookup_uri2>
    PerlResponseHandler TestAPI::lookup_uri2
    SetHandler modperl
</Location>

<Location /TestAPI::module>
    PerlResponseHandler TestAPI::module
    SetHandler modperl
</Location>

<Location /TestAPI::r_subclass>
    PerlResponseHandler TestAPI::r_subclass
    PerlOptions -GlobalRequest
    SetHandler perl-script
</Location>

<Location /TestAPI::request_rec>
    PerlResponseHandler TestAPI::request_rec
    PerlOptions +GlobalRequest
    SetHandler modperl
</Location>

<Location /TestAPI::response>
    PerlResponseHandler TestAPI::response
    SetHandler modperl
</Location>

<Location /TestAPI::rutil>
    PerlResponseHandler TestAPI::rutil
    SetHandler modperl
</Location>

<Location /TestAPI::sendfile>
    PerlResponseHandler TestAPI::sendfile
    SetHandler modperl
</Location>

<Location /TestAPI::server_rec>
    PerlResponseHandler TestAPI::server_rec
    SetHandler modperl
</Location>

<Location /TestAPI::server_util>
    PerlResponseHandler TestAPI::server_util
    SetHandler modperl
</Location>

<Location /TestAPI::uri>
    PerlResponseHandler TestAPI::uri
    SetHandler modperl
</Location>

Listen 8531
<VirtualHost _default_:8531>
    PerlProcessConnectionHandler TestProtocol::eliza
</VirtualHost>

Listen 8532
<VirtualHost _default_:8532>
    PerlProcessConnectionHandler TestProtocol::echo
</VirtualHost>

Listen 8533
<VirtualHost _default_:8533>
    PerlProcessConnectionHandler TestProtocol::echo_filter
</VirtualHost>

<Location /TestHooks::access>
    PerlResponseHandler Apache::TestHandler::ok1
    PerlAccessHandler TestHooks::access
    SetHandler modperl
</Location>

<Location /TestHooks::authen>
    require valid-user
    PerlAuthenHandler TestHooks::authen
    PerlResponseHandler Apache::TestHandler::ok1
    AuthType Basic
    AuthName simple
    SetHandler modperl
</Location>

<Location /TestHooks::authz>
    require user dougm
    PerlAuthenHandler TestHooks::authz::auth_any
    PerlAuthzHandler TestHooks::authz
    PerlResponseHandler Apache::TestHandler::ok1
    AuthType Basic
    AuthName simple
    SetHandler modperl
</Location>

<Location /TestHooks::fixup>
    PerlFixupHandler TestHooks::fixup
    PerlResponseHandler TestHooks::fixup::response
    SetHandler modperl
</Location>

<Location /TestHooks::headerparser>
    PerlHeaderparserHandler TestHooks::headerparser
    PerlResponseHandler TestHooks::headerparser::response
    PerlOptions +SetupEnv
    SetHandler modperl
</Location>

# APACHE_TEST_CONFIG_ORDER 940 
PerlSwitches -I/home/dougm/apache/mp-build/modperl-2.0/t/htdocs/testdirective/perlmodule-vh 
Listen 8534
<VirtualHost _default_:8534>
ServerName localhost:8534
    PerlModule ApacheTest::PerlModuleTest 
 
    <Location /TestDirective::perlmodule> 
        SetHandler modperl 
        PerlResponseHandler TestDirective::perlmodule 
    </Location> 
 
</VirtualHost> 
<Location /TestDirective::perlmodule>
    PerlResponseHandler TestDirective::perlmodule
    SetHandler modperl
</Location>

# APACHE_TEST_CONFIG_ORDER 940 
PerlSwitches -I/home/dougm/apache/mp-build/modperl-2.0/t/htdocs/testdirective/main 
PerlRequire "ApacheTest/PerlRequireTest.pm" 
Listen 8535
<VirtualHost _default_:8535>
ServerName localhost:8535
 
    <IfDefine PERL_USEITHREADS> 
        # a new interpreter pool 
        PerlOptions +Parent 
    </IfDefine> 
 
    # use test system's @INC 
    PerlSwitches -I/home/dougm/apache/mp-build/modperl-2.0/t 
    PerlRequire "conf/modperl_startup.pl" 
 
    PerlSwitches -I/home/dougm/apache/mp-build/modperl-2.0/t/htdocs/testdirective/vh 
    PerlRequire "ApacheTest/PerlRequireTest.pm" 
 
    <Location /TestDirective::perlrequire> 
        SetHandler modperl 
        PerlResponseHandler TestDirective::perlrequire 
    </Location> 
 
</VirtualHost> 
<Location /TestDirective::perlrequire>
    PerlResponseHandler TestDirective::perlrequire
    SetHandler modperl
</Location>

# APACHE_TEST_CONFIG_ORDER 950 
PerlLoadModule TestDirective::perlloadmodule3 
MyPlus 5 
MyList     "MainServer" 
MyAppend   "MainServer" 
MyOverride "MainServer" 
Listen 8536
<VirtualHost _default_:8536>
ServerName localhost:8536
    MyPlus 2 
    MyList     "VHost" 
    MyAppend   "VHost" 
    MyOverride "VHost" 
    <Location /TestDirective::perlloadmodule3> 
        MyPlus 3 
        MyList     "Dir" 
        MyAppend   "Dir" 
        MyOverride "Dir" 
        SetHandler modperl 
        PerlResponseHandler TestDirective::perlloadmodule3 
    </Location> 
    <Location /TestDirective::perlloadmodule3/subdir> 
        MyPlus 1 
        MyList     "SubDir" 
        MyAppend   "SubDir" 
        MyOverride "SubDir" 
    </Location> 
</VirtualHost> 
<Location /TestDirective::perlloadmodule3>
    PerlResponseHandler TestDirective::perlloadmodule3
    SetHandler modperl
</Location>

# APACHE_TEST_CONFIG_ORDER 950 
PerlLoadModule TestDirective::perlloadmodule4 
Listen 8537
<VirtualHost _default_:8537>
ServerName localhost:8537
    # here perlloadmodule sets scfg on behalf of the base server 
    MyTest4 "Vhost" 
    <Location /TestDirective::perlloadmodule4> 
        MyTest4 "Dir" 
        SetHandler modperl 
        PerlResponseHandler TestDirective::perlloadmodule4 
    </Location> 
</VirtualHost> 
<Location /TestDirective::perlloadmodule4>
    PerlResponseHandler TestDirective::perlloadmodule4
    SetHandler modperl
</Location>

# APACHE_TEST_CONFIG_ORDER 950 
PerlLoadModule TestDirective::perlloadmodule5 
Listen 8538
<VirtualHost _default_:8538>
ServerName localhost:8538
    # here mod_perl sets the scfg by itself for this vhost 
    PerlModule CGI 
    MyTest5 "Vhost" 
    <Location /TestDirective::perlloadmodule5> 
        MyTest5 "Dir" 
        SetHandler modperl 
        PerlResponseHandler TestDirective::perlloadmodule5 
    </Location> 
</VirtualHost> 
<Location /TestDirective::perlloadmodule5>
    PerlResponseHandler TestDirective::perlloadmodule5
    SetHandler modperl
</Location>

# APACHE_TEST_CONFIG_ORDER 950 
PerlLoadModule TestDirective::perlloadmodule 
 
MyTest one two 
ServerTest per-server 
<Location /TestDirective::perlloadmodule>
    PerlResponseHandler TestDirective::perlloadmodule
    MyOtherTest value
    SetHandler modperl
</Location>

# APACHE_TEST_CONFIG_ORDER 950 
PerlLoadModule TestDirective::perlloadmodule2 
 
MyMergeTest one two 
<Location /TestDirective::perlloadmodule2>
    MyMergeTest three four 
</Location> 
<Location /TestDirective::perlloadmodule2/subdir>
   MyMergeTest five 
   MyMergeTest six 
</Location> 
<Location /TestDirective::perlloadmodule2>
    PerlResponseHandler TestDirective::perlloadmodule2
    SetHandler modperl
</Location>

# XXX: we want to have this configuration section to come first 
# amongst other perlloadmodule tests (<950), so we can test how 
# mod_perl starts from vhost. but currently we can't because 
# PerlSwitches from other tests are ignored, so the test suite fails 
# to startup. 
# 
# tmp solution: ensure that it's configured *after* all other 
# perlloadmodule tests 
# 
# APACHE_TEST_CONFIG_ORDER 951 
Listen 8539
<VirtualHost _default_:8539>
ServerName localhost:8539
    PerlLoadModule TestDirective::perlloadmodule6 
    MyTest6 "Vhost" 
    <Location /TestDirective::perlloadmodule6> 
        MyTest6 "Dir" 
        SetHandler modperl 
        PerlResponseHandler TestDirective::perlloadmodule6 
    </Location> 
</VirtualHost> 
<Location /TestDirective::perlloadmodule6>
    PerlResponseHandler TestDirective::perlloadmodule6
    SetHandler modperl
</Location>


Include "/home/dougm/apache/mp-build/modperl-2.0/t/conf/extra.last.conf"


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: why calling modperl_init_vhost after modperl_run?

Posted by Stas Bekman <st...@stason.org>.
Doug MacEachern wrote:
> On Fri, 13 Dec 2002, Stas Bekman wrote:
> 
> 
>>Any special reason for calling modperl_init_vhost() after modperl_run() which
>>already does that? This is in the 'perldo' command callback.
> 
> 
> yes, because a <Perl> section or PerlLoadModule may have already triggered 
> modperl_run, in which case modperl_run is a noop.

ai, this early startup drives me crazy.

>  and yes, the startup 
> stuff is ugly, only because of early bootstrap required by <Perl> or 
> PerlLoadModule.  if you have ideas on howto fix that, great.

the <Perl> and PerlLoadModule create a chicken and egg problem. May be 
we should start mod_perl early then kill it, then start again normally?

> current cvs does not work for me, seems related to this area...

Because I've added an assert for something that wasn't caught before. 
Please run t/TEST -conf and try again. If it doesn't work please post 
your httpd.conf. Also make sure that Apache::Test is up-to-date


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: why calling modperl_init_vhost after modperl_run?

Posted by Doug MacEachern <do...@covalent.net>.
On Fri, 13 Dec 2002, Stas Bekman wrote:

> Any special reason for calling modperl_init_vhost() after modperl_run() which
> already does that? This is in the 'perldo' command callback.

yes, because a <Perl> section or PerlLoadModule may have already triggered 
modperl_run, in which case modperl_run is a noop.  and yes, the startup 
stuff is ugly, only because of early bootstrap required by <Perl> or 
PerlLoadModule.  if you have ideas on howto fix that, great.

current cvs does not work for me, seems related to this area...


-------------8<---------- Start Bug Report ------------8<----------
1. Problem Description:

% t/TEST      
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST 
/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/bin/httpd  -d /home/dougm/apache/modperl-2.0/t -f /home/dougm/apache/modperl-2.0/t/conf/httpd.conf -DAPACHE2 
using Apache/2.1.0-dev (prefork MPM)

waiting for server to start: .Syntax error on line 635 of /home/dougm/apache/modperl-2.0/t/conf/httpd.conf:
mod_perl is already running, too late for PerlSwitches
!!! 
server has died with status 255 (t/logs/error_log wasn't created, start the server in the debug mode)


2. Used Components and their Configuration:

*** using lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_AP_PREFIX    => /home/dougm/apache/farm/install/prefork-debug-shared-all-exp
  MP_CCOPTS       => -Wall -Werror
  MP_DEBUG        => 1
  MP_GENERATE_XS  => 1
  MP_INST_APACHE2 => 1 1
  MP_LIBNAME      => mod_perl
  MP_MAINTAINER   => 1
  MP_OPTIONS_FILE => ../.makepl_args.mod_perl2
  MP_TRACE        => 1
  MP_USE_DSO      => 1
  MP_USE_STATIC   => 1


*** /home/dougm/apache/farm/install/prefork-debug-shared-all-exp/bin/httpd -V
Server version: Apache/2.1.0-dev
Server built:   Dec 17 2002 11:03:23
Server's Module Magic Number: 20020903:0
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/home/dougm/apache/farm/install/prefork-debug-shared-all-exp"
 -D SUEXEC_BIN="/home/dougm/apache/farm/install/prefork-debug-shared-all-exp/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"


*** /home/dougm/perl/farm/install/perl-5.8.0-debug/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.4.7-10, archname=i686-linux
    uname='linux mako.covalent.net 2.4.7-10 #1 thu sep 6 17:27:27 edt 2001 i686 unknown '
    config_args='-des -Dcc=gcc -Doptimize=-g -Dprefix=/home/dougm/perl/farm/install/perl-5.8.0-debug'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-g',
    cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
    ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.1 2.96-98)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.2.4.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.2.4'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: DEBUGGING USE_LARGE_FILES
  Built under linux
  Compiled at Sep  6 2002 09:42:32
  %ENV:
    PERL_LWP_USE_HTTP_10="1"
  @INC:
    /home/dougm/perl/farm/install/perl-5.8.0-debug/lib/5.8.0/i686-linux
    /home/dougm/perl/farm/install/perl-5.8.0-debug/lib/5.8.0
    /home/dougm/perl/farm/install/perl-5.8.0-debug/lib/site_perl/5.8.0/i686-linux
    /home/dougm/perl/farm/install/perl-5.8.0-debug/lib/site_perl/5.8.0
    /home/dougm/perl/farm/install/perl-5.8.0-debug/lib/site_perl
    .


3. This is the core dump trace: (if you get a core dump):

  [CORE TRACE COMES HERE]

This report was generated by t/REPORT on Tue Dec 17 19:44:03 2002 GMT.

-------------8<---------- End Bug Report --------------8<----------

Note: Complete the rest of the details and post this bug report to
dev <at> perl.apache.org. To subscribe to the list send an empty
email to dev-subscribe@perl.apache.org.




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org