RE: Apache::Reload???
That worked :) Ahh, at least I solved ONE problem! Thanks! Bryan The solution is to extend @INC at the server startup to include directories you load the files from which aren't in @INC. For example, if you have a script which loads MyTest.pm from /home/stas/myproject: use lib qw(/home/stas/myproject); require MyTest; Apache::Reload won't find this file, unless you alter @INC in startup.pl: startup.pl -- use lib qw(/home/stas/myproject); and restart the server
One more small Apache::Reload question
First, thanks to all the great suggestions, it looks like it works fine. However, now my logs are loaded with a ton of subroutine redefined warnings (which is normal I suppose?). I can certainly live with this in a development environment, but thought I would check to see if it is expected, and if it can be turned off while still enabling Reload. Thanks! Bryan
Help needed with OO and mod_perl!
Hi, I am trying to convert some of my scripts into a more oo friendly style, and use them under mod_perl. For the very simple scripts below, when I run them through the browser I get the following errors: From my apache logs: [Tue Jul 31 11:25:18 2001] null: Attempt to free unreferenced scalar at /usr/lib/perl5/site_perl/5.6.1/i686-linux/Apache/Registry.pm line 144. From my browser window: Software error: Can't call method unescape on an undefined value at /usr/lib/perl5/5.6.1/CGI.pm line 112. (I removed the CGI::Carp from the script below). This only occurs if I run this under mod_perl. In normal CGI it works fine. There must be something funky going on that I dont understand... can someone please help? Thanks, Bryan test.cgi #!/usr/bin/perl -w use TestMOD; use CGI qw(:standard); my $cmod = new TestMOD; my $q= new CGI; print $q-header(); my ($log, $lev) = $cmod-AOut(); print Log: $log, , Level: $lev; TestMOD.pm -- package TestMOD; use 5.006; use strict; use warnings; use CGI qw(:standard); use CGI::Cookie; our $VERSION = '0.01'; sub new { my $proto=shift; my $class=ref($proto) || $proto; my $self = {string=shift || }; # create a reference return bless $self, $class;# make it part of this class } sub AOut { my $self = shift; return (bryan, testpass); } 1;
Apache::Reload???
I must have missed something in setting up Apache::Reload. What I want is simple that when I make a change in my scripts I dont have to restart the Apache server... I put PerlInitHandler Apache::Reload in my httpd.conf, and added 'use Apache::Reload' to the modules that I want to be reloaded on change. But I get the following warning message in my apache logs: Apache::Reload: Can't locate MyModule.pm for every module I have added Apache::Reload to. How do I do this so it works? The docs on Reload are a bit sparse... Thanks! Bryan
Porting CGI scripts help needed
Hi, I have (happily) compiled and configured Apache with mod_perl, mod_ssl, mod_php and DSO. Whee! Now I am working on porting my scripts over... I have always used strict and perl -w, so for the most part, I think I can just pop my cgis in the /perl directory as Ive defined it in httpd.conf. However, I had to implement some trickery for my scripts a while ago via require/use and am having problems getting my scripts to work. Heres what I did: I had many scripts in one dir that shared many things; subroutines, global variables and modules. I wanted to clean things up, so I created a module called global.pm structured like this: --- use strict; ## Local parameters our $cgibin = http://path/cgi-bin;; our $htmldir = /apache/htdocs our $a = /some/path; our $b = /some/other/path; ## Common modules use CGI qw(:standard); use DBI; use Data::Table; ## Custom stuff require /path/to/custom/script1.pl; require /path/to/custom/script2.pl; 1; --- The custom stuff scripts all end in 1;, and are loaded with my custom subroutines. For example, I have one called cgi.pl, that contains all subs for cgi related tasks, i.e. checkUser(), which verifies a users cookie. Each cgi simply calls 'use global;' and then off we go. However, after moving all this stuff into /perl, none of the subs in the custom .pl files are found, I get a complaint: Undefined Subroutine Apache::ROOT::compar_2ecgi::checkUser called at . compare.cgi calls 'use global;' and then 'checkUser()'. What am I doing wrong with this? Any ideas? Thanks! Bryan
Help needed with compile
Hi, I am trying to compile Apache with a bunch of modules and DSO. I cant find any documentation that covers all of this though. perl.apache.org/guide/ give lots of combination examples, but not all. I would like to build Apache 1.3.20 with mod_ssl, mod_perl, mod_php and DSO support, and for apache, --prefix=/apachessl. Can anyone give me either a site that has explicit instructions on how to do this? Or maybe an example? Thanks! Bryan
Setup help needed
Hi, I am having trouble figuring out what is up with mod_perl. I currently have apache 1.3.20 running on RH6.2, compiled with mod_ssl, mm 1.1.3 and DSO support enabled. What is the method to install mod_perl? Is it not already included with apache 1.3.20? I may have misunderstood this... I have tried to install Apache::* via cpan, which asks me for my apache source. This would seem to indicate a reinstall of apache which Im not sure I want to do. Here's exactly what I tried, can someone tell me if this is correct? perl -MCPAN -e shell install Apache (point it to the apache source below) make openssl 2.9.6b make mm 1.1.3 configure mod_ssl with --prefix=/apachessl, --enable-rule=SHARED_CORE, paths to openssl and mm... make certificate make install... Im not sure if this is what is needed or what. Can someone please clue me in? Thanks, Bryan