Re: Custom debugger subs and Apache::DB

2006-07-10 Thread R Koch

On 7/10/06, Philip M. Gollucci <[EMAIL PROTECTED]> wrote:

Why not use Apache::DProf part of Apache::DB ?



I did try that first, but I couldn't get it to work at all. I exactly
followed the examples in the module's documentation, and apache runs
with Apache:Dprof loaded; but I never got an output file to run
through dprofpp.
I fiddled with it for a while and then gave up because making my own
DB::sub() and DB:DB() seemed easier. I'm not doing anything overly
fancy and those 2 subs are all I need.
And I also am more interested in rolling my own, to understand more
about using DB.pm in various ways.

Regards,
RK


question: ssl login

2006-07-10 Thread Jonathan


i need to lock down a login/registration/password system under ssl

i've never done this stuff before

the mod_perl ssl stuff is a bit lacking in docs, so off of things  
i've read in misc places and the 1.0 guide, i have a few questions:


a- is this correct:
the recommended place to run ssl through is some sort of proxy?
ie:
		internet ||| ->  Load Balancer ( ssl ) -> cluster ( mod_perl /  
vanilla / etc )
		internet ||| -> Apache Port 80/443 ( ssl + vanilla ) -> mod_perl  
( port 8000 )
		internet ||| -> Lighttpd Port 80/443 ( ssl + vanilla ) -> mod_perl  
( port 8000 )


b- 	in that scenario, is there any way to make sure that a login  
happened via SSL ?
	the $ENV{HTTPS} , like in the mp docs , would only be set if we were  
using the same modperl for both 80 and 443 and serving directly,  
correct ?


any pointers would be greatly appreciated.

//Jonathan Vanasco

|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - -

| RoadSound.com / Indie-Rock.net
| Collaborative Online Management And Syndication Tools
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - -






Re: [QUESTION] mod_perl isnt having any effect...perhaps I've misconfigured?

2006-07-10 Thread Perrin Harkins
On Mon, 2006-07-10 at 16:05 -0500, Evan Kaufman wrote:
> > You need to do more debugging to find out if your requests are going
> > through mod_perl or not.  For example, you could add a warn of
> > $ENV{MOD_PERL} in your test script and see what shows up in the log.
> Nope, nothing in the error log.  Apache isnt executing the .pl file,
> just serving it up as a raw binary file (its not even converting
> newlines).

I'd try shutting down apache to make sure you have the right one.
Sounds dumb, but I've done it more than once.  Then I'd try removing
things from your config until it starts to work, or else just try using
a really minimal one.

To check if mod_perl is loading at all, you could put some warns in your
module that you load with PerlModule, or PerlRequire a startup.pl that
logs something.

- Perrin



Re: [QUESTION] mod_perl isnt having any effect...perhaps I've misconfigured?

2006-07-10 Thread Evan Kaufman

You need to do more debugging to find out if your requests are going
through mod_perl or not.  For example, you could add a warn of
$ENV{MOD_PERL} in your test script and see what shows up in the log.

Nope, nothing in the error log.  Apache isnt executing the .pl file,
just serving it up as a raw binary file (its not even converting
newlines).


> AddHandler cgi-script .cgi

If you take that out, does mod_perl work as expected?

No, that just prevents the .cgi files (currently vanilla cgi scripts)
from executing.

And I've restarted apache after every modification to the
configs...(thanks for responding though!)


Re: [QUESTION] mod_perl isnt having any effect...perhaps I've misconfigured?

2006-07-10 Thread Perrin Harkins
On Mon, 2006-07-10 at 14:54 -0500, Evan Kaufman wrote:
> I'm running a Gentoo Linux server using Apache 2.0.55-r1 with Perl
> 5.8.8, and just recently installed mod_perl 2.0.1-r2.  However,
> mod_perl just doesnt seem to work.

You need to do more debugging to find out if your requests are going
through mod_perl or not.  For example, you could add a warn of
$ENV{MOD_PERL} in your test script and see what shows up in the log.

> AddHandler cgi-script .cgi

If you take that out, does mod_perl work as expected?

- Perrin



RE: mod_perl/httpd.conf/database

2006-07-10 Thread Terry, Jason
It's been several years since I did this (originally in apache 1.x)...
but when I upgraded to apache 2 it still worked.

Not sure where the documentation for this is...

In your httpd.conf file




$VirtualHost{"www.domain.com:80"} = {
'ServerAdmin' => '[EMAIL PROTECTED]',
'DocumentRoot' => '/home/web/public_html',
'ServerName' => 'www.domain.com',
'ServerAlias' => [('domain.com,"www.domain.com")],
'ScriptAlias' => [
['/cgi-bin2/','/home/web/cgi-bin2/'],
['/cgi-bin/','/home/web/cgi-bin/']
  ],
'AliasMatch' => [
['^/images/spin(.*?).gif','/home/somewhere/images/spin$1.gif'],
['/robots.txt$','/home/htmlmanager/public_html/robots.txt']
  ],
'Alias' => [
['/forbidden.php3','/home/errors/forbidden.php3'],
['/missing.php3','/home/errors/missing.php3'],
  ],
'ErrorLog' => '/var/log/httpd/web.net-error_log',
'CustomLog' => '/var/log/httpd/web.net-access_log extracombined',
}





-Original Message-
From: Mason List [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 29, 2006 1:48 PM
To: modperl@perl.apache.org
Subject: mod_perl/httpd.conf/database

I'm looking for documentation on using mod_perl2 to configure apache.
I've read this page,
http://perl.apache.org/docs/2.0/api/Apache2/PerlSections.html
but I'm missing something because the virtualhost I configure doesn't
do anything.  Before I start asking for specific help I'd like to find
the documents referenced on that page: eg/perl_sections.txt and
eg/httpd.conf.pl.

I think those would tell me what I need to know, but I can't find them.

Anyway, what I'm trying to do is simply configure virtual hosts with a
database.  If someone can just provide an example I'd appreciate it...

Thanks!

Ryan


Re: [RELEASE CANDIDATE] libapreq2 2.08-RC3

2006-07-10 Thread Philip M. Gollucci
Bojan Smojver wrote:
> On Mon, 2006-07-10 at 13:27 -0700, Philip M. Gollucci wrote:
>>  
>>> 3b8b52c261c72adc971b656ca77f6eab  libapreq2-2.08-RC3.tar.gz
>>>
>> [EMAIL PROTECTED] /home/pgollucci/public_html/apreq2 rv=0 52 >md5 
>> libapreq2-2.08-RC3.tar.gz
>> MD5 (libapreq2-2.08-RC3.tar.gz) = 3b8b52c261c72adc971b656ca77f6eab
> 
> OK. That seems the same, so it's not a download problem on my end.
> 
> You don't see similar problems when unpacking on your end, do you? BTW,
> Fedora build system (i.e. the machine I don't control, probably running
> RHEL or something like that) also whinged on unpacking and it wouldn't
> build the RPM. Build log is here:
> 
> http://buildsys.fedoraproject.org/logs/fedora-development-extras/12379-libapreq2-2.08-0.rc3.1.fc6/i386/build.log
> 
Works fine, I just untarred it here:
http://people.apache.org/~pgollucci/apreq/libapreq2-2.08




-- 

Philip M. Gollucci ([EMAIL PROTECTED]) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."


Re: [RELEASE CANDIDATE] libapreq2 2.08-RC3

2006-07-10 Thread Philip M. Gollucci
Bojan Smojver wrote:
> On Tue, 2006-07-11 at 05:47 +1000, Bojan Smojver wrote:
> 
>> What's the MD5 supposed to be?
> 
> Sorry. I'm getting here:
> 
> 3b8b52c261c72adc971b656ca77f6eab  libapreq2-2.08-RC3.tar.gz
> 
[EMAIL PROTECTED] /home/pgollucci/public_html/apreq2 rv=0 52 >md5 
libapreq2-2.08-RC3.tar.gz
MD5 (libapreq2-2.08-RC3.tar.gz) = 3b8b52c261c72adc971b656ca77f6eab


-- 

Philip M. Gollucci ([EMAIL PROTECTED]) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."


[QUESTION] mod_perl isnt having any effect...perhaps I've misconfigured?

2006-07-10 Thread Evan Kaufman

I'm running a Gentoo Linux server using Apache 2.0.55-r1 with Perl
5.8.8, and just recently installed mod_perl 2.0.1-r2.  However,
mod_perl just doesnt seem to work.  I get no errors when apache starts
up, and theres nothing in apache's error log except some unrelated
404s.  It [mod_perl] just...isnt doing anything.

My (only) virtual host and mod_perl are configured as follows:

# default virtual host
NameVirtualHost *:80

   

   DocumentRoot "/home/test/public_html"

   
   Options Indexes FollowSymLinks ExecCGI
   AllowOverride None
   DirectoryIndex index.htm index.html index.pl index.cgi index.php
   AddHandler cgi-script .cgi
   Order allow,deny
   Allow from all
   

   
   ServerEnvironment apache apache
   MinSpareProcessors 4
   MaxProcessors 20
   

   


# mod_perl configuration

   
   LoadModule perl_modulemodules/mod_perl.so
   




   
   
   SetHandler perl-script
   PerlResponseHandler Apache2::Status
   Order deny,allow
   Deny from all
   Allow from 127.0.0.1
   
   

   PerlModule ModPerl::Registry
   
   SetHandler perl-script
   PerlResponseHandler ModPerl::Registry
   Options -Indexes ExecCGI
   PerlSendHeader On
   

   PerlModule Onomatopoeia
   
 SetHandler perl-script
 PerlHandler Onomatopoeia
 PerlSendHeader On
   


Now, apache serves html and text documents, and even .cgi scripts
(which run through the normal mod_cgi).  However, when I run any .pl
scripts, for instance http://localhost/perl/test.pl:

#!/usr/bin/perl -w
print "Content-Type: text/html\n\n";
if($ENV{MOD_PERL}) { print "using mod_perl!\n"; }
else { print "NOT using mod_perl!\n"; }

I get a "download file" dialog, which means its not sending the
text/html content-type header, so its probably not being interpreted
(because I am using the PerlSendHeader directive, and the script is
chmodded to 755).

Additionally, whenever I try to access a .phtml file (which should be
parsed by a handler module, Onomatopoeia in this case), it's served up
as a static html document.
And, if I try http://localhost/perl-status, i get a 404.

Am I missing something obvious?  Perhaps I stumbled past something in
the docs?  I appreciate any help, sorry for the length message!


Re: $PerlConfig broken

2006-07-10 Thread Philippe M. Chiasson
Geoffrey Young wrote:
>>   > this patch seems to have stalled:
>>
>>   > http://marc2.theaimsgroup.com/?l=apache-modperl-dev&m=114021879222434&w=2
>>
>>   > can you give it a whirl and see if it fixes things?
>>
>> Thanks!
>>
>> It doesn't fix the bug I reported.
>>
>> But it brings me closer to a workaround. It allows me to write the
>> pretty weird looking config file:
>>
>>
>>@PerlConfig = split /\n/, <>  Alias /ping/ /tmp/ping/
>>  
>>  
>>EOC
>>
>>
>> Before the patch I had no success with @PerlConfig, so apparently
>> Frank's patch fixes @PerlConfig.
>>
>> For the bug I am reporting, there's something missing to split config
>> lines into single directives.
> 
> ok, thanks for trying :)
> 
> I'm including gozer here, since he is the main PerlConfig guy - I
> wouldn't want to step on his toes trying to implement a fix for this
> issue.  but it we harp on him he will probably have an answer in a
> matter of seconds ;)

Slightly longer than a few seconds, but here is a patch that will probably
fix this issue as well as the the one linked to.

> separately, we're going to need to ping you for apml maint, um, now :)

Hu? What's that about ?


Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
Index: t/conf/extra.last.conf.in
===
--- t/conf/extra.last.conf.in	(revision 420603)
+++ t/conf/extra.last.conf.in	(working copy)
@@ -111,3 +111,23 @@
Perl 1
 
 
+
+#Single-line $PerlConfig
+
+  $PerlConfig = "Alias /perl_sections_perlconfig_scalar @DocumentRoot@";
+
+
+#Multi-line $PerlConfig
+
+  $PerlConfig = "Alias /perl_sections_perlconfig_scalar1 @DocumentRoot@
+ Alias /perl_sections_perlconfig_scalar2 @DocumentRoot@
+";
+
+
[EMAIL PROTECTED]
+
+  @PerlConfig = ("Alias /perl_sections_perlconfig_array1 @DocumentRoot@",
+ "Alias /perl_sections_perlconfig_array2 @DocumentRoot@",
+);
+
+
Index: t/response/TestDirective/perldo.pm
===
--- t/response/TestDirective/perldo.pm	(revision 420603)
+++ t/response/TestDirective/perldo.pm	(working copy)
@@ -4,6 +4,7 @@
 use warnings FATAL => 'all';
 
 use Apache::Test;
+use Apache::TestRequest;
 use Apache::TestUtil;
 use Apache2::Const -compile => 'OK';
 use Apache2::PerlSections;
@@ -11,7 +12,7 @@
 sub handler {
 my $r = shift;
 
-plan $r, tests => 17;
+plan $r, tests => 22;
 
 ok t_cmp('yes', $TestDirective::perl::worked);
 
@@ -58,6 +59,16 @@
 my $vport = $TestDirective::perl::vhost_server->port;
 ok defined $bport && defined $vport && $vport != $bport;
 
+foreach my $url (qw(scalar scalar1 scalar2)) {
+my $res = GET "/perl_sections_perlconfig_$url/";
+ok t_cmp($res->is_success, 1, '$PerlConfig');
+}
+
+foreach my $url (qw(array1 array2)) {
+my $res = GET "/perl_sections_perlconfig_$url/";
+ok t_cmp($res->is_success, 1, '@PerlConfig');
+}
+
 Apache2::Const::OK;
 }
 
Index: lib/Apache2/PerlSections.pm
===
--- lib/Apache2/PerlSections.pm	(revision 420603)
+++ lib/Apache2/PerlSections.pm	(working copy)
@@ -65,8 +65,11 @@
 {
 no strict 'refs';
 foreach my $package ($self->package) {
-$self->dump_special(${"${package}::$special"},
-  @{"${package}::$special"} );
+my @config = map { split /\n/ } 
+grep { defined } 
+(@{"${package}::$special"}, 
+ ${"${package}::$special"});
+$self->dump_special(@config);
 }
 }
 
@@ -193,10 +196,12 @@
 }
 
 sub add_config {
-my ($self, $config) = @_;
-return unless defined $config;
-chomp($config);
-push @{ $self->directives }, $config;
+my ($self, @config) = @_;
+foreach my $config (@config) {
+return unless defined $config;
+chomp($config);
+push @{ $self->directives }, $config;
+}
 }
 
 sub post_config {


signature.asc
Description: OpenPGP digital signature


Problem with undeclared identifiers (declared in apr_file_io.h, apr_errno.h)

2006-07-10 Thread Kim Leng Goh

Hi all,
I'm using apr-0.9.12, apr-util-0.9.12, httpd-2.0.58 and
mod_perl-2.0.2 and gcc-3.2.2-5:


~/mod_perl-2.0.2$ perl Makefile.PL MP_APXS=/usr/sbin/apxs
Reading Makefile.PL args from @ARGV
  MP_APXS = /usr/sbin/apxs
no conflicting prior mod_perl version found - good.
Configuring Apache/2.0.58 mod_perl2/2.0.2 Perl/v5.8.0



It seems that gcc fails to know about some apr identifiers which are
defined in /usr/include/apr-0/apr_errno.h and
/usr/include/apr-0/apr_file_io.h even though both are included in
src/modules/perl/modperl_io_apache.h and
xs/APR/PerlIO/modperl_apr_perlio.h :


~/mod_perl-2.0.2$ make && make test
[...]
gcc -I/home/anon/mod_perl-2.0.2/src/modules/perl
-I/home/anon/mod_perl-2.0.2/xs -I/usr/include/apr-0
-I/usr/include/apr-0  -I/usr/include/httpd -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing
-I/usr/local/include -I/usr/include/gdbm
-I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE -DMOD_PERL
-DMP_COMPAT_1X -DLINUX=2 -O2 -g -pipe -march=i386 -mcpu=i686 -fPIC \
-c modperl_util.c && mv modperl_util.o modperl_util.lo
modperl_util.c: In function `modperl_errsv':
modperl_util.c:210: `APR_OS_START_USERERR' undeclared (first use in
this function)
modperl_util.c:210: (Each undeclared identifier is reported only once
modperl_util.c:210: for each function it appears in.)
modperl_util.c: In function `modperl_perl_exit':
modperl_util.c:500: `APR_OS_START_USERERR' undeclared (first use in
this function)
make[1]: *** [modperl_util.lo] Error 1
make[1]: Leaving directory `/home/anon/mod_perl-2.0.2/src/modules/perl'
make: *** [modperl_lib] Error 2



If I put the following lines in src/modules/perl/mod_perl.h,
compilation is successful:

 #include "apr_file_io.h"
 #include "apr_errno.h"


However, if I didn't put #include "apr_file_io.h" in mod_perl.h,
compilation is unsuccessful:


gcc -I/home/anon/mod_perl-2.0.2/src/modules/perl
-I/home/anon/mod_perl-2.0.2/xs -I/usr/include/apr-0
-I/usr/include/apr-0  -I/usr/include/httpd -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing
-I/usr/local/include -I/usr/include/gdbm
-I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE -DMOD_PERL
-DMP_COMPAT_1X -DLINUX=2 -O2 -g -pipe -march=i386 -mcpu=i686 -fPIC \
-c modperl_constants.c && mv modperl_constants.o modperl_constants.lo
modperl_constants.c: In function `modperl_constants_lookup_apr_const':
modperl_constants.c:1340: `APR_UNKFILE' undeclared (first use in this function)
modperl_constants.c:1340: (Each undeclared identifier is reported only once
modperl_constants.c:1340: for each function it appears in.)
modperl_constants.c:1380: `APR_FILEPATH_ENCODING_UNKNOWN' undeclared
(first use in this function)
modperl_constants.c:1385: `APR_FILEPATH_ENCODING_LOCALE' undeclared
(first use in this function)
modperl_constants.c:1390: `APR_FILEPATH_ENCODING_UTF8' undeclared
(first use in this function)
make[1]: *** [modperl_constants.lo] Error 1
make[1]: Leaving directory `/home/anon/mod_perl-2.0.2/src/modules/perl'
make: *** [modperl_lib] Error 2



It seems that I have the same problem with older mod_perl releases such as 1.99.
Thanks in advance to anyone who offers some clues.

Regards,
KL


Re: $PerlConfig broken

2006-07-10 Thread Geoffrey Young

>   > this patch seems to have stalled:
> 
>   > http://marc2.theaimsgroup.com/?l=apache-modperl-dev&m=114021879222434&w=2
> 
>   > can you give it a whirl and see if it fixes things?
> 
> Thanks!
> 
> It doesn't fix the bug I reported.
> 
> But it brings me closer to a workaround. It allows me to write the
> pretty weird looking config file:
> 
>
>@PerlConfig = split /\n/, <  Alias /ping/ /tmp/ping/
>  
>  
>EOC
>
> 
> Before the patch I had no success with @PerlConfig, so apparently
> Frank's patch fixes @PerlConfig.
> 
> For the bug I am reporting, there's something missing to split config
> lines into single directives.

ok, thanks for trying :)

I'm including gozer here, since he is the main PerlConfig guy - I
wouldn't want to step on his toes trying to implement a fix for this
issue.  but it we harp on him he will probably have an answer in a
matter of seconds ;)

separately, we're going to need to ping you for apml maint, um, now :)

--Geoff


Re: Custom debugger subs and Apache::DB

2006-07-10 Thread Philip M. Gollucci
R Koch wrote:
> want. I don't want an interactive debugger, instead I want to generate
> profiling logs based on my custom DB::DB and DB::sub routines. Maybe
Why not use Apache::DProf part of Apache::DB ?

-- 

Philip M. Gollucci ([EMAIL PROTECTED]) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"In all that I've done wrong I know I must have done something right to
deserve a hug every morning and butterfly kisses at night."


Custom debugger subs and Apache::DB

2006-07-10 Thread R Koch

Hi,
I'm having some trouble working with Apache::DB. I would like to
override the debugger subs DB::DB and DB::sub with my own custom
versions. I tried several tips found on here and clpm, but can't quite
get it to work.
I'm running Perl 5.8.8, mod_perl 2, apache 2.0.55, Freebsd 5.5.

Here's what I'm doing:
# From httpd.conf. Note I've compiled perl so that @INC contains a lib directory
# in my /home where my modules are, and perl and httpd are able to use/require
# those modules.

PerlSetEnv PERL5DB 'require "SubTrace.pm"'

 use APR::Pool ();
 use Apache::DB ();
 Apache::DB->init();



 Options Indexes FollowSymLinks ExecCGI
 AllowOverride All
 SetHandler perl-script
 PerlResponseHandler ModPerl::Registry
 PerlOptions +ParseHeaders
 PerlFixupHandler +Apache::DB
 Order allow,deny
 Allow from 127.0.0.1


#and package SubTrace.pm contains:
package SubTrace;
sub DB::DB {}
sub DB::sub {
   if ($DB::sub =~ /^MyModule/ and $DB::sub !~ /DESTROY|CODE/) {
 warn "DB::sub: $DB::sub", $/;
   }

   if ( $DB::sub eq 'DESTROY'
or substr($DB::sub, -9) eq '::DESTROY'
or not defined wantarray)
   {
&$DB::sub;
$DB::ret = undef;
   }elsif (wantarray) {
 @DB::ret = &$DB::sub;
 @DB::ret;
   }else{
 $DB::ret = &$DB::sub;
 $DB::ret;
   }
}
1;

Now for some reason this just blows up when I run 'httpd -X', the
httpd process becomes several hundred megs and the cgi never displays
anything. To make matters worse, I can't just ^C out, because the
debugger has taken over and spits out info that I don't want, so I
have to kill httpd.

I've looked through Apache::DB, and it should be eval'ing what I've
placed in PERL5DB
but instead it goes ahead and loads Apache/perl5db.pl which I don't
want. I don't want an interactive debugger, instead I want to generate
profiling logs based on my custom DB::DB and DB::sub routines. Maybe
there is a setting I overlooked to disable the interactive debugger
and its output in .perldb and maybe I can get Apache::DB to load
.perldb?

Because the process blew up, I also tried not setting the
PerlFixupHandler to Apache::DB and instead wrapped my SubTrace.pm code
in a BEGIN block, and also added $^P |= 1 to turn on the debugger at
compile time.
This seems to work, because I see output in the log file generated by
my DB::sub routine, however, my DB::DB routine does not seem to be
called at all, which was puzzling, so I think debugging is maybe not
enabled.

Thanks in advance for any tips or advice!
RK