Re: Ubuntu and mod_perl

2011-05-17 Thread Jeff Trawick
On Tue, May 17, 2011 at 8:25 PM, silent  wrote:
> you have compiled and installed one apache, and you made it start at boot 
> time,
> you must disable it or remove it ( do not let it start at boot time )
>
> 2011/5/18 Tom Kane :
>> I tried to incorporate suggestions I've received. After restarting apache2, 
>> this is what happened:
>>
>>
>> tomkane@sfq:~$ /etc/init.d/apache2 start
>>  * Starting web server apache2
>> [Tue May 17 20:12:34 2011] [warn] module perl_module is already loaded, 
>> skipping
>> (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80

sudo /etc/init.d/apache2 start

(or restart if already running)


Re: Ubuntu and mod_perl

2011-05-17 Thread silent
you have compiled and installed one apache, and you made it start at boot time,
you must disable it or remove it ( do not let it start at boot time )

2011/5/18 Tom Kane :
> I tried to incorporate suggestions I've received. After restarting apache2, 
> this is what happened:
>
>
> tomkane@sfq:~$ /etc/init.d/apache2 start
>  * Starting web server apache2
> [Tue May 17 20:12:34 2011] [warn] module perl_module is already loaded, 
> skipping
> (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
> no listening sockets available, shutting down
> Unable to open logs
>                                                     [fail
>
>
> Now apache2 won't even start. It's not as if my network address is gone 
> because I see it's still there at boot time. I'm going a little daft now. 
> It's not as if I haven't seen a message like this before, but I've forgotten 
> what to do about it. Any suggestions?
>
> Once again, I want to thank everyone for their suggestions.
>
> Tom
>


Re: Ubuntu and mod_perl

2011-05-17 Thread André Warnier

Fred Moyer wrote:

On Tue, May 17, 2011 at 3:22 PM, Tom Kane  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 :


PerlPostConfigRequire /etc/apache2/startup.pl

---

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 :

PerlPostConfigRequire /usr/local/lib/modperl/startup.pl

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.





RE: Ubuntu and mod_perl

2011-05-17 Thread Lloyd Richardson
If you are looking to run something on apache startup: 

PerlRequire /path/to/startup.pl



-Original Message-
From: Tom Kane [mailto:t.k...@mindspring.com] 
Sent: Tuesday, May 17, 2011 5:23 PM
To: modperl@perl.apache.org
Subject: Ubuntu and mod_perl

Thanks for all of the help. Just to let everyone know, it was embarrassing how 
simple it was to install mod_perl with the suggestions that I received from 
Cosimo Streppone earlier in the day. I didn't know that the apt-get and a2enmod 
steps were available as the perl.apache2.org mod_perl 2 documentation said I 
had to build both apache2 and mod_perl from the latest source from scratch. 
(Admittedly, I may have read too many assumptions into that.)

I will say that the "apt-get install" on apache2 did nothing as everything was 
already there on my system. The "apt-get install" on mod_perl did download a 
fair amount, however. And, thankfully, when I restarted apache2 after the 
a2enmod steps, I saw that mod_perl was indeed running. 

Had I only known the above steps, I'd have saved several days on the build 
process -- days that I would have much preferred applying to my application.

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.

Tom


Re: Ubuntu and mod_perl

2011-05-17 Thread Fred Moyer
On Tue, May 17, 2011 at 3:22 PM, Tom Kane  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


Re: Ubuntu and mod_perl

2011-05-17 Thread Fred Moyer
On Tue, May 17, 2011 at 2:05 PM, André Warnier  wrote:
> But if your main aim is not the installation of apache and mod_perl, then I
> would recommend to both, to use the software packaging system of your
> respective flavors of Linux, to install Apache, perl and mod_perl using
> these pre-packaged versions.
> That will take just a few minutes, and will work without having to spend
> hours resolving dependencies, fixing missing links (maybe wrongly), and
> creating your own startup scripts.
>
> And the hours you save will then be available for achieving your main goal.

This, a thousand times this.


Re: Ubuntu and mod_perl

2011-05-17 Thread André Warnier

Tom Kane wrote:

I'm still a little new at responding to mail lists. Here is an email that I 
sent directly in a reply to Marco. I thought that it should be shared:

Marco,

I had to do the following just the other day:

sudo ln -sf /usr/lib/libperl.so.5.10.1 /usr/lib/libperl.so

That got me over the hurdle that occurred because of the missing symbolic link 
to perl. I also had to do the following:

sudo ln -sf /usr/lib/libgdbm.so.3.0.0 /usr/lib/libgdbm.so

The libgdbm issue actually occurred prior to the perl problem.

I hope this helps. I am now trying to find the settings for mod_perl in the 
/etc/apache2 configuration. My startup.pl file returns an error message that I 
can't use 'use'.

Tom



Maybe as a tip to both Tom and Marco :

It all depends if your focus is on installing apache and perl and mod_perl, or rather on 
just using them to achieve another main goal.


But if your main aim is not the installation of apache and mod_perl, then I would 
recommend to both, to use the software packaging system of your respective flavors of 
Linux, to install Apache, perl and mod_perl using these pre-packaged versions.
That will take just a few minutes, and will work without having to spend hours resolving 
dependencies, fixing missing links (maybe wrongly), and creating your own startup scripts.


And the hours you save will then be available for achieving your main goal.



Re: Ubuntu and mod_perl

2011-05-17 Thread William A. Rowe Jr.
On 5/17/2011 3:39 PM, Tom Kane wrote:
> I'm still a little new at responding to mail lists. Here is an email that I 
> sent directly in a reply to Marco. I thought that it should be shared:
> 
> Marco,
> 
> I had to do the following just the other day:
> 
> sudo ln -sf /usr/lib/libperl.so.5.10.1 /usr/lib/libperl.so
> 
> That got me over the hurdle that occurred because of the missing symbolic 
> link to perl. I also had to do the following:
> 
> sudo ln -sf /usr/lib/libgdbm.so.3.0.0 /usr/lib/libgdbm.so
> 
> The libgdbm issue actually occurred prior to the perl problem.
> 
> I hope this helps. I am now trying to find the settings for mod_perl in the 
> /etc/apache2 configuration. My startup.pl file returns an error message that 
> I can't use 'use'.

Tom, it seems you are missing gdbm-devel and perl-devel packages.  To get
the appropriate .a/.so/.h files, you usually have to add -devel (or -dev)
flavors of various system components to build new software against them.


Re: Ubuntu and mod_perl

2011-05-17 Thread Cosimo Streppone

On Wed, 18 May 2011 00:05:46 +1000, Tom Kane  wrote:


I now want to add mod_perl (in the .so form) to apache2.
[...]
I am still new in the Unix/Linux environment -- at least from the  
standpoint of installing systems software -- so I am sure I am missing  
something.


Hi Tom,

if you don't need to compile the software yourself,
and you're just starting, I would suggest an easy path:

  # Install the relevant packages
  sudo apt-get install apache2 apache2-mpm-prefork
  sudo apt-get install libapache2-mod-perl2 libapache2-mod-apreq2

  # Enable the apreq and mod perl modules
  a2enmod apreq
  a2enmod perl

  # Restart apache
  /etc/init.d/apache2 restart

--
Cosimo