Re: Hitting head against wall: can't get perl to execute file
Thanks for the quick response! It works with some modifications to your code: PerlModuleModPerl::Registry SetHandlerperl-script PerlResponseHandlerModPerl::Registry Allow from all Options +ExecCGI PerlSendHeader On Evidently, PerlModule is not allowed inside the container. Thanks again! Pete
Re: Hitting head against wall: can't get perl to execute file
Peter1 Alvin <[EMAIL PROTECTED]> wrote: > I'm trying to set up modperl on Windows XP. Instead of executing the > file, I get this returned to my browser: Peter, > But, I can't seem to configure Apache to actually *run* my script. > I've tried all these directives: > > > SetHandler modperl > > > AND > > AddHandler modperl pm > > Can anyone help me??? I like the first one better. But to get those files to be handled by mod_perl, you need to tell them what handler to use to load them. Are you wanting to use perl modules (.pm) files, or cgi scripts in mod_perl? For CGI scripts, i'd use: PerlModule ModPerl::Registry SetHandler perl-script PerlResponseHandler ModPerl::Registry If you want to use actual modules (eg; part of your @INC is your web root and you want to run their handlers) I'd use something like this, with ModPerl::PackageRegistry: PerlModule ModPerl::PackageRegistry SetHandler perl-script PerlResponseHandler ModPerl::PackageRegistry PackageNamespaceMy::Site Cheers, Tyler
Hitting head against wall: can't get perl to execute file
I'm trying to set up modperl on Windows XP. Instead of executing the file, I get this returned to my browser: #!/usr/bin/perl5.8.0 print "Content-type: text/html\n\n"; print "Hello World!\n"; 1; Here is how I load perl: LoadFile "C:/Program Files/Perl/bin/perl58.dll" LoadModule perl_module modules/mod_perl.so PerlModule Apache2::compat I know that Apache is finding modperl because in error.log I get this: [Fri Dec 30 19:52:16 2005] [notice] Apache/2.0.55 (Win32) mod_perl/2.0.2 Perl/v5.8.7 configured -- resuming normal operations [Fri Dec 30 19:52:16 2005] [notice] Server built: Oct 9 2005 19:16:56 [Fri Dec 30 19:52:16 2005] [notice] Parent: Created child process 5284 [Fri Dec 30 19:52:17 2005] [notice] Child 5284: Child process is running [Fri Dec 30 19:52:17 2005] [notice] Child 2968: Released the start mutex [Fri Dec 30 19:52:17 2005] [notice] Child 5284: Acquired the start mutex. [Fri Dec 30 19:52:17 2005] [notice] Child 5284: Starting 250 worker threads. [Fri Dec 30 19:52:18 2005] [notice] Child 2968: Waiting for 250 worker threads to exit. [Fri Dec 30 19:52:18 2005] [notice] Child 2968: All worker threads have exited. [Fri Dec 30 19:52:18 2005] [notice] Child 2968: Child process is exiting But, I can't seem to configure Apache to actually *run* my script. I've tried all these directives: SetHandler modperl AND AddHandler modperl pm Can anyone help me??? Pete
Strange test results
Hi - This is not in your bug report format, but look how strange it is: 1) Standard test gives these failures: $ make test ... Failed TestStat Wstat Total Fail Failed List of Failed --- t/modperl/setupenv2.t237 30.43% 1-7 t/modules/cgi2.t 55 100.00% 1-5 t/modules/cgipost.t 63 50.00% 4-6 t/modules/cgipost2.t 63 50.00% 4-6 t/modules/cgiupload2.t22 100.00% 1-2 8 tests skipped. Failed 5/238 test scripts, 97.90% okay. 20/2386 subtests failed, 99.16% okay. [warning] server localhost:8529 shutdown ... 2) selective tests: $ make test TEST_FILES=t/modperl/setupenv2.t ... server localhost:8564 listening (TestHooks::push_handlers_anon) t/modperl/setupenv2ok All tests successful. Files=1, Tests=23, 1 wallclock secs ( 0.56 cusr + 0.05 csys = 0.61 CPU) [warning] server localhost:8529 shutdown ... $ make test TEST_FILES=t/modules/cgi2.t ... server localhost:8564 listening (TestHooks::push_handlers_anon) t/modules/cgi2ok All tests successful. Files=1, Tests=5, 0 wallclock secs ( 0.57 cusr + 0.08 csys = 0.65 CPU) [warning] server localhost:8529 shutdown ... (other failed tests not tried, but same-same I bet.) 3) Configuration: Apache 2.3 (svn trunk): ./configure \ --host=$CHOST \ --enable-layout=WinterHaven \ --with-mpm=prefork \ --enable-cgi\ --disable-cgid \ --enable-setenvif \ --enable-mods-shared\ --enable-auth-anon \ --enable-auth-dbm \ --enable-dav\ --enable-dav-fs \ --enable-dav-lock \ --enable-deflate\ --enable-headers\ --enable-info \ --enable-rewrite\ --enable-speling\ --enable-ssl mod_perl 2.0 (svn): perl Makefile.PL \ MP_APXS=/usr/apache2.3/bin/apxs \ MP_COMPAT_1X=0 && uname -a: Linux cathy 2.6.14-gentoo-r5 #2 SMP PREEMPT Sun Dec 25 14:58:37 HST 2005 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz GenuineIntel GNU/Linux perl -V: Summary of my perl5 (revision 5 version 8 subversion 7) configuration: Platform: osname=linux, osvers=2.6.14-gentoo-r2, archname=i686-linux-thread-multi uname='linux cathy 2.6.14-gentoo-r2 #16 smp preempt sun nov 27 13:29:58 hst 2005 i686 intel(r) pentium(r) 4 cpu 2.40ghz genuineintel gnulinux ' config_args='-des -Darchname=i686-linux-thread -Dcccdlflags=-fPIC -Dccdlflags=-rdynamic -Dcc=i686-pc-linux-gnu-gcc -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr -Dlocincpth= -Doptimize=-O2 -march=pentium4 -pipe -Duselargefiles -Dd_semctl_semun -Dscriptdir=/usr/bin -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dinstallman1dir=/usr/share/man/man1 -Dinstallman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dinc_version_list=5.8.0 5.8.0/i686-linux-thread-multi 5.8.2 5.8.2/i686-linux-thread-multi 5.8.4 5.8.4/i686-linux-thread-multi 5.8.5 5.8.5/i686-linux-thread-multi 5.8.6 5.8.6/i686-linux-thread-multi -Dcf_by=Gentoo -Ud_csh -Dusethreads -Di_ndbm -Di_gdbm -Di_db' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef ... Aloha => Beau;
Re: Newbie help with Apache2::Request configuration
Thank you! configure --enable-perl-glue complained about problems with XSBuilder. After a ExtUtils re-install, the installation worked like a charm. And no problems with startup.pl. Thanks again. -Joshua Joshua H wrote: I copied all the .pm files from the local /tmp install to the apparent correct places in @INC. Now I get: [Fri Dec 30 18:22:51 2005] [error] APR/Request/Param.pm did not return a true value at /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi/Apache2/Request.pm line 2.\nBEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi/Apache2/Request.pm line 2.\nCompilation failed in require at /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi/Apache2/Upload.pm line 2.\nBEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi/Apache2/Upload.pm line 2.\nCompilation failed in require at /etc/apache2/mod_perl-startup.pl line 23.\nBEGIN failed--compilation aborted at /etc/apache2/mod_perl-startup.pl line 23.\nCompilation failed in require at (eval 2) line 1.\n Something strange... and probably due to a stupidism on my part. :( Sorry for the trouble. -Joshua Sounds like you didn't use the --enable-perl-glue option when you installed libapreq2. -Glenn
Re: Newbie help with Apache2::Request configuration
Joshua H wrote: I copied all the .pm files from the local /tmp install to the apparent correct places in @INC. Now I get: [Fri Dec 30 18:22:51 2005] [error] APR/Request/Param.pm did not return a true value at /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi/Apache2/Request.pm line 2.\nBEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi/Apache2/Request.pm line 2.\nCompilation failed in require at /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi/Apache2/Upload.pm line 2.\nBEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi/Apache2/Upload.pm line 2.\nCompilation failed in require at /etc/apache2/mod_perl-startup.pl line 23.\nBEGIN failed--compilation aborted at /etc/apache2/mod_perl-startup.pl line 23.\nCompilation failed in require at (eval 2) line 1.\n Something strange... and probably due to a stupidism on my part. :( Sorry for the trouble. -Joshua Sounds like you didn't use the --enable-perl-glue option when you installed libapreq2. -Glenn
Re: Newbie help with Apache2::Request configuration
I copied all the .pm files from the local /tmp install to the apparent correct places in @INC. Now I get: [Fri Dec 30 18:22:51 2005] [error] APR/Request/Param.pm did not return a true value at /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi/Apache2/Request.pm line 2.\nBEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi/Apache2/Request.pm line 2.\nCompilation failed in require at /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi/Apache2/Upload.pm line 2.\nBEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi/Apache2/Upload.pm line 2.\nCompilation failed in require at /etc/apache2/mod_perl-startup.pl line 23.\nBEGIN failed--compilation aborted at /etc/apache2/mod_perl-startup.pl line 23.\nCompilation failed in require at (eval 2) line 1.\n Something strange... and probably due to a stupidism on my part. :( Sorry for the trouble. -Joshua Thanks very much for the help. I was actually using Apache2::Request->new(), instead of Apache::Request - just mis-typed in my posting. Additional information you asked for: httpd2 version = 2.0.53 mod_perl version = 2.0.2 libapreq2 version = 2.06-dev OS = Suse 9.3 w/ 2.6.11 kernel used make for mod_perl and libapreq2. Perl -V : -- Summary of my perl5 (revision 5 version 8 subversion 6) configuration: Platform: osname=linux, osvers=2.6.9, archname=i586-linux-thread-multi uname='linux salieri 2.6.9 #1 smp fri jan 14 15:41:33 utc 2005 i686 athlon i386 gnulinux ' config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr -Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm -Duseshrplib=true -Doptimize=-O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -g -Wall -pipe' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -g -Wall -pipe', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe' ccversion='', gccversion='3.3.5 20050117 (prerelease) (SUSE Linux)', 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='cc', ldflags ='' libpth=/lib /usr/lib /usr/local/lib libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='2.3.4' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.6/i586-linux-thread-multi/CORE' cccdlflags='-fPIC', lddlflags='-shared' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under linux Compiled at Mar 19 2005 17:34:48 @INC: /usr/lib/perl5/5.8.6/i586-linux-thread-multi /usr/lib/perl5/5.8.6 /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.6/i586-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl --- I added the modules you suggested to startup.pl. It coughed on the APR files that didn't get installed from libapreq2 (e.g. Param.pm). I'm thinking I should just copy all the .pm files from libapreq2 over to where they should be. Root-causing the thing would feel good, but I'm not sure it's worth the effort. -Joshua Joshua H wrote: 1) When I try to call Apache::Request methods (like new() ), I get an You want Apache2::Request->new() or better yet APR::Request::Apache2->new() See: http://httpd.apache.org/apreq/docs/libapreq2/group__apreq__xs__apr__request__apache2.html error to the effect that it can't find Apache2/Request.pm in @INC. And indeed although it is in the temp directory that I built libapreq2 in, it didn't get installed into @INC even though there were no errors from 'make' or 'make install' . I can copy it (and the .pm files under APR as well which also didn't get installed) into @INC directories, but I'm wondering if this is a symptom of a bigger problem. They should have been installed. How about some environment information? httpd version mod_perl version liabpreq version operating and version system perl -V Did you make or gmake ? If you are
Re: Newbie help with Apache2::Request configuration
Thanks very much for the help. I was actually using Apache2::Request->new(), instead of Apache::Request - just mis-typed in my posting. Additional information you asked for: httpd2 version = 2.0.53 mod_perl version = 2.0.2 libapreq2 version = 2.06-dev OS = Suse 9.3 w/ 2.6.11 kernel used make for mod_perl and libapreq2. Perl -V : -- Summary of my perl5 (revision 5 version 8 subversion 6) configuration: Platform: osname=linux, osvers=2.6.9, archname=i586-linux-thread-multi uname='linux salieri 2.6.9 #1 smp fri jan 14 15:41:33 utc 2005 i686 athlon i386 gnulinux ' config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr -Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm -Duseshrplib=true -Doptimize=-O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -g -Wall -pipe' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -g -Wall -pipe', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe' ccversion='', gccversion='3.3.5 20050117 (prerelease) (SUSE Linux)', 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='cc', ldflags ='' libpth=/lib /usr/lib /usr/local/lib libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='2.3.4' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.6/i586-linux-thread-multi/CORE' cccdlflags='-fPIC', lddlflags='-shared' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under linux Compiled at Mar 19 2005 17:34:48 @INC: /usr/lib/perl5/5.8.6/i586-linux-thread-multi /usr/lib/perl5/5.8.6 /usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.6/i586-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl --- I added the modules you suggested to startup.pl. It coughed on the APR files that didn't get installed from libapreq2 (e.g. Param.pm). I'm thinking I should just copy all the .pm files from libapreq2 over to where they should be. Root-causing the thing would feel good, but I'm not sure it's worth the effort. -Joshua Joshua H wrote: 1) When I try to call Apache::Request methods (like new() ), I get an You want Apache2::Request->new() or better yet APR::Request::Apache2->new() See: http://httpd.apache.org/apreq/docs/libapreq2/group__apreq__xs__apr__request__apache2.html error to the effect that it can't find Apache2/Request.pm in @INC. And indeed although it is in the temp directory that I built libapreq2 in, it didn't get installed into @INC even though there were no errors from 'make' or 'make install' . I can copy it (and the .pm files under APR as well which also didn't get installed) into @INC directories, but I'm wondering if this is a symptom of a bigger problem. They should have been installed. How about some environment information? httpd version mod_perl version liabpreq version operating and version system perl -V Did you make or gmake ? If you are using mod_perl older then 2.0.0 upgrade before you do anything else. 2) My startup.pl file won't load with the line "Use Apache2();" in it, You'll probably want this in your startup.pl file for libapreq2 use APR::Request (); use APR::Request::Apache2 (); use APR::Request::CGI (); use APR::Request::Cookie (); use APR::Request::Error (); use APR::Request::Hook (); use APR::Request::Param (); use APR::Request::Parser (); use Apache2::Upload (); use Apache2::Request (); use Apache2::Cookie (); also with an error that it isn't in @INC. It's actually in @INC, but under Bundle/. When I include Bundle in @INC, it barfs on a whole bunch of XS stuff. My startup.pl file is copied here in case I've made other errors: Apache2 is obsoleted. See here: http://perl.apache.org/docs/2.0/rename.html LoadModule apreq_module/usr/lib/apache2/mod_apreq2.so Thats correct.
Re: Newbie help with Apache2::Request configuration
Joshua H wrote: 1) When I try to call Apache::Request methods (like new() ), I get an You want Apache2::Request->new() or better yet APR::Request::Apache2->new() See: http://httpd.apache.org/apreq/docs/libapreq2/group__apreq__xs__apr__request__apache2.html error to the effect that it can't find Apache2/Request.pm in @INC. And indeed although it is in the temp directory that I built libapreq2 in, it didn't get installed into @INC even though there were no errors from 'make' or 'make install' . I can copy it (and the .pm files under APR as well which also didn't get installed) into @INC directories, but I'm wondering if this is a symptom of a bigger problem. They should have been installed. How about some environment information? httpd version mod_perl version liabpreq version operating and version system perl -V Did you make or gmake ? If you are using mod_perl older then 2.0.0 upgrade before you do anything else. 2) My startup.pl file won't load with the line "Use Apache2();" in it, You'll probably want this in your startup.pl file for libapreq2 use APR::Request (); use APR::Request::Apache2 (); use APR::Request::CGI (); use APR::Request::Cookie (); use APR::Request::Error (); use APR::Request::Hook (); use APR::Request::Param (); use APR::Request::Parser (); use Apache2::Upload (); use Apache2::Request (); use Apache2::Cookie (); also with an error that it isn't in @INC. It's actually in @INC, but under Bundle/. When I include Bundle in @INC, it barfs on a whole bunch of XS stuff. My startup.pl file is copied here in case I've made other errors: Apache2 is obsoleted. See here: http://perl.apache.org/docs/2.0/rename.html LoadModule apreq_module/usr/lib/apache2/mod_apreq2.so Thats correct. -- "Love is not the one you can picture yourself marrying, but the one you can't picture the rest of your life without." "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..." Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198 Consultant / http://p6m7g8.net/Resume/resume.shtml Senior Software Engineer - TicketMaster - http://ticketmaster.com
Newbie help with Apache2::Request configuration
I've compiled and (apparently) successfully installed libapreq2. However, I have two problems that are possibly related: 1) When I try to call Apache::Request methods (like new() ), I get an error to the effect that it can't find Apache2/Request.pm in @INC. And indeed although it is in the temp directory that I built libapreq2 in, it didn't get installed into @INC even though there were no errors from 'make' or 'make install' . I can copy it (and the .pm files under APR as well which also didn't get installed) into @INC directories, but I'm wondering if this is a symptom of a bigger problem. 2) My startup.pl file won't load with the line "Use Apache2();" in it, also with an error that it isn't in @INC. It's actually in @INC, but under Bundle/. When I include Bundle in @INC, it barfs on a whole bunch of XS stuff. My startup.pl file is copied here in case I've made other errors: --- if ( ! {MOD_PERL}) { die "GATEWAY_INTERFACE not Perl!"; } #use Apache2(); use lib qw(/srv/www/lib); # enable if the mod_perl 1.0 compatibility is needed # use Apache::compat (); use ModPerl::Util (); #for CORE::GLOBAL::exit use ModPerl::MethodLookup(); use Apache2::RequestRec (); use Apache2::RequestIO (); use Apache2::RequestUtil (); use Apache2::ServerRec (); use Apache2::ServerUtil (); use Apache2::Connection (); use Apache2::Log (); use APR::Table (); use ModPerl::Registry (); use Apache2::Const -compile => ':common'; use APR::Const -compile => ':common'; 1; - the relevant httpd.conf section if helpful: LoadModule apreq_module/usr/lib/apache2/mod_apreq2.so PerlRequire "/etc/apache2/mod_perl-startup.pl" ScriptAlias /perl/ "/srv/www/cgi-bin/" # mod_perl mode SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI ScriptAlias /cgi-perl/ "/srv/www/cgi-bin/" # perl cgi mode SetHandler perl-script PerlResponseHandler ModPerl::PerlRun PerlOptions +ParseHeaders Options +ExecCGI --- This is my first mod_perl and my understanding of the mechanics are foggy at best right now. TIA for any help. -Joshua
Re: ModPerl
Jonathan Vanasco wrote: On Dec 30, 2005, at 4:04 PM, Paul Harrison wrote: How come in ModPerl 2, we don’t have to send the http headers and print versus $r->print() compared to ModPerl1 ? The general answer to the headers question is because httpd 2.x sends them for you. -- "Love is not the one you can picture yourself marrying, but the one you can't picture the rest of your life without." "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..." Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198 Consultant / http://p6m7g8.net/Resume/resume.shtml Senior Software Engineer - TicketMaster - http://ticketmaster.com
Re: ModPerl
i believe thats a compile option $r->print vs print was traditionally because of what STDOUT was compiled to be you could do print in modperl1 if you tied STDOUT to the right option i'm not sure about http headers though On Dec 30, 2005, at 4:04 PM, Paul Harrison wrote: How come in ModPerl 2, we don’t have to send the http headers and print versus $r->print() compared to ModPerl1 ?
Re: Adding customs httpd.conf data in mod_perl 2.0
On Fri, 30 Dec 2005 13:07:53 -0800 David Wheeler <[EMAIL PROTECTED]> wrote: > Does that make things clearer? Is there an equivalent to > $Apache::ReadConfig::PerlConfig in mod_perl2, perhaps? Or better > yet, is there now an API for dynamically configuring Apache from > mod_perl2? Much. I was under the impression you were just trying to avoid the user adding in static Apache conf items, not have it built relative to some URI. What Randal suggested is exactly what you're going to need. - Frank Wiles <[EMAIL PROTECTED]> http://www.wiles.org -
Re: Adding customs httpd.conf data in mod_perl 2.0
> "Curtis" == Curtis Poe <[EMAIL PROTECTED]> writes: Curtis> Hi all, Curtis> I've been searching like mad through the docs for how to do something Curtis> that I know must be really simple. Let's say that I've added Curtis> something like that to httpd.conf: Curtis>PerlModule Some::Application You can have the import() of this module add conf information directly. See http://perl.apache.org/docs/2.0/api/Apache2/CmdParms.html and http://perl.apache.org/docs/2.0/api/Apache2/ServerUtil.html about "add_config". -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Re: Adding customs httpd.conf data in mod_perl 2.0
Hi all, However, what I need to be able to do is let someone have a running mod_perl 2 setup and dynamically "pull in" the above information from an external file or add that information via Perl (in other words, I don't want to touch the default httpd.conf file). How the heck do I do that? Since I'm the one who's asked Curtis to look into this, let me see if I can elaborate a little. What we have is a complex application that needs to do quite a bit of configuration (set up an access handler, a cleanup handler, a response handler, allow the default handler for images, etc., etc., ad nauseum). When users install it, we don't want them to have to add a tone of stuff to their httpd.conf just to get all of it going. What we'd rather have is something like this: SetHandler perl-script PerlPostConfigHandler MyApp::Apache2::config The idea is that MyApp::Apache2::config() would figure out that it was in a Location context with a value of /myapp, and then configure its handlers relative to that location. The result would be the equivalent of: SetHandler perl-script PerlResponseHandler MyApp::Apache2 PerlAuthenHandler MyApp::Apache2::authen PerlCleanupHandler MyApp::Apache2::cleanup # REST SetHandler perl-script PerlResponseHandler MyApp::Apache2::rest # Static files: SetHandler default-handler Only dynamically configured. The context could be either a Location directive for an existing host name, or a virtual host directive, so that the application would then run in that entire domain. Now, I've done something similar to this for mod_perl1 in Bricolage. There, the entirety of the httpd.conf configuration that the user has to do is this: PerlPassEnv BRICOLAGE_ROOT PerlModule Bric::App::ApacheConfig Yes, that's it. Bric::App::ApacheConfig pulls in virtual host information from its own configuration file, and then builds up all of the configuration it needs for that host by adding literal httpd.conf directives to $Apache::ReadConfig::PerlConfig. That works, but I'd like to do away with the requirement of a dedicated host, and I'd like to do it all in mod_perl2 at server startup time. Does that make things clearer? Is there an equivalent to $Apache::ReadConfig::PerlConfig in mod_perl2, perhaps? Or better yet, is there now an API for dynamically configuring Apache from mod_perl2? Thanks, David
ModPerl
How come in ModPerl 2, we don’t have to send the http headers and print versus $r->print() compared to ModPerl1 ? ## ModPerl 2 sub handler { my $r = shift; $r->content_type('text/plain'); print "mod_perl 2.0 rocks!\n"; return Apache2::Const::OK; } ## ModPerl 1 sub handler { my $r = shift; $r->send_http_header('text/plain'); $r->print("mod_perl rules!\n"); return OK; } Cure
Re: Adding customs httpd.conf data in mod_perl 2.0
On Dec 30, 2005, at 12:53 PM, Frank Wiles wrote: Short of the other suggestion of bundling your own apache/mod_perl/etc I don't think you're going to be able to able to easily get around having the user do almost nothing. I don't think many users would be confused by adding one line of config to httpd.conf however. Thanks for the information. It's been most helpful and we'll probably go with the "have the user include one line" choice. Cheers, Curtis "Ovid" Poe Software Engineer Kineticode, Inc.
Re: Adding customs httpd.conf data in mod_perl 2.0
On Fri, 30 Dec 2005 11:40:54 -0800 Curtis Poe <[EMAIL PROTECTED]> wrote: > On Dec 30, 2005, at 10:39 AM, Frank Wiles wrote: > > Many distros now setup Apache defaultly to "Include conf.d/*" so > > you can "drop in" configs like this without having to muck with > > the original/main httpd.conf. > > I compiled my from source and it doesn't appear to do this. However, > I see that httpd takes a '-f' switch which lets me specify an > alternate config file. From what I can tell, short of having > includes already allowed in the default httpd.conf, there's no > default way to allow *additional* config files. So the way to get > around this seems to be for me to do this: > >httpd -f /path/to/my/config > > And then have my config include the original httpd.conf. Is that the > only way to handle this? Is seems rather hackish, so I assume > there's a better way. Yeah you would need to either pass in your own conf with -f or get the user to add the one line: Include /path/to/your.conf Or the "Include conf.d/*" option, but you're correct that isn't defaultly in the Apache conf from source. However, distros like Fedora, RHEL, etc. have their confs with it. YMMV by distro. Short of the other suggestion of bundling your own apache/mod_perl/etc I don't think you're going to be able to able to easily get around having the user do almost nothing. I don't think many users would be confused by adding one line of config to httpd.conf however. - Frank Wiles <[EMAIL PROTECTED]> http://www.wiles.org -
Re: mailing list does NOT work
BUT i don't see how its phishing. I suspected it because its literally the exact same text but two completely different addresses and names. You can scrape all the addresses to this list off the web true enough or by just subscribing. Exactly :) Any posts, and especially replies are logged as valid addresses, perhaps. Otherwise the odds that two people, just a day or so apart, are that dumb and lazy *and* would choose exactly the same text (verbage *and* capitolization no less) are astonomical.
Re: Adding customs httpd.conf data in mod_perl 2.0
On Dec 30, 2005, at 10:39 AM, Frank Wiles wrote: Many distros now setup Apache defaultly to "Include conf.d/*" so you can "drop in" configs like this without having to muck with the original/main httpd.conf. I compiled my from source and it doesn't appear to do this. However, I see that httpd takes a '-f' switch which lets me specify an alternate config file. From what I can tell, short of having includes already allowed in the default httpd.conf, there's no default way to allow *additional* config files. So the way to get around this seems to be for me to do this: httpd -f /path/to/my/config And then have my config include the original httpd.conf. Is that the only way to handle this? Is seems rather hackish, so I assume there's a better way. Cheers, Curtis "Ovid" Poe Software Engineer Kineticode, Inc.
Re: Adding customs httpd.conf data in mod_perl 2.0
On Dec 30, 2005, at 11:06 AM, Michael Peters wrote: Admirable goal, but may I suggest an alternative way to look at it. Instead of working with an existing apache (which may or may not have mod_perl, mod_* or may have config directives which will conflict with your assumptions etc) why not have the app come bundled with it's own apache? We're hoping to avoid bundling Apache2 because that would contradict the design goal. Specifically, if someone has an existing mod_perl 1, mod_perl 2, FastCGI or other server, we'd like things to, as much as possible, "play nicely" with them. Bundling a bunch of stuff they don't need would be disastrous. Trying to maintain separate bundles for every configuration option and OS would also be very difficult. (different platforms, servers and data stores) Cheers, Curtis "Ovid" Poe Software Engineer Kineticode, Inc.
Re: Adding customs httpd.conf data in mod_perl 2.0
Curtis Poe wrote: > On Dec 30, 2005, at 10:39 AM, Frank Wiles wrote: > >> I'm not sure if it's what you're after, but have you thought about >> using an Include in your httpd.conf? > > > I'll look into see what's involved with that. In the meantime, what I'm > basically trying to do is allow a user to download our app and: > > perl Build.PL --server mod_perl2 > ./Build > # answer a few questions > ./Build test > sudo bin/httpd start Admirable goal, but may I suggest an alternative way to look at it. Instead of working with an existing apache (which may or may not have mod_perl, mod_* or may have config directives which will conflict with your assumptions etc) why not have the app come bundled with it's own apache? > That's highly abbreviated, but I think that shows roughly the goal. Of > course, the above doesn't show the installation, but hopefully they > could run "sudo bin/httpd start" and it would restart Apache2 but with > the extra conf info available, such as where to find the mod_perl app, > extra libraries, etc. > > As much as possible, I'm trying to keep all of the app info in one spot > to make for easy installation/removal of the app without touching > anything else. The more configuration I force on the end users, the > less likely it is that they'll use the system. However, I'm pretty > damned clueless about the admin side of things and not sure how easy > this goal is to attain. This would also be accomplished by having your application contain it's own httpd. I would look at the build/install/control system of Krang (http://krang.sf.net). It will install a local version of Apache/mod_perl/mod_ssl and any needed Perl modules so that the admin/user doesn't have to think about any of that. A user could build their own app from source or download a binary built for their platform. -- Michael Peters Developer Plus Three, LP
Re: Adding customs httpd.conf data in mod_perl 2.0
On Dec 30, 2005, at 10:39 AM, Frank Wiles wrote: I'm not sure if it's what you're after, but have you thought about using an Include in your httpd.conf? I'll look into see what's involved with that. In the meantime, what I'm basically trying to do is allow a user to download our app and: perl Build.PL --server mod_perl2 ./Build # answer a few questions ./Build test sudo bin/httpd start That's highly abbreviated, but I think that shows roughly the goal. Of course, the above doesn't show the installation, but hopefully they could run "sudo bin/httpd start" and it would restart Apache2 but with the extra conf info available, such as where to find the mod_perl app, extra libraries, etc. As much as possible, I'm trying to keep all of the app info in one spot to make for easy installation/removal of the app without touching anything else. The more configuration I force on the end users, the less likely it is that they'll use the system. However, I'm pretty damned clueless about the admin side of things and not sure how easy this goal is to attain. Cheers, Curtis "Ovid" Poe Software Engineer Kineticode, Inc.
Re: Adding customs httpd.conf data in mod_perl 2.0
On 12/30/05 1:39 PM, "Frank Wiles" <[EMAIL PROTECTED]> wrote: > On Fri, 30 Dec 2005 10:32:49 -0800 > Curtis Poe <[EMAIL PROTECTED]> wrote: > >> Hi all, >> >> I've been searching like mad through the docs for how to do something >> that I know must be really simple. Let's say that I've added >> something like that to httpd.conf: >> >>PerlModule Some::Application >> >> >> ServerNamesome.application >> DocumentRoot /some/non_standard/path >> >> >> SetHandler modperl >> PerlResponseHandler Some::Application >> Order allow,deny >> Allow from all >> >> >> >> So far, something like this has worked well for me getting my app and >> up and running. However, what I need to be able to do is let someone >> have a running mod_perl 2 setup and dynamically "pull in" the above >> information from an external file or add that information via Perl >> (in other words, I don't want to touch the default httpd.conf file). >> How the heck do I do that? > > I'm not sure if it's what you're after, but have you thought about > using an Include in your httpd.conf? > > Many distros now setup Apache defaultly to "Include conf.d/*" so > you can "drop in" configs like this without having to muck with > the original/main httpd.conf. > > Or are you looking for a way to share this information with cron > scripts or something? Or is this more what you are looking for: http://httpd.apache.org/docs/2.0/vhosts/mass.html
Re: Adding customs httpd.conf data in mod_perl 2.0
On Fri, 30 Dec 2005 10:32:49 -0800 Curtis Poe <[EMAIL PROTECTED]> wrote: > Hi all, > > I've been searching like mad through the docs for how to do something > that I know must be really simple. Let's say that I've added > something like that to httpd.conf: > >PerlModule Some::Application > > > ServerNamesome.application > DocumentRoot /some/non_standard/path > > > SetHandler modperl > PerlResponseHandler Some::Application > Order allow,deny > Allow from all > > > > So far, something like this has worked well for me getting my app and > up and running. However, what I need to be able to do is let someone > have a running mod_perl 2 setup and dynamically "pull in" the above > information from an external file or add that information via Perl > (in other words, I don't want to touch the default httpd.conf file). > How the heck do I do that? I'm not sure if it's what you're after, but have you thought about using an Include in your httpd.conf? Many distros now setup Apache defaultly to "Include conf.d/*" so you can "drop in" configs like this without having to muck with the original/main httpd.conf. Or are you looking for a way to share this information with cron scripts or something? - Frank Wiles <[EMAIL PROTECTED]> http://www.wiles.org -
Adding customs httpd.conf data in mod_perl 2.0
Hi all, I've been searching like mad through the docs for how to do something that I know must be really simple. Let's say that I've added something like that to httpd.conf: PerlModule Some::Application ServerNamesome.application DocumentRoot /some/non_standard/path SetHandler modperl PerlResponseHandler Some::Application Order allow,deny Allow from all So far, something like this has worked well for me getting my app and up and running. However, what I need to be able to do is let someone have a running mod_perl 2 setup and dynamically "pull in" the above information from an external file or add that information via Perl (in other words, I don't want to touch the default httpd.conf file). How the heck do I do that? Cheers, Curtis "Ovid" Poe Software Engineer Kineticode, Inc.
Adding customs httpd.conf data in mod_perl 2.0
Hi all, I've been searching like mad through the docs for how to do something that I know must be really simple. Let's say that I've added something like that to httpd.conf: PerlModule Some::Application ServerNamesome.application DocumentRoot /some/non_standard/path SetHandler modperl PerlResponseHandler Some::Application Order allow,deny Allow from all So far, something like this has worked well for me getting my app and up and running. However, what I need to be able to do is let someone have a running mod_perl 2 setup and dynamically "pull in" the above information from an external file or add that information via Perl (in other words, I don't want to touch the default httpd.conf file). How the heck do I do that? Cheers, Curtis "Ovid" Poe Software Engineer Kineticode, Inc.