Legacy mod_perl 1.0 from source on Ubuntu

Important !! The technology used in this tutorial is outdated and not recommended for any new project. We just use it because we have some legacy systems to cope with.

To remember myself and to help others, here are the instructions to install a mod_perl 1.0 development environment in a modern ubuntu 12.10 Linux system:

Setup

Create a folder and download latest apache 1 and latest mod_perl 1, finally uncompress them.

mkdir ~/mod-perl-inst
cd ~/mod-perl-inst/
wget http://archive.apache.org/dist/httpd/apache_1.3.42.tar.gz
wget http://perl.apache.org/dist/mod_perl-1.0-current.tar.gz
tar xzf apache_1.3.42.tar.gz
tar xzf mod_perl-1.0-current.tar.gz 

Downgrade Perl

With current perl 5.14 or 5.16 mod_perl 1.0 won’t compile, but with perl 5.10 the things compile fine, i’ve found perlbrew a cool project that allows for multiple perl versions, so i installed perlbrew and then installed perl 5.10:

sudo apt-get install curl
curl -kL http://install.perlbrew.pl | bash
~/perl5/perlbrew/bin/perlbrew install perl-5.10.0
~/perl5/perlbrew/bin/perlbrew switch perl-5.10.0 

Install LWP prerequisite of mod_perl

Switch to our perl 5.10 installation

~/perl5/perlbrew/bin/perlbrew switch perl-5.10.0 

Enter the cpan interactive installer

cpan

Configure the policy permanently to follow package dependencies (just once for perl installation)

cpan[1]> o conf prerequisites_policy follow
cpan[1]> o conf commit 

Install LWP

cpan[1]> install LWP

To let this version of Perl be the default for our account, we can do:

echo "export PATH=/home/hans/perl5/perlbrew/perls/perl-5.10.0/bin:\$PATH" >> ~/.bashrc

Apache 1

Apache has a getline function that conflicts in definition with c getline, so we rename the apache version of the function:

cd ~/mod-perl-inst
cd apache_1.3.42
sed -i 's/getline/apache_getline/' src/support/htdigest.c
sed -i 's/getline/apache_getline/' src/support/htpasswd.c
sed -i 's/getline/apache_getline/' src/support/logresolve.c 

Other operating system adjustements

Make sh point to bash (echo command broken message)

sudo rm -f /bin/sh
sudo ln -s /bin/bash /bin/sh

Create libgdbm link, beware that the target /usr/lib/x86_64-linux-gnu/libgdbm.so.3.0.0 may change from one SO version to another.

sudo ln -s /usr/lib/x86_64-linux-gnu/libgdbm.so.3.0.0 /usr/lib/libgdbm.so

Finally compile and install mod_perl + apache

cd ~/mod-perl-inst
cd mod_perl-1.31/
perl Makefile.PL APACHE_SRC=../apache_1.3.42/src APACHE_PREFIX=/usr/local/apache DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
make
sudo make install 

In some way this is just a compilation of tips from many sites that i don’t remember, thanks to all of them.

2 thoughts on “Legacy mod_perl 1.0 from source on Ubuntu

  1. Anonymous

    I am very disappointed: why does this document not give first dire warnings in large, bold, red blinking font that all three of Apache httpd 1, mod_perl 1, Perl 5.10 are all end-of-life, have fallen out of support years ago and all have unfixed security bugs which are well-known and easily exploited by automated cracking tools? (No, just dropping the name “legacy” is not enough; those people who need the instructions from this blog entry are those who are likely not familiar with what the proper meaning of this word is.) One would be fool to run this particular outdated Web stack on an Internet-facing server in 2013, might as well paint a big “hack me!” target on it. Better port the dependent application over to mod_perl 2 or Plack, it’s straight-forward and a better use of time than making old software work in a new operating system.

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos necesarios están marcados *

Puedes usar las siguientes etiquetas y atributos HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>