Apache, mod_perl
I have mod_perl and apache on NT. I want to add mod_perl as a module to apache, I built mod_perl and got mod_perl.so. I have copied it to the modules directory in apache source tree. When I start apache, it says : Syntax error on line 1049 of e:/apache/conf/httpd.conf: Cannot load e:/apache/modules/mod_perl.so into server: (126) The specified module could not be found: BUT the module mod_perl.so IS PRESENT IN THE above mentined path. This is line 1049 in e:/apache/conf/httpd.conf: LoadModule perl_module modules/mod_perl.so Could anyone help, thanks
Re: Apache, mod_perl
This message has confused many people including me. It usually means that the mod_perl binary is incompatible with your version of Apache. Most people compile the whole lot together. Randy Kobes has kindly compiled mod_perl binaries for recent Apache versions at ftp://theoryx5.uwinnipeg.ca/pub/other/ppd/x86/ You can download the version of mod_perl that matches your version of Apache and unzip it into the Apache module library. You can then look at the compile options. regards, Rod === This email message may contain the Ebola virus. The sender is not responsible for any death, destruction, reflux or tinitis that may result from reading this message. The sender's lawyer forces him to write this crap. - Original Message - From: H Jayakumar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 4:38 PM Subject: Apache, mod_perl I have mod_perl and apache on NT. I want to add mod_perl as a module to apache, I built mod_perl and got mod_perl.so. I have copied it to the modules directory in apache source tree. When I start apache, it says : Syntax error on line 1049 of e:/apache/conf/httpd.conf: Cannot load e:/apache/modules/mod_perl.so into server: (126) The specified module could not be found: BUT the module mod_perl.so IS PRESENT IN THE above mentined path. This is line 1049 in e:/apache/conf/httpd.conf: LoadModule perl_module modules/mod_perl.so Could anyone help, thanks
RE: Authen question
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 28, 2001 2:25 PM To: [EMAIL PROTECTED] Subject: Authen question Hello I want to know if there is a way to show a page or another to some users depending in their logins. I have two users poiting to the same URL. But I dont want userA to see page B, and I dont want userB to see pageA. read up on the PerlAuthzHandler in the eagle book... --Geoff
Re: Apache, mod_perl
On Wed, 29 Aug 2001, H Jayakumar wrote: I have mod_perl and apache on NT. I want to add mod_perl as a module to apache, I built mod_perl and got mod_perl.so. I have copied it to the modules directory in apache source tree. When I start apache, it says : Syntax error on line 1049 of e:/apache/conf/httpd.conf: Cannot load e:/apache/modules/mod_perl.so into server: (126) The specified module could not be found: BUT the module mod_perl.so IS PRESENT IN THE above mentined path. This is line 1049 in e:/apache/conf/httpd.conf: LoadModule perl_module modules/mod_perl.so As well as what Rod says in another reply about this message arising from incompatible Apache/mod_perl versions, this can also be caused from not having the perl executable in your PATH environment variable when starting Apache. best regards, randy kobes
$r-args()
Hello, I already have asked this question and got an answer for it, so please accept my forwarded apologies. However, I was trying something else and got stuck. I know in order to pass around query string, or form data, pnotes may be used. However, I am trying something else and it does not seem to work! . . . $r = Apache::Request-new($r); # check for some condition if ($condition) { my $previous_uri= $r-param('previous_uri'); my $content = $r-param(); $r-method_number(M_GET); $r-method('GET'); $r-headers_in-unset(Content-length); $r-args($content); $r-internal_redirect($previous_uri); } . . . However, in my called handler, no Post data can be read. Can any one tell me why is that? Any comments welcomed... Thanks -r
$r-args()
Hello, I already have asked this question and got an answer for it, so please accept my forwarded apologies. However, I was trying something else and got stuck. I know in order to pass around query string, or form data, pnotes may be used. However, I am trying something else and it does not seem to work! . . . $r = Apache::Request-new($r); # check for some condition if ($condition) { my $previous_uri= $r-param('previous_uri'); my $content = $r-param(); $r-method_number(M_GET); $r-method('GET'); $r-headers_in-unset(Content-length); $r-args($content); $r-internal_redirect($previous_uri); } . . . However, in my called handler, no Post data can be read. Can any one tell me why is that? Any comments welcomed... Thanks -r
Re: $r-args()
At 9:36 AM -0700 8/29/01, Rasoul Hajikhani wrote: Hello, I already have asked this question and got an answer for it, so please accept my forwarded apologies. However, I was trying something else and got stuck. I know in order to pass around query string, or form data, pnotes may be used. However, I am trying something else and it does not seem to work! $r = Apache::Request-new($r); # check for some condition if ($condition) { my $previous_uri= $r-param('previous_uri'); my $content = $r-param(); $r-method_number(M_GET); $r-method('GET'); $r-headers_in-unset(Content-length); $r-args($content); $r-internal_redirect($previous_uri); } So your goal is to turn a post request into a get request using an internal redirect. However, in my called handler, no Post data can be read. Can any one tell me why is that? Any comments welcomed... param does not work like args, and $content in this example will return the number of param keys (IIRC). I think you want my $content = join('',map{$_.=.$r-param($_)}($r-param)); Which should solve your problems (I think). Rob -- A good magician never reveals his secret; the unbelievable trick becomes simple and obvious once it is explained. So too with UNIX.
Re: $r-args()
Robert Landrum wrote: At 9:36 AM -0700 8/29/01, Rasoul Hajikhani wrote: Hello, I already have asked this question and got an answer for it, so please accept my forwarded apologies. However, I was trying something else and got stuck. I know in order to pass around query string, or form data, pnotes may be used. However, I am trying something else and it does not seem to work! $r = Apache::Request-new($r); # check for some condition if ($condition) { my $previous_uri= $r-param('previous_uri'); my $content = $r-param(); $r-method_number(M_GET); $r-method('GET'); $r-headers_in-unset(Content-length); $r-args($content); $r-internal_redirect($previous_uri); } So your goal is to turn a post request into a get request using an internal redirect. However, in my called handler, no Post data can be read. Can any one tell me why is that? Any comments welcomed... param does not work like args, and $content in this example will return the number of param keys (IIRC). I think you want my $content = join('',map{$_.=.$r-param($_)}($r-param)); Which should solve your problems (I think). I am affraid it did not work. I have no problem reading the data in the current handler, but right after redirect, which is also required to read the data, I loose all the POSTED data. Rob -- A good magician never reveals his secret; the unbelievable trick becomes simple and obvious once it is explained. So too with UNIX.
Re: $r-args()
Which should solve your problems (I think). I am affraid it did not work. I have no problem reading the data in the current handler, but right after redirect, which is also required to read the data, I loose all the POSTED data. Performing a redirect causes posted data to be discarded. Your goal should be to convert all of your posted data so that it can be passed via GET. Rob -- A good magician never reveals his secret; the unbelievable trick becomes simple and obvious once it is explained. So too with UNIX.
Re: $r-args()
Once you change the method to GET and put the content in with $r-args();, it becomes GET data from the query_string. All the POST data is lost when you call content(), so you can no longer read it as POST data with $r-content() again. Brian Nilsen [EMAIL PROTECTED] On Wed, 29 Aug 2001, Rasoul Hajikhani wrote: Robert Landrum wrote: At 9:36 AM -0700 8/29/01, Rasoul Hajikhani wrote: Hello, I already have asked this question and got an answer for it, so please accept my forwarded apologies. However, I was trying something else and got stuck. I know in order to pass around query string, or form data, pnotes may be used. However, I am trying something else and it does not seem to work! $r = Apache::Request-new($r); # check for some condition if ($condition) { my $previous_uri= $r-param('previous_uri'); my $content = $r-param(); $r-method_number(M_GET); $r-method('GET'); $r-headers_in-unset(Content-length); $r-args($content); $r-internal_redirect($previous_uri); } So your goal is to turn a post request into a get request using an internal redirect. However, in my called handler, no Post data can be read. Can any one tell me why is that? Any comments welcomed... param does not work like args, and $content in this example will return the number of param keys (IIRC). I think you want my $content = join('',map{$_.=.$r-param($_)}($r-param)); Which should solve your problems (I think). I am affraid it did not work. I have no problem reading the data in the current handler, but right after redirect, which is also required to read the data, I loose all the POSTED data. Rob -- A good magician never reveals his secret; the unbelievable trick becomes simple and obvious once it is explained. So too with UNIX.
Re: $r-args()
Robert Landrum wrote: Which should solve your problems (I think). I am affraid it did not work. I have no problem reading the data in the current handler, but right after redirect, which is also required to read the data, I loose all the POSTED data. Performing a redirect causes posted data to be discarded. Did not find that in docs! maybe should pay more attention :( Your goal should be to convert ?? You lost me there... convert? convert to what? all of your posted data so that it can be passed via GET. Would it make any diference if the method, and method_number remained POST? Does this situation occure as a result of method conversion? (I will try that)... -r PS: Something wrong with the mail server? Rob -- A good magician never reveals his secret; the unbelievable trick becomes simple and obvious once it is explained. So too with UNIX.
Re: $r-args()
At 11:19 AM -0700 8/29/01, Rasoul Hajikhani wrote: Robert Landrum wrote: Which should solve your problems (I think). I am affraid it did not work. I have no problem reading the data in the current handler, but right after redirect, which is also required to read the data, I loose all the POSTED data. Performing a redirect causes posted data to be discarded. Did not find that in docs! maybe should pay more attention :( I'm sure it's in the docs somewhere, but personal experience and previous posts to this list have addressed this issue. Your goal should be to convert ?? You lost me there... convert? convert to what? Convert as in from POST request to GET request. sub escaped { my $val = shift; $val =~ s/(\W)/sprintf(%%%.2X,ord($1))/g; return $val; } my $content = join('',map{$_.=.escaped($r-param($_))}($r-param)); my $internal_url = /some/path/to/handler?$content; $r-internal_redirect($internal_url); all of your posted data so that it can be passed via GET. Would it make any diference if the method, and method_number remained POST? Does this situation occure as a result of method conversion? (I will try that)... Unlikely. -r PS: Something wrong with the mail server? Uhh... Why? Rob -- A good magician never reveals his secret; the unbelievable trick becomes simple and obvious once it is explained. So too with UNIX.
Re: $r-args()
[EMAIL PROTECTED] (Rasoul Hajikhani) wrote: Robert Landrum wrote: Which should solve your problems (I think). I am affraid it did not work. I have no problem reading the data in the current handler, but right after redirect, which is also required to read the data, I loose all the POSTED data. Performing a redirect causes posted data to be discarded. Did not find that in docs! maybe should pay more attention :( You'll find the relevant material in the HTTP/1.1 docs: http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc2068.html ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Re: $r-args()
Robert Landrum wrote: At 11:19 AM -0700 8/29/01, Rasoul Hajikhani wrote: Robert Landrum wrote: Which should solve your problems (I think). I am affraid it did not work. I have no problem reading the data in the current handler, but right after redirect, which is also required to read the data, I loose all the POSTED data. Performing a redirect causes posted data to be discarded. Did not find that in docs! maybe should pay more attention :( I'm sure it's in the docs somewhere, but personal experience and previous posts to this list have addressed this issue. Your goal should be to convert ?? You lost me there... convert? convert to what? Convert as in from POST request to GET request. sub escaped { my $val = shift; $val =~ s/(\W)/sprintf(%%%.2X,ord($1))/g; return $val; } my $content = join('',map{$_.=.escaped($r-param($_))}($r-param)); my $internal_url = /some/path/to/handler?$content; $r-internal_redirect($internal_url); all of your posted data so that it can be passed via GET. Would it make any diference if the method, and method_number remained POST? Does this situation occure as a result of method conversion? (I will try that)... Unlikely. -r PS: Something wrong with the mail server? Uhh... Why? Rob -- A good magician never reveals his secret; the unbelievable trick becomes simple and obvious once it is explained. So too with UNIX. Thanks... It now works... -r
Re: is postreadrequest too late to determine name vhost?
TE == Thomas Eibner [EMAIL PROTECTED] writes: TE It seems that everything concerning vhosts is set up in http_protocal.c TE and that the vhost is set right after Apache has read the request from TE the client and then calling ap_update_vhost_from_headers to actually TE determine the vhost. All this happens before your module gets to run. Thanks for the info. I realized just now (about a minute ago) that localhost.mailermailer.com and localhost.m1e.net are different names that point to 127.0.0.1, so the proxy front-end can do it using the domain names, and the back-end can distinguish the names just fine. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
Re: is postreadrequest too late to determine name vhost?
On Wed, Aug 29, 2001 at 02:44:48PM -0400, Vivek Khera wrote: TE == Thomas Eibner [EMAIL PROTECTED] writes: TE It seems that everything concerning vhosts is set up in http_protocal.c TE and that the vhost is set right after Apache has read the request from TE the client and then calling ap_update_vhost_from_headers to actually TE determine the vhost. All this happens before your module gets to run. Thanks for the info. I realized just now (about a minute ago) that localhost.mailermailer.com and localhost.m1e.net are different names that point to 127.0.0.1, so the proxy front-end can do it using the domain names, and the back-end can distinguish the names just fine. I have a reverse-mpaf almost working with this now, so that it works without using the localhost.hostname.com.. -- Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/ mod_pointer http://stderr.net/mod_pointer
is postreadrequest too late to determine name vhost?
I've got the classic lightweight front end proxying to the mod_perl heavyweight backend. I use proxy_add_forward on the front end and the PerlPostReadRequest handler to set $r-hostname and $r-remote_ip. This all works excellently. My question, however, is this too late for the name-based virtual hosts to trigger? In my mod_perl app, I need to trigger different things based on the virtual site. What I want to do is this: VirtualHost localhost ServerName www.mailermailer.com PerlSetVar SiteID 7 PerlSetVar SiteName www.mailermailer.com /VirtualHost VirtualHost localhost ServerName m1e.net PerlSetVar SiteID 1 PerlSetVar SiteName m1e.net /VirtualHost in the backend. However, it seems that it always picks up the first virtual host defined this way, regardless of what the post read request handler sets $r-hostname to. Is there some other trick I should try? I'm working from home today and don't have my Eagle book handy... If I can't get it to work with name virtual hosts, I'll have to go to port-based virtual hosts, which I'd prefer to avoid since I expect to have several hundred of these eventually. Thanks. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
Re: is postreadrequest too late to determine name vhost?
On Wed, Aug 29, 2001 at 01:31:54PM -0400, Vivek Khera wrote: I've got the classic lightweight front end proxying to the mod_perl heavyweight backend. I use proxy_add_forward on the front end and the PerlPostReadRequest handler to set $r-hostname and $r-remote_ip. This all works excellently. My question, however, is this too late for the name-based virtual hosts to trigger? In my mod_perl app, I need to trigger different things based on the virtual site. What I want to do is this: VirtualHost localhost ServerName www.mailermailer.com PerlSetVar SiteID 7 PerlSetVar SiteName www.mailermailer.com /VirtualHost VirtualHost localhost ServerName m1e.net PerlSetVar SiteID 1 PerlSetVar SiteName m1e.net /VirtualHost in the backend. However, it seems that it always picks up the first virtual host defined this way, regardless of what the post read request handler sets $r-hostname to. Is there some other trick I should try? I'm working from home today and don't have my Eagle book handy... If I can't get it to work with name virtual hosts, I'll have to go to port-based virtual hosts, which I'd prefer to avoid since I expect to have several hundred of these eventually. It seems that everything concerning vhosts is set up in http_protocal.c and that the vhost is set right after Apache has read the request from the client and then calling ap_update_vhost_from_headers to actually determine the vhost. All this happens before your module gets to run. It might be possible to create a C module that sets the Host: header like you want it to be and then call ap_update_vhost_from_headers. -- Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/ mod_pointer http://stderr.net/mod_pointer
cvs commit: modperl-2.0/t/hooks/TestHooks trans.pm
dougm 01/08/29 18:05:41 Modified:t/hooks/TestHooks trans.pm Log: current httpd-2.0 requires trans handlers to either set r-filename or implement a map_to_storage hook Revision ChangesPath 1.2 +3 -1 modperl-2.0/t/hooks/TestHooks/trans.pm Index: trans.pm === RCS file: /home/cvs/modperl-2.0/t/hooks/TestHooks/trans.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- trans.pm 2001/04/13 02:05:58 1.1 +++ trans.pm 2001/08/30 01:05:41 1.2 @@ -10,7 +10,9 @@ Apache::OK; }, '/phooey' = sub { -shift-uri('/TestHooks::trans'); +my $r = shift; +$r-filename(__FILE__); #filename is currently required +$r-uri('/TestHooks::trans'); Apache::OK; }, );
cvs commit: modperl-2.0/xs/Apache/Filter Apache__Filter.h
dougm 01/08/29 18:08:24 Modified:src/modules/perl modperl_filter.c xs/Apache/Filter Apache__Filter.h Log: flush output filter buffer after filter has run rather than after each filter-print Revision ChangesPath 1.24 +10 -2 modperl-2.0/src/modules/perl/modperl_filter.c Index: modperl_filter.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- modperl_filter.c 2001/08/09 16:52:51 1.23 +++ modperl_filter.c 2001/08/30 01:08:24 1.24 @@ -32,6 +32,8 @@ bucket = apr_bucket_transient_create(buf, len); APR_BRIGADE_INSERT_TAIL(bb, bucket); +MP_TRACE_f(MP_FUNC, buffer length=%d\n, len); + return ap_pass_brigade(wb-filters, bb); } @@ -146,6 +148,10 @@ MP_TRACE_f(MP_FUNC, %s returned %d\n, handler-name, status); +if (filter-mode == MP_OUTPUT_FILTER_MODE) { +modperl_output_filter_flush(filter); +} + return status; } @@ -335,8 +341,10 @@ filter-eos ? EOS : FLUSH); filter-rc = filter-eos ? send_eos(filter-f) : send_flush(filter-f); -apr_brigade_destroy(filter-bb); -filter-bb = NULL; +if (filter-bb) { +apr_brigade_destroy(filter-bb); +filter-bb = NULL; +} filter-flush = filter-eos = 0; } 1.14 +0 -1 modperl-2.0/xs/Apache/Filter/Apache__Filter.h Index: Apache__Filter.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/Filter/Apache__Filter.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Apache__Filter.h 2001/08/09 16:52:51 1.13 +++ Apache__Filter.h 2001/08/30 01:08:24 1.14 @@ -21,7 +21,6 @@ if (modperl_filter-mode == MP_OUTPUT_FILTER_MODE) { mpxs_write_loop(modperl_output_filter_write, modperl_filter); -modperl_output_filter_flush(modperl_filter); } else { croak(input filters not yet supported);
cvs commit: modperl-2.0/src/modules/perl mod_perl.c modperl_filter.c modperl_types.h
dougm 01/08/29 22:15:51 Modified:src/modules/perl mod_perl.c modperl_filter.c modperl_types.h Log: change wbucket buffer api to use the address of r-output_filters so when a filter is removed from the chain, its is also remove from ours Revision ChangesPath 1.63 +1 -1 modperl-2.0/src/modules/perl/mod_perl.c Index: mod_perl.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- mod_perl.c2001/08/08 16:20:31 1.62 +++ mod_perl.c2001/08/30 05:15:51 1.63 @@ -399,7 +399,7 @@ /* setup buffer for output */ rcfg-wbucket.pool = r-pool; -rcfg-wbucket.filters = r-output_filters; +rcfg-wbucket.filters = r-output_filters; rcfg-wbucket.outcnt = 0; } 1.25 +2 -2 modperl-2.0/src/modules/perl/modperl_filter.c Index: modperl_filter.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- modperl_filter.c 2001/08/30 01:08:24 1.24 +++ modperl_filter.c 2001/08/30 05:15:51 1.25 @@ -34,7 +34,7 @@ MP_TRACE_f(MP_FUNC, buffer length=%d\n, len); -return ap_pass_brigade(wb-filters, bb); +return ap_pass_brigade(*(wb-filters), bb); } MP_INLINE apr_status_t modperl_wbucket_flush(modperl_wbucket_t *wb) @@ -91,7 +91,7 @@ filter-bb = bb; filter-pool = p; filter-wbucket.pool = p; -filter-wbucket.filters = f-next; +filter-wbucket.filters = f-next; filter-wbucket.outcnt = 0; MP_TRACE_f(MP_FUNC, filter=0x%lx, mode=%s\n, 1.46 +1 -1 modperl-2.0/src/modules/perl/modperl_types.h Index: modperl_types.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_types.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- modperl_types.h 2001/08/19 17:33:32 1.45 +++ modperl_types.h 2001/08/30 05:15:51 1.46 @@ -168,7 +168,7 @@ int outcnt; char outbuf[MP_IOBUFSIZE]; apr_pool_t *pool; -ap_filter_t *filters; +ap_filter_t **filters; int header_parse; request_rec *r; } modperl_wbucket_t;