perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Danny Thomas <d.tho...@its.uq.edu.au>
Subject trying to build a statically-linked apache2/mod_perl2
Date Sat, 25 Jun 2005 09:07:54 GMT
I'm not sure whether it is a real bug, not properly documented or whether
I'm just being particularly thick, but I can't seem to build a statically-
linked apache2/mod_perl2

I want
  1) statically-linked mod_perl - mason 1.29_02 README might need updating
     for mod_perl2 but currently says
       Using Mason with a mod_perl DSO may cause your Apache server to crash
       silently at startup, or fail intermittently. The fix for this problem
       is to install Apache/mod_perl with mod_perl compiled statically into
       the Apache binary.
  2) built/installed as user www (need non-root for mod_perl testing anyway)
  3) install under /opt/apache

http://perl.apache.org/docs/2.0/user/install is quite good, but it would be
good if it had a section on building a statically-linked mod_perl.

on that page, #Apache says:
  If you intend to build a statically linked Apache+mod_perl, you only need
  to have the Apache source available (mod_perl will build and install
  Apache for you), you should skip this step
     <configure/make/make install>
perhaps the following posting refers to this line and others on the page
http://marc.theaimsgroup.com/?l=apache-modperl&m=111159822901752&w=2
  Has anyone managed to compile a static (no DSO) apache with mod_perl and 
  libapreq? Both mod_perl and libapreq have instructions for building them 
  statically individually, but the instructions seem to be mutually 
  incompatible.

FWIW the following is a FreeBSD 4.11 jail (about the only thing of interest
is that jails prevent SysV IPC)

I have tried some variations of the following and one point the build seemed
to finish, but it did not end up in the directory I thought I had specified,
it really wanted to go in /usr/local/apache2


FIRST ATTEMPT
NB the typo "speficy"
also did not seem to accept the manually entered path
==========================================================================
tar --bunzip2 -xf httpd-2.0.54.tar.bz2
chown -R www:www httpd-2.0.54
# needed for testing
/opt/bin/perl -MCPAN -e "install('Bundle::Apache2')"
tar zxf mod_perl-2.0.1.tar.gz
chown -R www:www mod_perl-2.0.1
su www
cd mod_perl-2.0.1
/opt/bin/perl Makefile.PL MP_USE_STATIC=1 \
MP_AP_CONFIGURE="--prefix=/opt/apache --with-mpm=prefork"
? MP_AP_CONFIGURE="--prefix=/opt/apache --with-mpm=prefork"
Reading Makefile.PL args from @ARGV
   MP_USE_STATIC = 1
   MP_AP_CONFIGURE = --prefix=/opt/apache --with-mpm=prefork
no conflicting prior mod_perl version found - good.
readline() on closed filehandle $fh at lib/Apache2/Build.pm line 1256.
[  error] Unable to open /opt/apache/ap_release.h: No such file or directory
Please provide the location of the Apache directory:  /opt/src-local/apache/httpd-2.0.54
[  error] You specified MP_USE_STATIC but did not speficy the location of httpd's source tree
with MP_AP_PREFIX


SECOND ATTEMPT
since the destination directory is empty, use MP_AP_PREFIX to specify
"httpd's source tree" as asked for.
NB #MP_AP_PREFIX on the install page says
  If Apache is not installed yet, you can point to the Apache 2.0 source
  directory, but only after you've built or configured Apache in it.
which is a bit worrying as we've been told to skip the build/configure
==========================================================================
tar --bunzip2 -xf httpd-2.0.54.tar.bz2
chown -R www:www httpd-2.0.54
# needed for testing
/opt/bin/perl -MCPAN -e "install('Bundle::Apache2')"
tar zxf mod_perl-2.0.1.tar.gz
chown -R www:www mod_perl-2.0.1
su www
cd mod_perl-2.0.1
/opt/bin/perl Makefile.PL MP_USE_STATIC=1 \
MP_AP_PREFIX=/opt/src-local/apache/httpd-2.0.54 \
MP_AP_CONFIGURE="--prefix=/opt/apache --with-mpm=prefork"
...
Configuring Apache/2.0.54 mod_perl2/2.0.1 Perl/v5.8.7
[  error] Can't find apr include/ directory,
[  error] use MP_APR_CONFIG=/path/to/apr-config


THIRD ATTEMPT
now the above is of concern as it should be able to find include directory
under MP_AP_PREFIX. The suggestion to specify MP_APR_CONFIG is not really 
helpful. NB MP_APR_CONFIG doees not point to an apr-config executable 
file as that has not yet been built
==========================================================================
tar --bunzip2 -xf httpd-2.0.54.tar.bz2
chown -R www:www httpd-2.0.54
# needed for testing
/opt/bin/perl -MCPAN -e "install('Bundle::Apache2')"
tar zxf mod_perl-2.0.1.tar.gz
chown -R www:www mod_perl-2.0.1
su www
cd mod_perl-2.0.1
/opt/bin/perl Makefile.PL MP_USE_STATIC=1 \
MP_AP_PREFIX=/opt/src-local/apache/httpd-2.0.54 \
MP_AP_CONFIGURE="--prefix=/opt/apache --with-mpm=prefork" \
MP_APR_CONFIG=/opt/src-local/apache/httpd-2.0.54/srclib/apr/apr-config
<<there seems to be some over-writing of input line>>
/opt/bin/perl Makefile.PL MP_USE_STATIC=1 \
MP_AP_PREFIX=/opt/src-local/apache/httpd-2.0.54 \
MP_AP_CONFIGURE="--prefix=/opt/apa? MP_AP_PREFIX=/opt/src-local/apache/httpd-2.0.54 \
? MP_AP_CONFIGURE="--prefix=/opt/apache --with-mpm=prefork" \
MP_APR_CONFIG=/opt/src-local/apache/httpd-2.0.54/srclib/apr/apr-config
? MP_APR_CONFIG=/opt/src-local/apache/httpd-2.0.54/srclib/apr/apr-config
Reading Makefile.PL args from @ARGV
   MP_USE_STATIC = 1
   MP_AP_PREFIX = /opt/src-local/apache/httpd-2.0.54
   MP_AP_CONFIGURE = --prefix=/opt/apache --with-mpm=prefork
   MP_APR_CONFIG = /opt/src-local/apache/httpd-2.0.54/srclib/apr/apr-config
[  error] You need to pass either MP_AP_PREFIX or MP_APR_CONFIG, but not both


FOURTH ATTEMPT
this time, we'll bypass the need for MP_APR_CONFIG by building apr-config
via configure, and copying it to the same path in the source tree as would
be found in install tree.
Is the problem that "apr include/ directory" is different in source and
install directories? That would explain why MP_AP_PREFIX as "httpd's source tree" is not working
==========================================================================
tar --bunzip2 -xf httpd-2.0.54.tar.bz2
chown -R www:www httpd-2.0.54
su www
cd httpd-2.0.54
# this is the configure I used to build a working apache2/mod_perl2 DSO
./configure --prefix=/opt/apache --with-mpm=prefork
mkdir bin
cp srclib/apr/apr-config bin/
^D
# needed for testing
/opt/bin/perl -MCPAN -e "install('Bundle::Apache2')"
tar zxf mod_perl-2.0.1.tar.gz
chown -R www:www mod_perl-2.0.1
su www
cd mod_perl-2.0.1
/opt/bin/perl Makefile.PL MP_USE_STATIC=1 \
MP_AP_PREFIX=/opt/src-local/apache/httpd-2.0.54 \
MP_AP_CONFIGURE="--prefix=/opt/apache --with-mpm=prefork"
... <<chugs away>>
Configuring Apache/2.0.54 mod_perl2/2.0.1 Perl/v5.8.7
[  error] Failed to obtain the MPM name. Please specify MP_APXS=/full/path/to/apxs to solve
this problem.


FIFTH ATTEMPT
try adding MP_APXS
==========================================================================
tar --bunzip2 -xf httpd-2.0.54.tar.bz2
chown -R www:www httpd-2.0.54
su www
cd httpd-2.0.54
# this is the configure I used to build a working apache2/mod_perl2 DSO
./configure --prefix=/opt/apache --with-mpm=prefork
mkdir bin
cp srclib/apr/apr-config bin/
^D
# needed for testing
/opt/bin/perl -MCPAN -e "install('Bundle::Apache2')"
tar zxf mod_perl-2.0.1.tar.gz
chown -R www:www mod_perl-2.0.1
su www
cd mod_perl-2.0.1
/opt/bin/perl Makefile.PL MP_USE_STATIC=1 \
MP_AP_PREFIX=/opt/src-local/apache/httpd-2.0.54 \
MP_AP_CONFIGURE="--prefix=/opt/apache --with-mpm=prefork" \
MP_APXS=/opt/src-local/apache/httpd-2.0.54/support/apxs
<<there seems to be some over-writing of input line>>
/opt/bin/perl Makefile.PL MP_USE_STATIC=1 \
MP_AP_PREFIX=/opt/src-local/apache/httpd-2.0.54 \
MP_AP_CONFIGURE="--prefix=/opt/apa? MP_AP_PREFIX=/opt/src-local/apache/httpd-2.0.54 \
? MP_AP_CONFIGURE="--prefix=/opt/apache --with-mpm=prefork" \
MP_APXS=/opt/src-local/apache/httpd-2.0.54/support/apxs
? MP_APXS=/opt/src-local/apache/httpd-2.0.54/support/apxs
Reading Makefile.PL args from @ARGV
   MP_USE_STATIC = 1
   MP_AP_PREFIX = /opt/src-local/apache/httpd-2.0.54
   MP_AP_CONFIGURE = --prefix=/opt/apache --with-mpm=prefork
   MP_APXS = /opt/src-local/apache/httpd-2.0.54/support/apxs
[  error] You need to pass either MP_AP_PREFIX or MP_APXS, but not both

-- 
   d.thomas@its.uq.edu.au    Danny Thomas,                                    
          +61-7-3365-8221    Software Infrastructure,
 http://www.its.uq.edu.au    ITS, The University of Queensland

Mime
View raw message