Re: Apache2::Reload - Very fickle, or is it just me?
Hmm, I see. Interesting points, all noted. I also just realized it might have to do with which of the many apache children get which requests and when. I'm hoping that setting MaxRequestsPerChild to something like 1 or 2 (as opposed to the default 1) will help ease the pain. -Patrick P.S. Sorry about that duplication David, I forgot to send to the list. David Ihnen wrote: My experience troubleshooting this kind of issue has indicated that its likely that the package that was unloaded deleted a value stored in the package space of the module reloaded (probably set at BEGIN block time) that the subsequent require did not restore. When these errors happen the thread may die, which may explain why several reloads don't work - but eventually you've killed each of the threads that were running, and the new ones initialize fresh and normal. David Patrick Rutkowski wrote: I'm currently using Apache2::Reload on a development machine, but I can't for the life of me figure out what it's doing and why. I'm coming across weird behavior such as the following just about every 5 minutes: 1. Have a perfectly working page. 2. Change some `print "foo"` to `print "bar"` (completely trivial) 3. Reload the page only to get an error message back (presumably Apache2::Reload reloaded the .pm and the new version has errors). 5. Check the .pm with perl -c, it turns out that my completely trivial change did NOT introduce errors. 6. Scratch head... 7. Reload the page 3 more times, with the same error coming back every time. 8. Reload a 4th time, and this time get a different error. 9. Reload a 5th time, and have it work (for good). I'M SO CONFUSED! :-( -Patrick What exactly does this mean anyway? Aborted why? === Attempt to reload WSS/User.pm aborted === Error during compilation of /home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html: Attempt to reload WSS/User.pm aborted. Compilation failed in require at /home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html line 14. Stack: [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:811] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:441] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm:246] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm:211] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:97] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/Class/Container.pm:275] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/Class/Container.pm:353] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:348] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:868] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:822] [(eval 34):8] [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] BEGIN failed--compilation aborted at /home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html line 14. Stack: [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:811] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:441] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm:246] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm:211] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:97] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/Class/Container.pm:275] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/Class/Container.pm:353] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:348] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:868] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:822] [(eval 34):8] [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] Trace begun at /home/rutski/Documents/projects/wss/install/local/perl/lib/site_pe
Re: Apache2::Reload - Very fickle, or is it just me?
I forgot to send the httpd.conf, sorry about that. == LoadModule perl_module modules/mod_perl.so TypesConfig /etc/mime.types ServerName ubuntu Listen 80 User rutski Grouprutski DocumentRoot "/home/rutski/Documents/projects/wss/install/apache/htdocs" PerlSwitches -I/home/rutski/Documents/projects/wss/install/apache/lib PerlModule Apache2::Reload PerlModule CGI SetHandler perl-script PerlInitHandler Apache2::Reload PerlHandler HTML::Mason::ApacheHandler PerlSetVar MasonDataDir "/home/rutski/Documents/projects/wss/install/apache/mason" PerlSetVar MasonCompRoot "/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic" ====== Patrick Rutkowski wrote: I'm currently using Apache2::Reload on a development machine, but I can't for the life of me figure out what it's doing and why. I'm coming across weird behavior such as the following just about every 5 minutes: 1. Have a perfectly working page. 2. Change some `print "foo"` to `print "bar"` (completely trivial) 3. Reload the page only to get an error message back (presumably Apache2::Reload reloaded the .pm and the new version has errors). 5. Check the .pm with perl -c, it turns out that my completely trivial change did NOT introduce errors. 6. Scratch head... 7. Reload the page 3 more times, with the same error coming back every time. 8. Reload a 4th time, and this time get a different error. 9. Reload a 5th time, and have it work (for good). I'M SO CONFUSED! :-( -Patrick What exactly does this mean anyway? Aborted why? === Attempt to reload WSS/User.pm aborted === Error during compilation of /home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html: Attempt to reload WSS/User.pm aborted. Compilation failed in require at /home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html line 14. Stack: [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:811] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:441] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm:246] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm:211] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:97] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/Class/Container.pm:275] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/Class/Container.pm:353] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:348] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:868] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:822] [(eval 34):8] [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] BEGIN failed--compilation aborted at /home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html line 14. Stack: [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:811] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:441] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm:246] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm:211] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:97] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/Class/Container.pm:275] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/Class/Container.pm:353] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:348] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:868] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:822] [(eval 34):8] [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] Trace begun at /home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm line 845 HTML::Mason::Interp::_compilation_error('HTML::Mason::Interp=HASH(0x91acc90)
Apache2::Reload - Very fickle, or is it just me?
I'm currently using Apache2::Reload on a development machine, but I can't for the life of me figure out what it's doing and why. I'm coming across weird behavior such as the following just about every 5 minutes: 1. Have a perfectly working page. 2. Change some `print "foo"` to `print "bar"` (completely trivial) 3. Reload the page only to get an error message back (presumably Apache2::Reload reloaded the .pm and the new version has errors). 5. Check the .pm with perl -c, it turns out that my completely trivial change did NOT introduce errors. 6. Scratch head... 7. Reload the page 3 more times, with the same error coming back every time. 8. Reload a 4th time, and this time get a different error. 9. Reload a 5th time, and have it work (for good). I'M SO CONFUSED! :-( -Patrick What exactly does this mean anyway? Aborted why? === Attempt to reload WSS/User.pm aborted === Error during compilation of /home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html: Attempt to reload WSS/User.pm aborted. Compilation failed in require at /home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html line 14. Stack: [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:811] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:441] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm:246] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm:211] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:97] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/Class/Container.pm:275] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/Class/Container.pm:353] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:348] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:868] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:822] [(eval 34):8] [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] BEGIN failed--compilation aborted at /home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html line 14. Stack: [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:811] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:441] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm:246] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm:211] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:97] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/Class/Container.pm:275] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/Class/Container.pm:353] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm:348] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:868] [/home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/ApacheHandler.pm:822] [(eval 34):8] [/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html:14] Trace begun at /home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm line 845 HTML::Mason::Interp::_compilation_error('HTML::Mason::Interp=HASH(0x91acc90)', '/home/rutski/Documents/projects/wss/install/apache/htdocs/dynamic/sign_up.html', 'HTML::Mason::Exception::Compilation=HASH(0x932e308)') called at /home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Interp.pm line 445 HTML::Mason::Interp::load('HTML::Mason::Interp=HASH(0x91acc90)', '/sign_up.html') called at /home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm line 246 eval {...} at /home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm line 231 HTML::Mason::Request::_initialize('HTML::Mason::Request::ApacheHandler=HASH(0x9330478)') called at /home/rutski/Documents/projects/wss/install/local/perl/lib/site_perl/5.10.0/HTML/Mason/Request.pm line 211 HTML::Mason::Request::new('HTML::Mason::Request::ApacheHandler', 'error_mode', 'output', '
t/apr-ext/*.t all fail
Are the t/apr-ext/*.t tests supposed to fail? No matter how hard to try I always get this on OpenBSD 3.9 with perl 5.8.8, Apache-2.2.2 and mod_perl-2: Failed Test Stat Wstat Total Fail Failed List of Failed --- t/apache/content_length_header.t 271 3.70% 17 t/api/status.t 62 33.33% 4-5 t/apr-ext/base64.t 011 36 200.00% 1-3 t/apr-ext/brigade.t 2 512?? ?? % ?? t/apr-ext/bucket.t 2 512?? ?? % ?? t/apr-ext/date.t01114 28 200.00% 1-14 t/apr-ext/finfo.t 2 512?? ?? % ?? t/apr-ext/pool.t2 512?? ?? % ?? t/apr-ext/string.t 011 5 10 200.00% 1-5 t/apr-ext/table.t 2 512?? ?? % ?? t/apr-ext/threadmutex.t 2 512?? ?? % ?? t/apr-ext/uri.t 2 512?? ?? % ?? t/apr-ext/util.t011 48 200.00% 1-4 t/apr-ext/uuid.t011 34 133.33% 2-3 8 tests skipped. Failed 14/231 test scripts, 93.94% okay. 31/2049 subtests failed, 98.49% okay. [warning] server localhost.my.domain:8529 shutdown [ error] error running tests (please examine t/logs/error_log) ++ | Please file a bug report: http://perl.apache.org/bugs/ | ++ They all fail with errors such as: t/apr-ext/brigade.../home/rutski89/opt/perl/bin/ perl:/home/rutski89/opt/kit/mod_perl-2.0.2/blib/arch/auto/APR/Pool/ Pool.so: undefined symbol 'apr_pool_cleanup_null' Can't load '/home/rutski89/opt/kit/mod_perl-2.0.2/blib/arch/auto/APR/ Pool/Pool.so' for module APR::Pool: Cannot load specified object at / home/rutski89/opt/perl/lib/5.8.8/OpenBSD.i386-openbsd/DynaLoader.pm line 230. at /home/rutski89/opt/kit/mod_perl-2.0.2/blib/lib/APR/XSLoader.pm line 30 Compilation failed in require at /home/rutski89/opt/kit/ mod_perl-2.0.2/t/lib/TestAPRlib/brigade.pm line 14. BEGIN failed--compilation aborted at /home/rutski89/opt/kit/ mod_perl-2.0.2/t/lib/TestAPRlib/brigade.pm line 14. Compilation failed in require at t/apr-ext/brigade.t line 7. BEGIN failed--compilation aborted at t/apr-ext/brigade.t line 7. Note that the t/apr/*.t tests all pass, it's the t/apr-ext/*.t test that are all failing. I tried this on Debian and it worked without errors, these errors seem to occur only when I do this on OpenBSD, but I can't even begin to imagine why.
Serious mod_perl-2 test issues
I'm compiling Apache-2.2.2 with mod_perl-2 on OpenBSD 3.9 as well as a with a manually compiled perl-5.8.8. The issues I'm having is at the mod_perl test suite, these are the results: ~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~! ~!~!~!~!~!~!~!~!~!~!~ Failed Test Stat Wstat Total Fail Failed List of Failed --- t/apache/content_length_header.t 271 3.70% 17 t/api/status.t 62 33.33% 4-5 t/apr-ext/base64.t 011 36 200.00% 1-3 t/apr-ext/brigade.t 2 512?? ?? % ?? t/apr-ext/bucket.t 2 512?? ?? % ?? t/apr-ext/date.t01114 28 200.00% 1-14 t/apr-ext/finfo.t 2 512?? ?? % ?? t/apr-ext/pool.t2 512?? ?? % ?? t/apr-ext/string.t 011 5 10 200.00% 1-5 t/apr-ext/table.t 2 512?? ?? % ?? t/apr-ext/threadmutex.t 2 512?? ?? % ?? t/apr-ext/uri.t 2 512?? ?? % ?? t/apr-ext/util.t011 48 200.00% 1-4 t/apr-ext/uuid.t011 34 133.33% 2-3 8 tests skipped. Failed 14/231 test scripts, 93.94% okay. 31/2048 subtests failed, 98.49% okay. [warning] server localhost.rutski89.com:8529 shutdown [ error] error running tests (please examine t/logs/error_log) ++ | Please file a bug report: http://perl.apache.org/bugs/ | ++ *** Error code 1 Stop in /opt/kit/mod_perl-2.0.2 (line 1098 of Makefile). ~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~! ~!~!~!~!~!~!~!~!~!~!~ I looked into t/api/status.t and t/apache/content_length_header.t, and the errors there are not to game breaking, so I'll let them slide. What I am worried about however are all the failed t/apr-ext tests. Here is a snippet showing how these t/apr-ext tests fail because of this strange undefined symbol issues. ~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~! ~!~!~!~!~!~!~!~!~!~!~ t/apr-ext/brigade.../opt/perl/bin/perl:/opt/kit/ mod_perl-2.0.2/blib/arch/auto/APR/Pool/Pool.so: undefined symbol 'apr_pool_cleanup_null' Can't load '/opt/kit/mod_perl-2.0.2/blib/arch/auto/APR/Pool/Pool.so' for module APR::Pool: Cannot load specified object at /opt/perl/lib/ 5.8.8/OpenBSD.i386-openbsd/DynaLoader.pm line 230. at /opt/kit/mod_perl-2.0.2/blib/lib/APR/XSLoader.pm line 30 Compilation failed in require at /opt/kit/mod_perl-2.0.2/t/lib/ TestAPRlib/brigade.pm line 14. BEGIN failed--compilation aborted at /opt/kit/mod_perl-2.0.2/t/lib/ TestAPRlib/brigade.pm line 14. Compilation failed in require at t/apr-ext/brigade.t line 7. BEGIN failed--compilation aborted at t/apr-ext/brigade.t line 7. ~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~! ~!~!~!~!~!~!~!~!~!~!~ I get the same types of errors for each other t/apr-ext/ test as well, but I didn't feel the need to post them all. The test t/apr-ext/uuid.t says: # XXX: only when apr-config is found APR will be linked against # libapr/libaprutil, probably need a more intuitive method for this # prerequisite # also need to check whether we build against the source tree, in # which case we APR.so won't be linked against libapr/libaprutil After reading this I ran an ldd on /opt/apache2/httpd (my manually compiled version of apache) and saw that it was liking against the system's APR, and not it's own. AHAH! I thought. I thought the solution would be to build apr and apr-util from source as dictated in the apr/apr-util >= 1.2 section in these docs: http:// httpd.apache.org/docs/2.2/install.html So I did, and then I configured and built and tested mod_perl-2 with: perl Makefile.PL MP_APXS=/opt/apache2/bin/apxs MP_APR_CONFIG=/opt/apr/ bin/apr-1-config && make && make test But alas, I got the same unresolved symbol errors on the "make test" part. What in the world am I supposed to do to fix this? I'm totally at a loss :-( Patrick R.
Re: Error- Attempting to Build Apache with mod_perl, no luck
Follow the steps in the section entitled "Installing mod_perl with mod_ssl (+openssl)" on http://modperlbook.org/html/ch03_06.html to the letter and everything should work out smoothly. Also, consider using Apache 2.2.2 and mod_perl-2 instead. Lastly, buy this book: http://www.oreilly.com/catalog/pmodperl/ or optionally read it online: http://modperlbook.org/index.html Patrick R. On Jun 11, 2006, at 6:16 PM, John Ian Simeon wrote: Hello! I'm attempting to build Apache with mod_perl and mod_ssl by hand. mod_ssl seems to have integrated nicely with the build process. However, upon compiling the mod_perl module, make fails. Here is the command I used to configure mod_perl: perl Makefile.PL \ EVERYTHING=1 \ APACHE_SRC=../apache_1.3.36/src \ USE_APACI=1 \ PREP_HTTPD=1 \ DO_HTTPD=1 While in /usr/src/apache_1.3.36, here is the command I used to configure Apache: SSL_BASE=SYSTEM ./configure --prefix=/usr --with-layout=GNU -- sysconfdir=/etc/apache --libexecdir=/usr/libexec/apache -- localstatedir=/usr/var/apache --runtimedir=/var/apache/ -- logfiledir=/var/log/apache --includedir=/usr/include/apache -- proxycachedir=/var/www/cache --datadir=/var/www --enable- module=all --enable-module=ssl --activate-module=src/modules/perl/ libperl.a --enable-module=perl --enable-shared=max --enable-suexec --suexec-caller=nobody The error regarding mod_perl while in the make program is as follows: ===> src/modules/perl gcc -I. -I../../include -I../../include/regex -I../../include/../ - DLINUX=22 -DHAVE_SET_DUMPABLE -DMOD_SSL=208127 -DMOD_PERL - DUSE_HSREGEX -DEAPI `../apaci` -I`/usr/bin/perl -MConfig -e 'print $Config{archlibexp}'`/CORE `/usr/bin/perl '-MApache::ExtUtils=% Config' -e 'print $Config{ccflags}'` -DNO_PERL_DISPATCH - DNO_PERL_POST_READ_REQUEST -DNO_PERL_TRANS -DNO_PERL_HEADER_PARSER - DNO_PERL_ACCESS -DNO_PERL_AUTHEN -DNO_PERL_AUTHZ -DNO_PERL_TYPE - DNO_PERL_FIXUP -DNO_PERL_LOG -DNO_PERL_INIT -DNO_PERL_CLEANUP - DNO_PERL_RESTART -DNO_PERL_STACKED_HANDLERS -DNO_PERL_SECTIONS - DNO_PERL_METHOD_HANDLERS -DNO_PERL_SSI -DMOD_PERL_VERSION=\"1.29 \" -c -o mod_perl_opmask.o mod_perl_opmask.c /bin/sh: line 1: ../apaci: No such file or directory In file included from ../../include/httpd.h:29, from apache_inc.h:120, from mod_perl.h:162, from mod_perl_opmask.c:1: ../../include/ap_config.h:73:16: error: os.h: No such file or directory make[4]: *** [mod_perl_opmask.o] Error 1 make[3]: *** [all] Error 1 make[2]: *** [subdirs] Error 1 make[2]: Leaving directory `/usr/src/apache_1.3.36/src' make[1]: *** [build-std] Error 2 make[1]: Leaving directory `/usr/src/apache_1.3.36' make: *** [build] Error 2 I'm really at my wits end trying to figure out why it won't work. I hope someone here can help! Thanks!
Re: Sessions with mod_perl2
There is a plethora of different ways to handle sessions in perl driven websites. I'll throw in my 2 cents by describing how I've always liked to do it. My solution assumes that your using an SQL database for persistent data storage; but that obviously isn't a requirement, there are a lot of ways to manage persistent data. I also assume that your using mod_perl-2. 1) Use libapreq2's Apache2::Cookie to give the client a cookie such as "SID=57de5d0d-8315-0410-9c71-f10f4dd80f37" where 57de5d0d-8315-0410-9c71-f10f4dd80f37 is a UUID generated by libapreq2's APR::UUID module. Three cheers for libapreq2! :-) Subsequently store the UUID into a database. 2) Check for a session cookie when a client connects to the site, again using libapreq2's Apache2::Cookie. If a session cookie exists, use a short and sweet SQL statement (via DBI of course) to fetch the session data from the back-end database and then a subsequent statement to store the fetched data in various variables for the rest site's code to use. 3) Have a single subroutine named, for example, store_session_data called with arguments such as store_session_data(UUID=> "57de5d0d-8315-0410-9c71-f10f4dd80f37" username => "rutski89", favorite_color => "blue", auto_login => "yes") which then does on the fly construction of an SQL statement to insert the session data into the database. It's a step up from using CGI::Cookie in terms of the amount of work you have to do, but it's not too hard to implement. Personally, I enjoy the extra level of control over back-end storage. Patrick R. On Jun 6, 2006, at 4:48 PM, Matthew wrote: It could be that I just don't understand completely the nature of mod_perl, but here goes. Reason I'm confused is because there exists CGI::Cookie for handling cookies in MP2, but there's also the libapreq library "for MP2". It seems to me that the apreq lib is more "MP2 Native" than CGI would be. Am I wrong? Are they equally 'native' ? With that in mind, I'm looking for some module, that I'm sure exists, that can manage sessions. I found Apache::Session but I couldn't tell if it was MP2 native. Is there something else I should be using for sessions that is 'better' with MP2? Thanks, Matthew
use warnings logging
This post is in the context of mod_perl-2 handler's such as PerlResponseHandler MyModule::handler().When "use strict" in one of my modules has something to complain about it puts an error message into the vhosts's error log as any good warnings/errors module should, for example /www/addons/logs/error_log. However "use warnings" in my handler's likes to put all of it's message into the server's global error_log, which is /opt/apache/logs/error_log. This is obviously very unsuitable since error messages from multiple vhosts will go into the same log file! Madness!There has to be a way to fix this, but how?Patrick R.