mod_perl configuration
operating System: Vista ActivePerl5.10 Apache 2.2.11 mod_perl2.004 Mod_perl has been installed successfully for Perl5.10. C:\ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/mod_perl.ppd Downloading mod_perl-2.04...done Unpacking mod_perl-2.04...done Generating HTML for mod_perl-2.04...done Updating files in site area...done Downloading mod_perl-2.04 install script...done Running mod_perl-2.04 install script... The Apache2 module mod_perl.so is needed to complete the installation, and should be placed in your Apache2 modules directory. I will now fetch and install this for you. Fetching http://cpan.uwinnipeg.ca/PPMPackages/10xx/x86/mod_perl.so ... done! Where should mod_perl.so be placed? [D:/Apache2.2/modules] C:\Program Files\Apac he Software Foundation\Apache2.2\modules\ mod_perl.so has been successfully installed to C:/PROGRA~1/APACHE~1/Apache2.2/mo dules. To enable mod_perl, put in the directives LoadFile C:/Path/to/Perl/bin/perl510.dll LoadModule perl_module modules/mod_perl.so in httpd.conf. For more information, visit http://perl.apache.org/ and especially see http://perl.apache.org/docs/2.0/rename.html done But it gives the error when I adds the following line in httpd.conf? LoadModule perl_module modules/mod_perl.so Error: The request operation has failed. Is there need to add the above line in httpd.conf?
Re: mod_perl configuration
sandhya pawar wrote: mod_perl.so has been successfully installed to C:/PROGRA~1/APACHE~1/Apache2.2/modules. To enable mod_perl, put in the directives LoadFile C:/Path/to/Perl/bin/perl510.dll LoadModule perl_module modules/mod_perl.so in httpd.conf. For more information, visit http://perl.apache.org/ and especially see http://perl.apache.org/docs/2.0/rename.html done Including LoadFile prior to LoadModule? But it gives the error when I adds the following line in httpd.conf? LoadModule perl_module modules/mod_perl.so Error: The request operation has failed. What does httpd -t say? What does your error log say? What does your windows application event log say about httpd?
[mp2] accessing mod_perl configuration from another C module
I need to tap into PerlSetVar table from another C module. In mp1, you can do something like the following: #include mod_perl.h perl_dir_config *c = (perl_dir_config *) ap_get_module_config(r-per_dir_config, perl_module); table *perl_vars = c-vars; char *value = ap_table_get(perl_vars, MyPerlVar); Does anyone know the equivalent code for mp2? Thanks, Srebrenko
Re: [mp2] accessing mod_perl configuration from another C module
On 9/14/06, Srebrenko Sehic [EMAIL PROTECTED] wrote: I need to tap into PerlSetVar table from another C module. In mp1, you can do something like the following: #include mod_perl.h perl_dir_config *c = (perl_dir_config *) ap_get_module_config(r-per_dir_config, perl_module); table *perl_vars = c-vars; char *value = ap_table_get(perl_vars, MyPerlVar); Does anyone know the equivalent code for mp2? Replying to my own post. MP2 version of the above code should be: modperl_config_dir_t *c = (modperl_config_dir_t *) ap_get_module_config(r-per_dir_config, perl_module); apr_table_t *perl_vars = c-setvars; char *value = ap_table_get(perl_vars, MyPerlVar);
Re: mod_perl configuration trouble
Geoffrey Young wrote on 22.06.2005: But this does not solve my real problem, i.e. that the modules are not found when running my scripts. [Wed Jun 22 18:04:12 2005] [error] Can't locate Apache/RequestRec.pm you initially said you were using mod_perl 2.0.1. if that's true it's Apache2::RequestRec you're after, not Apache::RequestRec. see http://perl.apache.org/docs/2.0/rename.html for the gory details. That was it: If using CGI.pm you will need to upgrade to version 3.08 - versions 3.07 and older do not support the new mod_perl API. you can get CGI.pm from http://search.cpan.org/dist/CGI.pm/. I had CGI version 2.98. Now everything works. Thanks a lot, Jan -- I'd never join any club that would have the likes of me as a member. - Groucho Marx
Re: mod_perl configuration trouble
Geoffrey Young wrote on 22.06.2005: Jan Eden wrote: Hi, I recently installed mod_perl 2.0.1 as a DSO to Apache 2.0.53 (on OS X 10.3.9). The simple example from the docs works: Can't locate loadable object for module Apache::Constants in @INC Can't load Perl module Apache::Registry for server 127.0.0.1:0, exiting... Apache::Registry is for mod_perl 1.0/Apache 1.3.X, ModPerl::Registry is for mod_perl 2.0/Apache 2.X.X, and you cannot run one within the other's environment. Another - related - question: Is ModPerl::Registry the successor to Apache::Registry? The manpages can be interpreted like that. essentially yes, insofar as mod_perl 2.0 is the successor of mod_perl 1.0. Thanks, that's what I thought. Before I ran make install, make test did not find the startup.pl used for testing - or the TestApache:: modules, for that matter that is very odd. if you can reliably reproduce that please file a proper bug report: I am always hesitant to file a bug report before having made absolutely sure that the mistake is not mine. This is the last part of the output of make test: using Apache/2.0.53 (prefork MPM) waiting 120 seconds for server to start: .[Wed Jun 22 17:20:47 2005] [info] 6 Apache2:: modules loaded [Wed Jun 22 17:20:47 2005] [info] 0 APR:: modules loaded [Wed Jun 22 17:20:47 2005] [info] base server + 27 vhosts ready to run tests ..[Wed Jun 22 17:20:49 2005] [error] Insecure directory in $ENV{PATH} while running with -T switch at /Users/jan/Documents/temporaer/Downloads/mod_perl-2.0.1/Apache-Test/lib/Apache/TestConfig.pm line 1059.\nCompilation failed in require at /Users/jan/Documents/temporaer/Downloads/mod_perl-2.0.1/t/conf/modperl_startup.pl line 17.\n\t...propagated at /Users/jan/Documents/temporaer/Downloads/mod_perl-2.0.1/t/conf/modperl_startup.pl line 18.\nBEGIN failed--compilation aborted at /Users/jan/Documents/temporaer/Downloads/mod_perl-2.0.1/t/conf/modperl_startup.pl line 20.\nCompilation failed in require at (eval 2) line 1.\n [Wed Jun 22 17:20:49 2005] [error] Can't load Perl file: /Users/jan/Documents/temporaer/Downloads/mod_perl-2.0.1/t/conf/modperl_startup.pl for server localhost:8529, exiting... Does this give you any hint about what is going on? Thanks, Jan -- How many Microsoft engineers does it take to screw in a lightbulb? None. They just redefine dark as the new standard.
Re: mod_perl configuration trouble
Also, PerlHandler was replaced with PerlResponseHandler in 2.0. PerlResponseHandler ModPerl::Registry It's kind of tough learning mod_perl right now, because all the books give 1.0 examples, and 2.0 seems to have a lot of small differences. The docs at perl.apache.org are a good reference. Here's a page that covers some of the 1.0 - 2.0 differences: http://perl.apache.org/docs/2.0/user/porting/compat.html#C_Apache__Registry___C_Apache__PerlRun__and_Friends -Joe On Wed, 22 Jun 2005, Geoffrey Young wrote: Jan Eden wrote: Hi, I recently installed mod_perl 2.0.1 as a DSO to Apache 2.0.53 (on OS X 10.3.9). The simple example from the docs works: Can't locate loadable object for module Apache::Constants in @INC Can't load Perl module Apache::Registry for server 127.0.0.1:0, exiting... Apache::Registry is for mod_perl 1.0/Apache 1.3.X, ModPerl::Registry is for mod_perl 2.0/Apache 2.X.X, and you cannot run one within the other's environment. Another - related - question: Is ModPerl::Registry the successor to Apache::Registry? The manpages can be interpreted like that. essentially yes, insofar as mod_perl 2.0 is the successor of mod_perl 1.0. Before I ran make install, make test did not find the startup.pl used for testing - or the TestApache:: modules, for that matter that is very odd. if you can reliably reproduce that please file a proper bug report: http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems --Geoff
Re: mod_perl configuration trouble
Joe Cullin wrote on 22.06.2005: Also, PerlHandler was replaced with PerlResponseHandler in 2.0. PerlResponseHandler ModPerl::Registry It's kind of tough learning mod_perl right now, because all the books give 1.0 examples, and 2.0 seems to have a lot of small differences. The docs at perl.apache.org are a good reference. Here's a page that covers some of the 1.0 - 2.0 differences: Right, I am already flipping through the online docs - my boss wants the transition to be in finished quickly (as always). At least all the scripts are written in a strict fashion and I hope I don't have to change anything there. Now if I can only get that @INC problem solved, I am happy. Thanks for the link, Jan -- He who would give up a little liberty in return for a little security deserves neither liberty nor security. - Benjamin Franklin
Re: mod_perl configuration trouble
Geoffrey Young wrote on 22.06.2005: ..[Wed Jun 22 17:20:49 2005] [error] Insecure directory in $ENV{PATH} while running with -T switch clean up your path and you should be ok - this is keeping Apache::Test* from loading properly. in other words, it's not that it can't find the modules it needs, they just can't load because something funky is in your $ENV{PATH}. I saw that just after sending the message and - it works. Most tests ran just fine, except for some denied permission errors and some skipped tests due to missing modules (which is expected with an empty path). But this does not solve my real problem, i.e. that the modules are not found when running my scripts. [Wed Jun 22 18:04:12 2005] [error] Can't locate Apache/RequestRec.pm Now this one is true, there is no module Apache::RequestRec anywhere in my path - but I have no idea why and why it wasn't installed. Thanks, Jan -- I was gratified to be able to answer promptly, and I did. I said I didn't know. - Mark Twain
Re: mod_perl configuration trouble
But this does not solve my real problem, i.e. that the modules are not found when running my scripts. [Wed Jun 22 18:04:12 2005] [error] Can't locate Apache/RequestRec.pm you initially said you were using mod_perl 2.0.1. if that's true it's Apache2::RequestRec you're after, not Apache::RequestRec. see http://perl.apache.org/docs/2.0/rename.html for the gory details. --Geoff
Re: mod_perl configuration trouble
Jan Eden wrote on 22.06.2005: Geoffrey Young wrote on 22.06.2005: ..[Wed Jun 22 17:20:49 2005] [error] Insecure directory in $ENV{PATH} while running with -T switch clean up your path and you should be ok - this is keeping Apache::Test* from loading properly. in other words, it's not that it can't find the modules it needs, they just can't load because something funky is in your $ENV{PATH}. I saw that just after sending the message and - it works. Most tests ran just fine, except for some denied permission errors and some skipped tests due to missing modules (which is expected with an empty path). But this does not solve my real problem, i.e. that the modules are not found when running my scripts. [Wed Jun 22 18:04:12 2005] [error] Can't locate Apache/RequestRec.pm Now this one is true, there is no module Apache::RequestRec anywhere in my path - but I have no idea why and why it wasn't installed. Followup: I do have Apache2::RequestRec, and the error occurs only when certain modules are used in a script (DBI works, CGI does not). Strange. Best, Jan -- He who would give up a little liberty in return for a little security deserves neither liberty nor security. - Benjamin Franklin