Re: mod_perl interactive debugging
On Wed, May 28, 2008 at 5:50 AM, Perrin Harkins <[EMAIL PROTECTED]> wrote: > On Tue, May 27, 2008 at 1:38 PM, william <[EMAIL PROTECTED]> wrote: >> Hello, I am trying to debug my perl code under mod_perl and I had >> followed all the instruction at this section >> http://perl.apache.org/docs/1.0/guide/debug.html#Interactive_mod_perl_Debugging >> >> I managed to see my perl debugging console prompted , but this prompt >> is shown by the >> tail -f /var/log/apache2.log > > Did you actually start your server with httpd -X as shown in that > documentation? > > - Perrin > Thanks for the reply, yes I did, [EMAIL PROTECTED]:~$ sudo apache2 -X -DPERLDB -k restart [notice] Apache::DB initialized in child 10312 Do I have to use DDD to see the prompt ? Where would the debugger prompt appear when I use the browser to request the file ? Thanks
Re: Cookie help - using both cgi.pm and APR::Request::Cookie
I don't guarantee that this is the real issue you're having, but be careful of the following : either of the Apache2::Request::Cookie or CGI::Cookie (don't remember which one) URL-encodes the cookie value by default, and the other one does not. Maybe you're getting caught by that. One of the modules above offers a "raw_cookie" method to get around this, but again I don't remember which one. cfaust-dougot wrote: Folks, I taking over some really old code and I'm in the process of converting it over to mp2. I want to be able to use APR::Request::Cookie to create the cookie for the new things I'm doing but I need to create it exactly like CGI.pm is currently doing so the old code will continue to work until I get everthing updated. I'm hoping someone knows both methods enough to tell me what I'm doing wrong. The CGI.pm cookie is being created like: $query->cookie(-name=>'name',-value=>[val1,val2,val3,val4,val5,val6,val7],-expires=>'+5y',-domain=>www.domain.com,-path=>/); I do my cookies like: my $packed_cookie = APR::Request::Cookie->new($r->pool, name => 'name', value => $cookie_value, path => '/', domain => 'www.domain.com', expires => +5y, ); $r->err_headers_out->add('Set-Cookie' => $packed_cookie->as_string); For the value I made an array @cookie_value = ('val1','val2','val3','val4','val5',val6','val7'); In $packed_cookie I tried using @cookie_value directly, I tried it as an arrayref ($cookie_value), I tried it like [EMAIL PROTECTED] etc and not matter what I do I can't get the old code to read it via my ($val1,$val2,$val3,$val4,$val5,$val6,$val7) = $query->cookie(-name=>'name'); The cookie is getting set though, I can view it from within Mozilla. It just isn't being read by CGI.pm Does anyone know what I'm doing wrong? TIA!!
"End of file found" error with Apache2::UploadProgress
Hello List, It appears as though there's some sort of bug in, or relating to, Apache2::UploadProgress. I am running apache 2.2.8 on OS X with the libapreq2-2.10 dev snapshot and HTML::Mason 1.39. When I enable the Apache2::UploadProgress module, the first file that is uploaded causes the mason component to abort with the error "End of file found." Subsequent uploads handled by this httpd process are handled normally. The error does not seem related to the browser; I have been testing with various firefox 3 betas, including RC1, firefox 2.0.14, safari 3.1.1, opera 9.24, all on OS X, as well as firefox 2.0.14, opera 9.24, and ie7 on Windows XP. Neither does the error seem to relate to file size; I have being using files ranging in size from 5kb to 780mb. Here are the relevant lines of my httpd.conf: PerlResponseHandler ModPerl::Registry PerlSetVar MasonArgsMethod mod_perl PerlOptions +GlobalRequest PerlModule Apache2::Reload PerlModule Apache2::Resource PerlChildInitHandler Apache2::Resource PerlLoadModule Apache2::UploadProgress PerlPostReadRequestHandler Apache2::UploadProgress APREQ2_ReadLimit 1024M And here is the output of httpd -V: Server version: Apache/2.2.8 (Unix) Server built: Mar 25 2008 13:49:52 Server's Module Magic Number: 20051115:11 Server loaded: APR 1.2.7, APR-Util 1.2.7 Compiled using: APR 1.2.7, APR-Util 1.2.7 Architecture: 32-bit Server MPM: Prefork threaded: no forked: yes (variable process count) Server compiled with -D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_FLOCK_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=128 -D HTTPD_ROOT="/usr/local/apache2" -D SUEXEC_BIN="/usr/local/apache2/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" And here is the mason component I've been using for testing: % if ( $u ) { Result: File <% $u->filename() %> uploaded. % } <%init> my $req = Apache2::Request->new($r); my $u = $req->upload("file"); if ( $u ) { $u->link('/tmp/test.file'); } As you can see I'm not even invoking the upload progress bar in the component; merely enabling the module in httpd.conf seems to be enough to cause the problem. (When I do enable it, aside from this error, it works beautifully. :) ) There has been chatter about this "End of file found" error on this list before, specifically in http://www.jsw4.net/info/listserv_archives/mod_perl/05-wk41/msg00011.html Joe Schaefer states that he "just patched apreq's trunk (which will be part of 2.07 when released) so the 'End of file Found' problem disappears." I assume this patch made its way into 2.2-10, and I haven't found reference to this error elsewhere, so I'm a bit stumped. If anyone can suggest further debugging strategies, or a workaround, I would be very grateful. Cheers, Greg
RE: Cookie help - using both cgi.pm and APR::Request::Cookie
Hi Andre, That was is. Once I created the cookie value like my $cookie_value = qq|$val1&$val2&$val3.|; It worked! Now I just got to update everything so I don't need to do that anymore :) Thanks! -Chris From: André Warnier [mailto:[EMAIL PROTECTED] Sent: Wed 5/28/2008 6:27 AM To: cfaust-dougot Cc: modperl@perl.apache.org Subject: Re: Cookie help - using both cgi.pm and APR::Request::Cookie I don't guarantee that this is the real issue you're having, but be careful of the following : either of the Apache2::Request::Cookie or CGI::Cookie (don't remember which one) URL-encodes the cookie value by default, and the other one does not. Maybe you're getting caught by that. One of the modules above offers a "raw_cookie" method to get around this, but again I don't remember which one. cfaust-dougot wrote: > Folks, > > I taking over some really old code and I'm in the process of converting it > over to mp2. I want to be able to use APR::Request::Cookie to create the > cookie for the new things I'm doing but I need to create it exactly like > CGI.pm is currently doing so the old code will continue to work until I get > everthing updated. > > I'm hoping someone knows both methods enough to tell me what I'm doing wrong. > > The CGI.pm cookie is being created like: > $query->cookie(-name=>'name',-value=>[val1,val2,val3,val4,val5,val6,val7],-expires=>'+5y',-domain=>www.domain.com,-path=>/); > > > I do my cookies like: > my $packed_cookie = APR::Request::Cookie->new($r->pool, > name => 'name', > value => $cookie_value, > path => '/', > domain => 'www.domain.com', > expires => +5y, > ); > $r->err_headers_out->add('Set-Cookie' => $packed_cookie->as_string); > > For the value I made an array > @cookie_value = ('val1','val2','val3','val4','val5',val6','val7'); > > In $packed_cookie I tried using @cookie_value directly, I tried it as an > arrayref ($cookie_value), I tried it like [EMAIL PROTECTED] etc and not > matter what I do I can't get the old code to read it via > > my ($val1,$val2,$val3,$val4,$val5,$val6,$val7) = > $query->cookie(-name=>'name'); > > The cookie is getting set though, I can view it from within Mozilla. It just > isn't being read by CGI.pm > > Does anyone know what I'm doing wrong? > > TIA!! > > >
[OT] connection limitation
This is decidedly off-topic We run a pretty small website (multi-use) on Apache (2.2) and mod_perl (along with some php, cgi, and static content). Unfortunately, our organization has recently decided to institute the policy of scanning the site on a regular basis for security reasons. The scan software crawls all links and URLs on the site, hitting each one with multiple forms of attack. In some parts of the world, this is called a denial-of-service attack, but here it is called a security scan. I have no control over the scan parameters, so I am looking for a meaningful way of limiting the number of connections (not really bandwidth, since we host VERY large static files) from a single IP. Any suggestions? Thanks, Sean
Re: [OT] connection limitation
Sean Davis wrote: This is decidedly off-topic We run a pretty small website (multi-use) on Apache (2.2) and mod_perl (along with some php, cgi, and static content). Unfortunately, our organization has recently decided to institute the policy of scanning the site on a regular basis for security reasons. The scan software crawls all links and URLs on the site, hitting each one with multiple forms of attack. In some parts of the world, this is called a denial-of-service attack, but here it is called a security scan. I have no control over the scan parameters, so I am looking for a meaningful way of limiting the number of connections (not really bandwidth, since we host VERY large static files) from a single IP. Any suggestions? You could do this with mod_perl by using something like Apache::Scoreboard - http://search.cpan.org/dist/Apache-Scoreboard Check to see if the number of server side children are maxed out for a given ip, and return a 503 if that is the case. But if you are running Linux an alternative way to do this might be with iptables and the iplimit module - http://linuxgazette.net/108/odonovan.html HTH Thanks, Sean -- Red Hot Penguin Consulting LLC mod_perl/PostgreSQL consulting and implementation http://www.redhotpenguin.com/
Re: mod_perl interactive debugging
On Wed, May 28, 2008 at 3:33 AM, william <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED]:~$ sudo apache2 -X -DPERLDB -k restart > [notice] Apache::DB initialized in child 10312 > > Do I have to use DDD to see the prompt ? No, it should just be right there in your terminal. It seems to be forking. Are you sure apache2 is the httpd executable and not some script? By the way, if you want a reference that's written for using the debugger with mod_perl 2, try this one: http://www.perl.com/pub/a/2006/02/09/debug_mod_perl.html - Perrin
Re: [OT] connection limitation
On Wed, May 28, 2008 at 1:19 PM, Fred Moyer <[EMAIL PROTECTED]> wrote: > Sean Davis wrote: >> >> This is decidedly off-topic >> >> We run a pretty small website (multi-use) on Apache (2.2) and mod_perl >> (along with some php, cgi, and static content). Unfortunately, our >> organization has recently decided to institute the policy of scanning >> the site on a regular basis for security reasons. The scan software >> crawls all links and URLs on the site, hitting each one with multiple >> forms of attack. In some parts of the world, this is called a >> denial-of-service attack, but here it is called a security scan. I >> have no control over the scan parameters, so I am looking for a >> meaningful way of limiting the number of connections (not really >> bandwidth, since we host VERY large static files) from a single IP. >> Any suggestions? > > You could do this with mod_perl by using something like Apache::Scoreboard - > http://search.cpan.org/dist/Apache-Scoreboard > > Check to see if the number of server side children are maxed out for a given > ip, and return a 503 if that is the case. This sounds like a viable option, yes. It also allows lots of flexibility > But if you are running Linux an alternative way to do this might be with > iptables and the iplimit module - http://linuxgazette.net/108/odonovan.html I'm on macos, currently. Thanks.
Re: [OT] connection limitation
On Wed, May 28, 2008 at 12:54 PM, Sean Davis <[EMAIL PROTECTED]> wrote: > I am looking for a > meaningful way of limiting the number of connections (not really > bandwidth, since we host VERY large static files) from a single IP. > Any suggestions? If you search for "bandwidth" on this page, it will show you many options: http://modules.apache.org/search.php I know you want to limit by connections rather than bandwidth, but many of these modules will do either. - Perrin
Re: [OT] connection limitation
On Wed, May 28, 2008 at 12:51 PM, Perrin Harkins <[EMAIL PROTECTED]> wrote: > On Wed, May 28, 2008 at 12:54 PM, Sean Davis <[EMAIL PROTECTED]> wrote: >> I am looking for a >> meaningful way of limiting the number of connections (not really >> bandwidth, since we host VERY large static files) from a single IP. >> Any suggestions? http://www.google.com/search?q=iptables+connection+limiting -- "do it first and allow the implications of what has been done to settle in." -- Moglen on practical revolution
Re: [OT] connection limitation
On Wed, May 28, 2008 at 1:50 PM, <[EMAIL PROTECTED]> wrote: > > I found this when I ran into a simuilar situation although I have not yet > had a chance to try it : > > http://bwmod.sourceforge.net/files/mod_bw-0.7.txt > > Looks like you can set max connections but not by ip. Just to finalize, I ended up using: http://www.ivn.cl/apache#bandwidth This allows setting connection and bandwidth limits based on IP or across a site. Worked like a charm (webserver load down from 20 to 2). Sean > "Sean Davis" <[EMAIL PROTECTED]> > > 2008/05/28 11:34 > > To > "Fred Moyer" <[EMAIL PROTECTED]> > cc > modperl > Subject > Re: [OT] connection limitation > > > > On Wed, May 28, 2008 at 1:19 PM, Fred Moyer <[EMAIL PROTECTED]> wrote: >> Sean Davis wrote: >>> >>> This is decidedly off-topic >>> >>> We run a pretty small website (multi-use) on Apache (2.2) and mod_perl >>> (along with some php, cgi, and static content). Unfortunately, our >>> organization has recently decided to institute the policy of scanning >>> the site on a regular basis for security reasons. The scan software >>> crawls all links and URLs on the site, hitting each one with multiple >>> forms of attack. In some parts of the world, this is called a >>> denial-of-service attack, but here it is called a security scan. I >>> have no control over the scan parameters, so I am looking for a >>> meaningful way of limiting the number of connections (not really >>> bandwidth, since we host VERY large static files) from a single IP. >>> Any suggestions? >> >> You could do this with mod_perl by using something like Apache::Scoreboard >> - >> http://search.cpan.org/dist/Apache-Scoreboard >> >> Check to see if the number of server side children are maxed out for a >> given >> ip, and return a 503 if that is the case. > > This sounds like a viable option, yes. It also allows lots of > flexibility > >> But if you are running Linux an alternative way to do this might be with >> iptables and the iplimit module - >> http://linuxgazette.net/108/odonovan.html > > I'm on macos, currently. > > Thanks. >
Re: mod_perl interactive debugging
On 5/29/08, Perrin Harkins <[EMAIL PROTECTED]> wrote: > On Wed, May 28, 2008 at 3:33 AM, william <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED]:~$ sudo apache2 -X -DPERLDB -k restart > > [notice] Apache::DB initialized in child 10312 > > > > Do I have to use DDD to see the prompt ? > > > No, it should just be right there in your terminal. It seems to be > forking. Are you sure apache2 is the httpd executable and not some > script? By the way, if you want a reference that's written for using > the debugger with mod_perl 2, try this one: > http://www.perl.com/pub/a/2006/02/09/debug_mod_perl.html > > > - Perrin > Thanks for the link, I have just read that. It's still almost the same. PerlModule ModPerl::RegistryPrefork PerlFixupHandler Apache::DB SetHandler perl-script PerlResponseHandler ModPerl::RegistryPrefork PerlOptions +ParseHeaders Options +ExecCGI Order allow,deny Allow from all If I am using ModPerl::RegistryPrefork instead of ModPerl::Registry would it matter ? I put the following lines at the top of my startup.pl script use APR::Pool (); #specific for mod_perl 2 use Apache::DB (); Apache::DB->init(); When I put the immediate-above code in it's does executed but my /var/log/apach2/errror.log does not show the debugging process, so when I put in startup.pl script then only I will see the debugging process DB<1> ModPerl::RegistryCooker::error_check(/usr/local/lib/perl/5.8.8/ModPerl/RegistryCooker.pm:698): 698:return Apache2::Const::SERVER_ERROR; DB<1> ModPerl::RegistryCooker::convert_script_to_compiled_handler(/usr/local/lib/perl/5.8.8/ModPerl/RegistryCooker.pm:407): 407:return $rc unless $rc == Apache2::Const::OK; DB<1> ModPerl::RegistryCooker::default_handler(/usr/local/lib/perl/5.8.8/ModPerl/RegistryCooker.pm:164): 164:return $rc unless $rc == Apache2::Const::OK; DB<1> [Thu May 29 13:09:08 2008] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico, referer: http://localhost/modperl/main.pl > Are you sure apache2 is the httpd executable and not some script? How do I check that ? Now it's weird, when I check the error.log , many lines of code are executed repeatedly, does that shows that I am not really using single process ? Here are a few of it. Thanks. 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> File::Temp::CODE(0xabf9548)(/usr/share/perl/5.8/File/Temp.pm:132): 132:use 5.005; DB<1> File::Temp::CODE(0xabf9548)(/usr/share/perl/5.8/File/Temp.pm:132): 132:use 5.005; DB<1> File::Temp::CODE(0xabf9548)(/usr/share/perl/5.8/File/Temp.pm:132): 132:use 5.005; DB<1> File::Temp::CODE(0xabf9554)(/usr/share/perl/5.8/File/Temp.pm:133): 133:use strict; DB<1> File::Temp::CODE(0xabf9554)(/usr/share/perl/5.8/File/Temp.pm:133): 133:use strict; DB<1> File::Temp::CODE(0xabf9554)(/usr/share/perl/5.8/File/Temp.pm:133): 133:use strict; DB<1> File::Temp::CODE(0xabf9560)(/usr/share/perl/5.8/File/Temp.pm:134): 134:use Carp; DB<1> File::Temp::CODE(0xabf9560)(/usr/share/perl/5.8/File/Temp.pm:134): 134:use Carp; DB<1> File::Temp::CODE(0xabf9560)(/usr/share/perl/5.8/File/Temp.pm:134): 134:use Carp;
Re: mod_perl interactive debugging
william wrote: On 5/29/08, Perrin Harkins <[EMAIL PROTECTED]> wrote: On Wed, May 28, 2008 at 3:33 AM, william <[EMAIL PROTECTED]> wrote: I put the following lines at the top of my startup.pl script use APR::Pool (); #specific for mod_perl 2 use Apache::DB (); Apache::DB->init(); Can you show us the part of httpd.conf where you call startup.pl? I always place my debugger calls before any other modules load, usually right after mod_perl.so is loaded. When I put the immediate-above code in it's does executed but my /var/log/apach2/errror.log does not show the debugging process, so when I put in startup.pl script then only I will see the debugging process DB<1> ModPerl::RegistryCooker::error_check(/usr/local/lib/perl/5.8.8/ModPerl/RegistryCooker.pm:698): 698:return Apache2::Const::SERVER_ERROR; DB<1> ModPerl::RegistryCooker::convert_script_to_compiled_handler(/usr/local/lib/perl/5.8.8/ModPerl/RegistryCooker.pm:407): 407:return $rc unless $rc == Apache2::Const::OK; DB<1> ModPerl::RegistryCooker::default_handler(/usr/local/lib/perl/5.8.8/ModPerl/RegistryCooker.pm:164): 164:return $rc unless $rc == Apache2::Const::OK; DB<1> [Thu May 29 13:09:08 2008] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico, referer: http://localhost/modperl/main.pl Are you sure apache2 is the httpd executable and not some script? How do I check that ? Now it's weird, when I check the error.log , many lines of code are executed repeatedly, does that shows that I am not really using single process ? Here are a few of it. Thanks. 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> WordNet::Tools::new(/usr/local/share/perl/5.8.8/WordNet/Tools.pm:82): 82: $self->{compounds}->{$word} = 1 if ($word =~ /_/); DB<1> File::Temp::CODE(0xabf9548)(/usr/share/perl/5.8/File/Temp.pm:132): 132:use 5.005; DB<1> File::Temp::CODE(0xabf9548)(/usr/share/perl/5.8/File/Temp.pm:132): 132:use 5.005; DB<1> File::Temp::CODE(0xabf9548)(/usr/share/perl/5.8/File/Temp.pm:132): 132:use 5.005; DB<1> File::Temp::CODE(0xabf9554)(/usr/share/perl/5.8/File/Temp.pm:133): 133:use strict; DB<1> File::Temp::CODE(0xabf9554)(/usr/share/perl/5.8/File/Temp.pm:133): 133:use strict; DB<1> File::Temp::CODE(0xabf9554)(/usr/share/perl/5.8/File/Temp.pm:133): 133:use strict; DB<1> File::Temp::CODE(0xabf9560)(/usr/share/perl/5.8/File/Temp.pm:134): 134:use Carp; DB<1> File::Temp::CODE(0xabf9560)(/usr/share/perl/5.8/File/Temp.pm:134): 134:use Carp; DB<1> File::Temp::CODE(0xabf9560)(/usr/share/perl/5.8/File/Temp.pm:134): 134:use Carp; -- Red Hot Penguin Consulting LLC mod_perl/PostgreSQL consulting and implementation http://www.redhotpenguin.com/
Re: mod_perl interactive debugging
On 5/29/08, Fred Moyer <[EMAIL PROTECTED]> wrote: > william wrote: > > > On 5/29/08, Perrin Harkins <[EMAIL PROTECTED]> wrote: > > > > > On Wed, May 28, 2008 at 3:33 AM, william <[EMAIL PROTECTED]> wrote: > > > > > I put the following lines at the top of my startup.pl script > > use APR::Pool (); #specific for mod_perl 2 > > use Apache::DB (); > > Apache::DB->init(); > > > > Can you show us the part of httpd.conf where you call startup.pl? > > I always place my debugger calls before any other modules load, usually > right after mod_perl.so is loaded. Thanks for the prompt reply, here it is. /etc/apache2/httpd.conf Options +ExecCGI AddHandler cgi-script cgi pl ServerName localhost # Alias /modperl/ /var/www/modperl/ # # # use APR::Pool (); # use Apache::DB (); # Apache::DB->init; # warn "PERLDB executed"; # # # PerlFixupHandler Apache::DB # # #The startup script PerlRequire '/var/www/modperl/Apache2/startup.pl' -- /etc/apache2/sites-enabled/000-default NameVirtualHost * ServerAdmin [EMAIL PROTECTED] ServerName localhost DocumentRoot /var/www/ Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all Alias /modperl/ /var/www/modperl/ PerlModule ModPerl::RegistryPrefork PerlFixupHandler Apache::DB SetHandler perl-script PerlResponseHandler ModPerl::RegistryPrefork PerlOptions +ParseHeaders Options +ExecCGI Order allow,deny Allow from all ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On Alias /doc/ "/usr/share/doc/" Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128
Syntax error in mod_perl but not in shell command
Hello, I am running this code print "Content-type: text/html\n\n"; use Switch; $t =1; switch ($t) { case 1 { print "number 1\n"; } } I have not problem running in shell command [EMAIL PROTECTED]:/var/www/modperl$ perl test.pl Content-type: text/html number 1 But when I ran in mod_perl , I got error [Thu May 29 14:48:16 2008] [error] syntax error at /var/www/modperl/test.pl line 6, near ") {"\nNumber found where operator expected at /var/www/modperl/test.pl line 7, near "case 1"\nsyntax error at /var/www/modperl/test.pl line 8, near "}\n}"\n Thanks