Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

Ubuntu and mod_perl

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


t.kane at mindspring

May 17, 2011, 7:05 AM

Post #1 of 13 (5032 views)
Permalink
Ubuntu and mod_perl

I have just created a new system with Ubuntu LTS 10.04. Everything there is working smoothly. I have apache2 loading and running automatically when I boot.

I now want to add mod_perl (in the .so form) to apache2. I have faithfully followed the mod_perl 2 installation directions in the documentation from perl.apache.org. The builds were with httpd-2.2.18.tar.gz and mod_perl-2.0-current.tar.gz. All tests ran cleanly. 'make install' worked for both mod_perl and apache2.

[.Aside: I am aware that some confusion exists in nomenclature due to Debian/Ubuntu using different names for things, e.g., they refer to httpd.conf as apache2.conf. Note that the mod_perl build did create a file named 'httpd.conf' in one of my subdirectories.]

The build of the apache2 and mod_perl modules went into the directory:

/home/tomkane/httpd

in their respective subdirectories as the build directions suggested. However, when I restart my server I still see apache2 version 2.2.14 running (it came with the Ubuntu installation).

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. I took the installation directions literally as I didn't really know how to read between the lines as more experienced folks would have done.

I think I need to copy the apache2 executable for version 2.2.18 (at the very least) to the directory:

/usr/lib/apache2/mpm-prefork/apache2

but I am not sure. I may need to copy a lot more files as well but don't feel secure enough to try that.

Can anyone point me toward the missing piece(s)? (Note: The Ubuntu server forum seems devoid of mod_perl knowledge.)

Thanks.

Tom Kane


cosimo at streppone

May 17, 2011, 7:16 AM

Post #2 of 13 (5009 views)
Permalink
Re: Ubuntu and mod_perl [In reply to]

On Wed, 18 May 2011 00:05:46 +1000, Tom Kane <t.kane [at] mindspring> 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


t.kane at mindspring

May 17, 2011, 1:39 PM

Post #3 of 13 (4987 views)
Permalink
Ubuntu and mod_perl [In reply to]

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


wrowe at rowe-clan

May 17, 2011, 1:57 PM

Post #4 of 13 (4992 views)
Permalink
Re: Ubuntu and mod_perl [In reply to]

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.


aw at ice-sa

May 17, 2011, 2:05 PM

Post #5 of 13 (4987 views)
Permalink
Re: Ubuntu and mod_perl [In reply to]

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.


fred at redhotpenguin

May 17, 2011, 2:07 PM

Post #6 of 13 (4987 views)
Permalink
Re: Ubuntu and mod_perl [In reply to]

On Tue, May 17, 2011 at 2:05 PM, Andrť Warnier <aw [at] ice-sa> 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.


t.kane at mindspring

May 17, 2011, 3:22 PM

Post #7 of 13 (4987 views)
Permalink
Ubuntu and mod_perl [In reply to]

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


fred at redhotpenguin

May 17, 2011, 3:33 PM

Post #8 of 13 (4986 views)
Permalink
Re: Ubuntu and mod_perl [In reply to]

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


lloyd at protectchildren

May 17, 2011, 3:34 PM

Post #9 of 13 (4999 views)
Permalink
RE: Ubuntu and mod_perl [In reply to]

If you are looking to run something on apache startup:

PerlRequire /path/to/startup.pl



-----Original Message-----
From: Tom Kane [mailto:t.kane [at] mindspring]
Sent: Tuesday, May 17, 2011 5:23 PM
To: modperl [at] perl
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


aw at ice-sa

May 17, 2011, 3:57 PM

Post #10 of 13 (4997 views)
Permalink
Re: Ubuntu and mod_perl [In reply to]

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 :

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.


t.kane at mindspring

May 17, 2011, 5:19 PM

Post #11 of 13 (4984 views)
Permalink
Ubuntu and mod_perl [In reply to]

I tried to incorporate suggestions I've received. After restarting apache2, this is what happened:


tomkane [at] sf:~$ /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


silent2600 at gmail

May 17, 2011, 5:25 PM

Post #12 of 13 (4987 views)
Permalink
Re: Ubuntu and mod_perl [In reply to]

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 <t.kane [at] mindspring>:
> I tried to incorporate suggestions I've received. After restarting apache2, this is what happened:
>
>
> tomkane [at] sf:~$ /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
>


trawick at gmail

May 17, 2011, 5:50 PM

Post #13 of 13 (4982 views)
Permalink
Re: Ubuntu and mod_perl [In reply to]

On Tue, May 17, 2011 at 8:25 PM, silent <silent2600 [at] gmail> 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 <t.kane [at] mindspring>:
>> I tried to incorporate suggestions I've received. After restarting apache2, this is what happened:
>>
>>
>> tomkane [at] sf:~$ /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)

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.