aw at ice-sa
May 17, 2011, 3:57 PM
Post #10 of 13
Fred Moyer wrote:
> On Tue, May 17, 2011 at 3:22 PM, Tom Kane <t.kane [at] mindspring> wrote:
>> Now, I have another issue: I have created a startup.pl file and placed it into the conf.d
>> directory. However, when I restart apache2 I get an error message to the effect that the first
>> 'use' statement is a syntax error. I'm sure that my problem lies in my confusion as to (1) where
>> to point ServerRoot, and (2) where I'm supposed to put my perl scripts. These are all pretty
>> elementary, I suppose, but if anyone can shed any light, I will be very appreciative.
> You should have a line in your httpd.conf that looks something like
> this. If not, you will need to add it.
> PerlPostConfigRequire /etc/apache2/conf.d/startup.pl
I think that's a bit confused (and confusing).
Under Ubuntu/Debian, the directory /etc/apache2/conf.d is meant to contain bits of
configuration which *apache* reads and interprets. So whatever is in there, should not be
perl scripts. It should be Apache directives, like inside httpd.conf.
(And that is also why you get (from Apache) that error about "use" being an invalid
directive. It is, for Apache, which does not understand perl.)
Place your perl startup.pl script somewhere else (for example directly in /etc/apache2),
and then, in /etc/apache2/conf.d, create a file with the single text line :
Now, let's mentally reboot and think about the future :
Later, you are (also) going to need a place to put your own mod_perl modules (the ones you
are going to create).
So I suggest to create a directory for that, for example : /usr/local/lib/modperl, and
make it readable and "executable" by the user under wich Apache runs (www-data ?).
Then, place your startup.pl script there.
Then, in /etc/apache2/conf.d, place a file (or modify the above file) with the line :
and in your startup.pl script, add a line
use lib "/usr/local/lib/modperl";
and restart Apache.
After that, you can place all your newly-developed perl modules inside the directory
/usr/local/lib/modperl, and Apache/mod_perl will find them.