cvs commit: modperl-2.0 Changes
stas2003/02/12 15:42:23 Modified:lib/Apache compat.pm .Changes Added: t/compat conn_authen.t t/response/TestCompat conn_authen.pm Log: Add Apache::compat methods: $r-connection-auth_type and $r-connection-user (requires 'PerlOptions +GlobalRequest') + tests Revision ChangesPath 1.1 modperl-2.0/t/compat/conn_authen.t Index: conn_authen.t === use strict; use warnings FATAL = 'all'; use Apache::Test; use Apache::TestRequest; plan tests = 1, \have_lwp; my $location = /TestCompat::conn_authen; ok GET_OK $location, username = 'dougm', password = 'foo'; 1.1 modperl-2.0/t/response/TestCompat/conn_authen.pm Index: conn_authen.pm === package TestCompat::conn_authen; # simply check that we can retrieve: # $r-connection-auth_type # $r-connection-user # both records don't exist in 2.0 conn_rec and therefore require # 'PerlOptions +GlobalRequest' to retrieve those via Apache-request use strict; use warnings FATAL = 'all'; use Apache::TestUtil; use Apache::Test; use Apache::compat (); use Apache::Constants qw(OK REMOTE_HOST); sub handler { my $r = shift; my($rc, $sent_pw) = $r-get_basic_auth_pw; return $rc if $rc != Apache::OK; my $auth_type = $r-connection-auth_type || ''; die auth_type is '$auth_type', should be 'Basic' unless $auth_type eq 'Basic'; my $user = $r-connection-user || ''; die user is '$user', while expecting 'dougm' unless $user eq 'dougm'; OK; } 1; __DATA__ require valid-user AuthType Basic AuthName simple SetHandler modperl PerlOptions +GlobalRequest PerlAuthenHandler TestCompat::conn_authen PerlResponseHandler Apache::TestHandler::ok1 1.77 +7 -0 modperl-2.0/lib/Apache/compat.pm Index: compat.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- compat.pm 31 Jan 2003 04:37:06 - 1.76 +++ compat.pm 12 Feb 2003 23:42:23 - 1.77 @@ -530,5 +530,12 @@ return Apache::DECLINED; } +package Apache::Connection; + +# auth_type and user records don't exist in 2.0 conn_rec struct +# 'PerlOptions +GlobalRequest' is required +sub auth_type { Apache-request-auth_type } +sub user { Apache-request-user } + 1; __END__ 1.124 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.123 retrieving revision 1.124 diff -u -r1.123 -r1.124 --- Changes 7 Feb 2003 02:58:30 - 1.123 +++ Changes 12 Feb 2003 23:42:23 - 1.124 @@ -10,6 +10,10 @@ =item 1.99_09-dev +Add Apache::compat methods: $r-connection-auth_type and +$r-connection-user (requires 'PerlOptions +GlobalRequest') + tests +[Stas] + Several issues resolved with parsing headers, including making work the handlers calling $r-content_type() and not sending raw headers, when the headers scanning is turned on. Lots of tests added to
Re: Simultaneous GET and POST data
Stathy Touloumis wrote: Has anyone experienced issues with retrieving data when POSTed by a form whith an action parameter that has a query string attached to it? On rare occasion it seems that the posted data is not available. I recently changed form handling and got bitten by query strings. My previous code used CGI.pm to parse the arguments (but not to run my scripts). When I changed to use Apache::Request to parse the arguments I found that I was seeing both the query string arguments and the posted argumnets. Using Apache::Request I believe I reliably see all of the query string and posted arguments. I have Apache 1.3.26 / mod_perl 1.27 / Apache::Registry from CPAN version 2.01. My C compiler is gcc 2.96 I have libapreq version 1.1 (needed for Apache::Request) Rob Lambden
source code appears as text listing in browser
I tried to follow instruction in mod_perl developer's cookbook to move exitings CGI script to mod_perl. What happens is that the browser lists the source code of my CGI scripts, instead of excuting them, when I create a special mod_perl directory with this configuration. PerlModule Apache::PerlRun Alias /perl/ /www/atl/cm/ PerlTaintCheck on PerlSetVar Debug 1 Location /perl SetHandler perl-script PerlHandler Apache::PerlRun Options +ExecCGI PerlSendHeader On Order deny,allow Allow from all /Location The same scripts in the cgi directory do fine, as they always have, when I run them as regular cgi scripts. I am using Apache 1.3.27 on HPUX, with mod_perl 1.27 What might I be doing wrong?
Re: source code appears as text listing in browser
[snip] The same scripts in the cgi directory do fine, as they always have, when I run them as regular cgi scripts. I am using Apache 1.3.27 on HPUX, with mod_perl 1.27 What might I be doing wrong? I've never used Apache::PerlRun to run old CGI scripts, always used Apache::Registry so this might work for you - YMMV Alias /cgi-perl /home/whatever/cgi-bin Location /cgi-perl SetHandler perl-script PerlHandler Apache::Registry /Location Then call scripts as /cgi-perl/yourscript.cgi instead of /cgi-bin/yourscript.cgi As I said, your mileage may vary - I've always had good success with it, but a script that's not so nicely written can (and probably will) suck up memory or cause other interesting problems. -- Bernhard van Staveren - madcat(at)ghostfield.com GhostField Internet - http://www.ghostfield.com/ A witty saying proves nothing, but damn it's funny! - me, 1998
Server returns nothing
Hello, I have a mod_perl + Template-Toolkit driven web-site with some 20+ perl modules. Apache is 1.3.26, mod_perl is 1.26 and TT is 2.08. Problem is, sometimes happens that I get absolutely no response from server, browser just says that 'Document contains no data' and even server accesslog doesn't show anything. All requests go to some kind of black hole. I can get rid of it, by not using one module. And interesting thing is that when I start to use it again, server responds normally. I've checked this module as much as I could, but to me it seems like every other normal module. I have no idea what could cause this. I used diagnostics and warnings and got rid of all warnings. If I used diagnostics first and it showed some warnings, then I saw that server tried to show (compile, however you should say that) this page for serveral times (maybe browser tried to fetch it many times...). And all I saw was just errors from diagnostics, all loggings messages I have in code were ignores. Has anyone seen something like this before and can direct me on this debugging task? What should I try next? There are no syntactical errors, only logical, seems to me. Thanks in advance, Viljo
Re: source code appears as text listing in browser
Alois Treindl wrote: I tried to follow instruction in mod_perl developer's cookbook to move exitings CGI script to mod_perl. What happens is that the browser lists the source code of my CGI scripts, instead of excuting them, what this means is that the normal Apache handler that sends static content (such as .html files and images) is serving your pages instead of mod_perl - a typical problem that usually just boils down to a misconfiguration. when I create a special mod_perl directory with this configuration. PerlModule Apache::PerlRun Alias /perl/ /www/atl/cm/ PerlTaintCheck on PerlSetVar Debug 1 Location /perl SetHandler perl-script PerlHandler Apache::PerlRun Options +ExecCGI PerlSendHeader On Order deny,allow Allow from all /Location the easiest way to proceed is to do essentially what the other poster said. I would start by copying your cgi-bin configuration in your http.conf (namely, the Location container and associated Alias directive) and change it to perl-bin. then check to see whether a simple script behaves the same under /cgi-bin/ and under /perl-bin/, for example this env.cgi: #!/usr/bin/perl print Content-type: text/plain\n\n; print map {$_ = $ENV{$_}\n} keys %ENV; at this point, /perl-bin/env.cgi should show GATEWAY_INTERFACE should be CGI/1.1, since you're still under mod_cgi. anyway, after you get your cgi-bin working in the new location, then try to port the config to mod_perl. first replace SetHandler cgi-script with SetHandler perl-script PerlHandler Apache::PerlRun and see what happens - you may have enough to run the scripts under mod_perl with that step alone. try /perl-bin/env.cgi - under mod_perl, GATEWAY_INTERFACE is CGI-Perl/1.1 and MOD_PERL is set to something true. if you're getting errors at this point, check the error_log and try to resolve any - mod_perl is pretty descriptive most of the time. you may need to add PerlSendHeader to get your scripts where you want them, but it's not required for the above basic steps to get a working config. lemme know if this helps. --Geoff
Re: Server returns nothing
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Then it's probably a template error, check $tth-error()'s value, after the process()ing. also you might wanna try the template toolkit mailing list? wildguess You are trying tt's USE directive, and that module isn't returning a true value from new() on given occasions, which throws an error (plugin failed), so nothing being sent at all. /wildguess On Wed, 12 Feb 2003 16:58:14 +0200 (EET), Viljo Marrandi wrote: Hello, - -- cheers, [EMAIL PROTECTED] - wa1800z@DALnetCAiRC - #32741432 KeyID 0xDE9EB50B - D0D87CA98916CBB258AC 77FB91E0DA95DE9EB50B -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+SmtckeDald6etQsRAh1CAJ9K3jlTictgvsdouOaWJyXJ/o0BdgCggbjo l5Tnf8wbPHF2md6wLXOAEXc= =+H6d -END PGP SIGNATURE-
Re: Simultaneous GET and POST data
I recently changed form handling and got bitten by query strings. My previous code used CGI.pm to parse the arguments (but not to run my scripts). When I changed to use Apache::Request to parse the arguments I found that I was seeing both the query string arguments and the posted argumnets. I am using Mason with Apache::Request I believe. I don't think the developer is doing anything on their own but I will check. Is this behavior with CGI.pm sporadic? It only happens once every few hundred (maybe thousand) requests of a certain page.
Re: Simultaneous GET and POST data
Is this behavior with CGI.pm sporadic? It only happens once every few hundred (maybe thousand) requests of a certain page. I found that posting to a page with a query string using CGI.pm parse the args *never* gave me the query string arguments. Using Apache::Request it now seems to *always* give me those args. I don't know Mason, but in my environment I can chain scripts in to different stages of the form handling. I used one to show me the current state of the arguments and also logged the result of the code that first sets up the environment in the handler. This helped me to see what was going on. This meant I could see exactly what was being submitted, and how many values were submitted for each named argument. For example if the form just posts back to the page that it's on, and that page has arg1=somevalue in the query string, then if I have a field called arg1 on the form then I will get two values for arg1 (which I treat as an array). Could it be a problem with multi-valued args ? Rob Lambden
Re: Simultaneous GET and POST data
Rob Lambden wrote: I found that posting to a page with a query string using CGI.pm parse the args *never* gave me the query string arguments. CGI.pm 2.89 always give arguments. -- Serguei Trouchelle http://www.isd.dp.ua/
mails to be despatched in my name
i have very little space in my mail box so please send mails which are specific in my name only
please dont send general mails to me
I am from a remote place of India from where I get connected with much problem actually I am looking for some gay friends and without knowing in details about your site I have sent a message to you if you are a different site please forgive me and delete my name from your mailing list as its only unnecessarily blocking my mailboxand my telephone bill hope you will realize my problem and consider my case utpal banerji
Help-me
Hi. Please help-me with error. waiting for server to start: .[Wed Feb 12 14:56:58 2003] [info] 20 Apache:: modules loaded [Wed Feb 12 14:56:58 2003] [info] 5 APR:: modules loaded [Wed Feb 12 14:56:58 2003] [info] base server + 5 vhosts ready to run tests waiting for server to start: giving up after 61 secs !!! server failed to start! (please examine t/logs/error_log) *** Error code 1 Stop in /usr/src/mod_perl-1.99_08 (line 817 of Makefile).
mod_perl 2.0 question about $r-connection-auth_type
Hi, I've just about got the Apache::AuthCookieDBI to work with Apache 2.0.44 mod_perl 1.99_09-dev, but I ran into a problem with the $r-connection object not having auth_type or user defined. The $r-auth_type work just fine. Are these the same reference? What should I look for, or use? Thanks. -- Brian Millett Enterprise Consulting Group Shifts in paradigms (314) 205-9030 often cause nose bleeds. [EMAIL PROTECTED] Greg Glenn
compile apache with mod_perl
Does anyone know why I keep getting: [Wed Feb 12 10:35:03 2003] [notice] child pid 312 exit signal Segmentation Fault (11) in my error_log? I have tried rebuilding the machine, installing older versions of apache, different C compilers, changing my mod_perl versions and still get this message every time I try to surf to the machine I just setup. When I start apache, it appears to start but when I surf to it, I get Page Cannot be displayed. This is a list of modules I install prior to compiling apache with mod_perl: Data::Dumper (should be part of Perl install) Digest MIME URI HTML-Parser 2.x (not 3.x) LockSimple DBI 1.20 DBD::Sybase 0.94 or greater DBD::Oracle 1.12 libnet libwww Crypt::SSLeavy Jcode Unicode::String Unicode::Map8 Unicode::Map Proc::Simple Could one of these be causing the problem. I am at my wits end. Any suggestions would be awesome. Also, if I comment out the LoadModule perl_module libexec/libperl.so, in my httpd.conf file, it works like a champ. Thanks, Paul NOTICE This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Any opinions expressed in this email are those of the individual and not necessarily those of the company. All liability for viruses is excluded to the fullest extent permitted by law.
Re: Help-me
Hello there, On Wed, 12 Feb 2003, Rangel, Luciano wrote: Please help-me with error. waiting for server to start: .[Wed Feb 12 14:56:58 2003] [info] 20 Apache:: modules loaded [Wed Feb 12 14:56:58 2003] [info] 5 APR:: modules loaded [Wed Feb 12 14:56:58 2003] [info] base server + 5 vhosts ready to run tests waiting for server to start: giving up after 61 secs !!! server failed to start! (please examine t/logs/error_log) *** Error code 1 Stop in /usr/src/mod_perl-1.99_08 (line 817 of Makefile). You need to read the documentation provided with mod_perl, it tells you what information you need to provide so that people can know how to help you. For example you don't say what operating system you are using, how you built Apache, mod_perl etc. and those things are very important. If you are new to Apache and mod_perl you might find it easier to work with the 1.x series (Apache 1.3.27 and mod_perl 1.27 are the latest at the moment) because mod_perl 1.99 (which is really the first mod_perl 2.0) is still in the relatively unstable stages of its development. 73, Ged.
Re: mod_perl 2.0 question about $r-connection-auth_type
Brian Millett wrote: Hi, I've just about got the Apache::AuthCookieDBI to work with Apache 2.0.44 mod_perl 1.99_09-dev, but I ran into a problem with the $r-connection object not having auth_type or user defined. The $r-auth_type work just fine. Are these the same reference? What should I look for, or use? They don't live in the connection record in 2.0, only in the request record. I've added Apache::compat methods for backwards compatibility. Notice that you need to set up: PerlOptions +GlobalRequest for that location. Either use the latest modperl-2.0 cvs or apply this patch to get the functionality: http://marc.theaimsgroup.com/?l=apache-modperl-cvsm=104509336821414w=2 Also the online docs were updated (pending automatic update) __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: compile apache with mod_perl
Jozwiak, Paul wrote: Does anyone know why I keep getting: [Wed Feb 12 10:35:03 2003] [notice] child pid 312 exit signal Segmentation Fault (11) in my error_log? I have tried rebuilding the machine, installing older versions of apache, different C compilers, changing my mod_perl versions and still get this message every time I try to surf to the machine I just setup. When I start apache, it appears to start but when I surf to it, I get Page Cannot be displayed. This is a list of modules I install prior to compiling apache with mod_perl: You need to get the core backtrace and you will know right away what causes the problem. See: http://perl.apache.org/docs/2.0/devel/debug/c.html#Getting_the_core_File_Dumped http://perl.apache.org/docs/1.0/guide/help.html#How_to_Report_Problems __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
501 - Protocol scheme 'http' is not supported
Hi All, We get the following error 501 Protocol scheme 'http' is not supported when the perl script is excuted from perlTranshandler my $ua = LWP::UserAgent-new; $ua-agent(MyApp/0.1 ); my $req = HTTP::Request-new(GET = 'http://www.msn.com'); $req-content_type('text/plain'); $req-content('match=wwwerrors=0'); my $res = $ua-request($req); if ($res-is_success) { print Success.\n; } else { print Failed: , $res-status_line, \n; } please help OS Sun solaris 8. Apache 1.3.26 mod_perl 1.27 perl 5.005_03 Regards Harsha Yale -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
Has Apache::Cookie been ported to mod_perl-2 yet?
Has Apache::Cookie been ported to mod_perl-2 yet? I tried to install the libapreq-1.1 module with mod_perl-2/apache 2 and am getting a can't locate Apache/MyConfig.pm ... error. Charles M. [EMAIL PROTECTED]
compile apache with mod_perl
Does anyone know why I keep getting: [Wed Feb 12 10:35:03 2003] [notice] child pid 312 exit signal Segmentation Fault (11) in my error_log? I have tried rebuilding the machine, installing older versions of apache, different C compilers, changing my mod_perl versions and still get this message every time I try to surf to the machine I just setup. When I start apache, it appears to start but when I surf to it, I get Page Cannot be displayed. This is a list of modules I install prior to compiling apache with mod_perl: Data::Dumper (should be part of Perl install) Digest MIME URI HTML-Parser 2.x (not 3.x) LockSimple DBI 1.20 DBD::Sybase 0.94 or greater DBD::Oracle 1.12 libnet libwww Crypt::SSLeavy Jcode Unicode::String Unicode::Map8 Unicode::Map Proc::Simple Could one of these be causing the problem. I am at my wits end. Any suggestions would be awesome. Also, if I comment out the LoadModule perl_module libexec/libperl.so, in my httpd.conf file, it works like a champ. Thanks, Paul NOTICE This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Any opinions expressed in this email are those of the individual and not necessarily those of the company. All liability for viruses is excluded to the fullest extent permitted by law.
Server side programming PHP Vs CGI Vs modPerl
Hello All, We have a server running in a Linux machine, now we would like to present the data in a browser using HTML interface. Can anyone suggest me which is the best one (CGI or PHP or modperl) to develop for web programming and also their advantages and differences to choose them as the best Thanks in advance, Devi.