Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Checklist for installing mod_perl

by wfsp (Abbot)
on Apr 05, 2010 at 12:55 UTC ( [id://832792]=perlquestion: print w/replies, xml ) Need Help??

wfsp has asked for the wisdom of the Perl Monks concerning the following question:

Minimal install Ubuntu 8.04 LTS server (64-bit) on a VPS

Based on mod_perl Installation

First some decisions. I chose

  • Use bleeding edge sources. In these shoes? I don't think so.
  • Install apache, with MPM prefork, in /opt/httpd
  • Install perl, without threads enabled, in /opt/perl
  • Install mod_perl as a DSO
Install some packages we'll need.
sudo apt-get update sudo apt-get install build-essential libssl-dev -y
Download and unpack sources
wget http://apache.bglam.com/httpd/httpd-2.2.15.tar.gz wget http://www.cpan.org/src/perl-5.10.1.tar.gz wget http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz tar -xvf httpd-2.2.15.tar.gz tar -xvf perl-5.10.1.tar.gz tar -xvf mod_perl-2.0-current.tar.gz
(current version numbers at time of writing)

Install Apache

cd httpd-2.2.15 ./configure --prefix=/opt/httpd --with-mpm=prefork make sudo make install cd
Install perl

See discussion on configuring perl/mod_perl on 64 bit Linux and the change to mod_perl install.pod

cd perl-5.10.1 CFLAGS='-m64 -mtune=nocona' / ./Configure -des / -A ccflags=-fPIC / -Dprefix=/opt/perl / -Uusethreads make make test sudo make install
Create some links
cd /usr/local/bin sudo ln -isv /opt/perl/bin/perl perl sudo ln -isv /opt/perl/bin/cpanp cpanp cd
Install mod_perl

You'll need answers to the following

  • full path to apxs: /opt/httpd/bin/apxs
  • full path to httpd: /opt/httpd/bin/httpd
  • ssl lib: /usr
cpanp >s conf prereqs 1 >s save >i Bundle::ApacheTest
ends with:
Test Summary Report ------------------- t/hooks/authen_basic.t (Wstat: 0 Tests: 4 Failed: 1) Failed test: 4 t/hooks/authz.t (Wstat: 0 Tests: 4 Failed: 1) Failed test: 4 Files=238, Tests=2400, 111 wallclock secs ( 1.47 usr 1.41 sys + 69.85 + cusr 20.87 csys = 93.60 CPU) Result: FAIL Failed 2/238 test programs. 2/2400 subtests failed. [warning] server s15342880.onlinehome-server.info:8529 shutdown [ error] error running tests (please examine t/logs/error_log) +--------------------------------------------------------+ | Please file a bug report: http://perl.apache.org/bugs/ | +--------------------------------------------------------+ make: *** [run_tests] Error 1 The tests for 'Bundle::Apache2' failed. Would you like me to proceed a +nyway or should we abort? Proceed anyway? [y/N]: y
The reply to a question I asked on the mod_perl list. So close your eyes and boldly hit y

ends with:

Module 'Bundle::Apache2' installed successfully No errors installing all modules
Add a line to httpd.conf after the comments about LoadModule
LoadModule perl_module modules/mod_perl.so
Have a look see
sudo /opt/httpd/bin/apachectl start cat /opt/httpd/logs/error_log [Sun Apr 04 12:53:04 2010] [notice] Apache/2.2.15 (Unix) mod_perl/2.0. +4 Perl/v5.10.1 configured -- resuming normal operations
Let's see that again :-)
[Mon Apr 05 12:24:50 2010] [notice] Apache/2.2.15 (Unix) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
A tee-shirt maybe required. But before I do that I would appreciate any comments, corrections, criticisms etc.

Thanks in advance.

Replies are listed 'Best First'.
Re: Checklist for installing mod_perl
by scorpio17 (Canon) on Apr 06, 2010 at 13:33 UTC

    Is there any particular reason you're installing from source?

    If not, I'd recommend the following (for mod_perl):

    sudo apt-get install libapache2-mod-perl2

    If you don't already have apache, you should do this first:

    sudo apt-get install apache2 apache2.2-common apache2-mpm-worker apach +e2-utils libapr1 libaprutil1

    You might want to use apache2-mpm-prefork (non-threaded, slower) instead of apache2-mpm-worker (threaded, faster) if you need compatibility with non-thread-safe libraries.

    For more info on installing a LAMP server on ubuntu, see here: https://help.ubuntu.com/community/ApacheMySQLPHP

    Just ignore all the stuff about "PHP" ;-)

      No particular reason. :-)

      It was partly because I followed the install procedure on the mod_perl website. Also, I wanted to install a separate perl anyway and in the back of my mind was how mod_perl would pick up the new perl. Which perl would the apt-get package pick up? The page you linked to doesn't mention perl.

      A minor point, I found the way Ubuntu setup Apache more than a bit convoluted, although I'm sure you'd get used to it.

        I'm pretty sure the Ubuntu setup is the same as that of any other Debian-based linux distribution.

        The default version of perl depends on which version of Ubuntu you're using. Ubuntu 8.04LS uses Perl 5.8.8. I *think* Ubuntu 9.04 comes with Perl 5.10.

        You have to be real careful if you try to upgrade perl on an older distribution, because the OS uses perl-based scripts for certain things - so changing the system perl can break your whole installation. Installing from source (into an area like /opt or /usr/local) is probably the best way to go. Or else upgrade Ubuntu until you get a version that comes with the perl you want!

        The main reason I have for using the package manager (for apache) is that it makes life easier if you start installing multiple apache modules (mod_rewrite, mod_ssh, mod_dav, etc) - many of those have multiple dependencies on other libraries, etc. Trying to get everything built without any conflicts takes a lot of time and energy - all easily avoided by simply using the package manager.

Re: Checklist for installing mod_perl
by cmac (Monk) on Apr 06, 2010 at 05:31 UTC
    At risk of stating the obvious, and without studying every line of your log, it seems your next step is to give the server some content to serve, preferably some of it generated via mod_perl. Anyone who can get thru this far presumably knows that's next.

    So please say what you want. If it's just congratulations, then congratulations!

    cmac
      Thanks for your comments.

      ...give the server some content to serve...
      Agreed. I'm planning a further post on that. While not perl it may be worth first discussing where to put the content/scripts etc.

      For instance, the default DocumentRoot I have is currently /opt/httpd/htdocs. I think I would prefer it out from under the feet of Apache under either the user or perhaps, looking ahead to more than one user updating the website, under /var/www/mydomain/perl and /var/www/mydomain/docroot.

      Also not perl, how to handle particular directories that the Apache user could write to, for example a file upload directory under DocumentRoot and a directory that perl could write to e.g. sessions/logs. Perhaps consider setting up users and groups to help with the job.

      And after sorting that out, some perl scripts. :-)

      All that may have been a distraction so I decided not to cover it this time.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://832792]
Approved by Hue-Bond
Front-paged by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-03-28 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found