You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Boysenberry Payne <bo...@humaniteque.com> on 2005/02/08 22:01:05 UTC

At the end of my rope with apache and mod_perl

Since I can’t seem to figure out how to install apache_1.3.33 on mac ox 
x from source, I’m going to try and fix my issues with my currently 
installed version (comes with os x.)
The problem I’m having is with mod_perl and mysql.  I used fink to 
install mysql at one point and it confused mod_perl as to which mysql 
database to use.  When I use mod_perl as a mod_cgi script it gets the 
right database, when I use perl scripts using mod_perl it gives me the 
following error:

dyld: /usr/sbin/httpd can't open library: 
/sw/lib/mysql/libmysqlclient.14.dylib  (No such file or directory, 
errno = 2)
[Tue Feb  8 14:43:05 2005] [notice] child pid 436 exit signal Trace/BPT 
trap (5)


What I think I need to do is get mod_perl to look for the right library 
file for my currently working mysql database.

In my naiveté  I thought, well why not just rebuild mod_perl.  So I 
tried and found out you need the apache source in order to reinstall 
mod_perl.  That’s when my life became very unpleasant.  I can’t get 
apache_1.3.33 to install.  It gives me the following errors when I try 
to compile mod_perl:

cc  -DDARWIN -DMOD_PERL -DUSE_PERL_SSI -fno-common -DPERL_DARWIN 
-no-cpp-precomp -fno-strict-aliasing -pipe -I/usr/local/include 
-DUSE_HSREGEX -DNO_DL_NEEDED -fno-common -DPERL_DARWIN -no-cpp-precomp 
-fno-strict-aliasing -pipe -I/usr/local/include 
-I/usr/local/lib/perl5/5.8.6/darwin-2level/CORE -I. -I../.. 
-DUSE_PERL_SSI  -fno-common -DPERL_DARWIN -no-cpp-precomp 
-fno-strict-aliasing -pipe -I/usr/local/include -DMOD_PERL    \
       -o httpd buildmark.o modules.o modules/proxy/libproxy.a 
modules/perl/libperl.a modules/standard/libstandard.a main/libmain.a 
./os/unix/libos.a ap/libap.a regex/libregex.a  `perl 
/Users/boysie/unpublished/sources/mod_perl-1.29/src/modules/perl/ldopts 
Apache ` -L/usr/local/lib 
/usr/local/lib/perl5/5.8.6/darwin-2level/auto/DynaLoader/DynaLoader.a 
-L/usr/local/lib/perl5/5.8.6/darwin-2level/CORE -lperl -ldl -lm -lc  
-lexpat
ld: warning multiple definitions of symbol _regcomp
regex/libregex.a(regcomp.o) definition of _regcomp in section 
(__TEXT,__text)
/usr/lib/libdl.dylib(regcomp.So) definition of _regcomp
ld: warning multiple definitions of symbol _regexec
regex/libregex.a(regexec.o) definition of _regexec in section 
(__TEXT,__text)
/usr/lib/libdl.dylib(regexec.So) definition of _regexec
ld: warning multiple definitions of symbol _regfree
regex/libregex.a(regfree.o) definition of _regfree in section 
(__TEXT,__text)
/usr/lib/libdl.dylib(regfree.So) definition of _regfree
ld: Undefined symbols:
_actions_module
_include_module
_log_config_module
make[1]: *** [target_static] Error 1
make: *** [apache_httpd] Error 2

Considering that I’m still learning Perl, this info is still a little 
much for me to understand.  That is, I’m not sure how to correct it.

I need to get mod_perl up and running asap.  It behooves me to figure 
out how to get mod_perl to look for the right database library…

Any help would be much appreciated…
Boysenberry

[users@httpd] Re: At the end of my rope with apache and mod_perl

Posted by Boysenberry Payne <bo...@humaniteque.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ok, I tried using darwinports to install apache 1.3 and mod_perl 1.26 
using
port install apache +mod_perl.
It seemed to off without a hitch, no errors, no problem.
Then I tried starting apache using:
sudo /opt/local/sbin/apachectl start and received the following error:

dyld: /opt/local/sbin/httpd Undefined symbols:
_include_module
/opt/local/sbin/apachectl: line 186:  8384 Trace/BPT trap          
$HTTPD
/opt/local/sbin/apachectl start: httpd could not be started


Its similar to one of the errors I get when trying to compile from 
source.
When I compared the httpd.conf files between my default (w/ os x 10.3)
apache and my darwin port I noticed the darwin port had the dso for
includes as such:
LoadModule log_config_module  libexec/apache/mod_log_config.so
where as my original httpd.conf is as such:
LoadModule config_log_module  libexec/apache/mod_log_config.so
changing it has no effect on the error.
The other inconsistency was in the os x original was the following line:
LoadModule perl_module        libexec/httpd/libperl.so
It was missing from the darwin port, not that it makes a difference 
with the error.

Why would a default module being missing?

Is there something about this particular module that is weird?

Thanks for all of the help so far.  Anything else?

I'm going to try using some of the set up configurations already 
suggested
with a source build and see if that gets me any further.  Please, don't 
give up
on me, I surely can't.

Boysenberry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iEYEARECAAYFAkIJ1HEACgkQBWcdy5xkwdzkIACg3wMJvR7NJD9weIfTQBwbE8k3
ursAn1F3m7VBG0r4SJ3/jV8/YX7lkLOu
=MsfI
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: At the end of my rope with apache and mod_perl

Posted by Barry Hoggard <ba...@tristanmedia.com>.
On Feb 10, 2005, at 2:01 PM, Geoffrey Young wrote:
> sorry for showing up late, but do the OS X-specific install 
> instructions
> here not help or no longer apply?
>
>   http://www.modperlcookbook.org/chapters/ch01.pdf

I had forgotten about those.  I haven't needed to use them lately.  The 
regular 1.x code base seemed to work for me.


Barry Hoggard


Re: At the end of my rope with apache and mod_perl

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Barry Hoggard wrote:
> What happens which you type:
> 
> which perl
> perl -v
> perldoc DBD::mysql
> 
> Do all of those work?  Can you tell us what they output?
> 
> Since you are not using SSL for now, get rid of the SSL-related lines. 
> I'm sorry.  I didn't realize you didn't understand that part.  Use this
> to compile the static apache.  Note that this assumes you will go on
> with the next steps to add in the mod_perl SO.

sorry for showing up late, but do the OS X-specific install instructions
here not help or no longer apply?

  http://www.modperlcookbook.org/chapters/ch01.pdf

--Geoff

Re: At the end of my rope with apache and mod_perl

Posted by Boysenberry Payne <bo...@humaniteque.com>.
> What happens which you type:
>
> which perl
> perl -v
> perldoc DBD::mysql
>

ok, here you are:

from ~/
which perl
/opt/local/bin/perl

perl -v
This is perl, v5.8.6 built for darwin-2level
...

perldoc DBD::mysql
No documentation found for "DBD::mysql"


Mind you I'm in the process of reinstalling DBD::mysql...

What I'm going to try is reinstalling DBD from source.  I'm hoping that
will clear up issues with the linked mysql library.

I think I've isolated it to a mysql.sock issue.  Perl will only
look for a non-exsisting dyld as follows:

dyld: /usr/sbin/httpd can't open library: 
/sw/lib/mysql/libmysqlclient.14.dylib  (No such file or directory, 
errno = 2)
[Thu Feb 10 01:14:20 2005] [notice] child pid 2914 exit signal 
Trace/BPT trap (5)

It's was a database that I installed hoping it would help the source 
DBD install.
Instead it made it so I could use the database I wanted to use.  I 
already know
about the passing socket to DBI->connect(), but I can't find any 
mysql.sock other
than the default one set up with the mysql package installer from:
http://www.entropy.ch/software/macosx/mysql/

I even tried to uninstall it using the steps described on his site, no 
luck.
I installed the darwinport mysql, and am hoping I can get my DBD::mysql 
to
use that one, instead.  But when I issue:
/opt/local/bin/mysqlcheck
I get the following error:
/opt/local/bin/mysqlcheck: Got error: 2002: Can't connect to local 
MySQL server through socket '/tmp/mysql.sock' (61) when trying to 
connect
Which makes me think the mysql databases are all set up to use the same 
mysql.sock.

I'm not sure, but I think that's a problem.  Not sure how to correct it 
yet either, but
I'm reading up on it....


Re: At the end of my rope with apache and mod_perl

Posted by Barry Hoggard <ba...@tristanmedia.com>.
What happens which you type:

which perl
perl -v
perldoc DBD::mysql

Do all of those work?  Can you tell us what they output?

Since you are not using SSL for now, get rid of the SSL-related lines.  
I'm sorry.  I didn't realize you didn't understand that part.  Use this 
to compile the static apache.  Note that this assumes you will go on 
with the next steps to add in the mod_perl SO.

INSTALL_ROOT=/opt/apache

BUILD_DIR=$HOME/src

cd $BUILD_DIR/apache_1.3.*
APACHE_DIR=`pwd`

./configure \
  --prefix=$INSTALL_ROOT \
  --with-layout="Apache" \
  --enable-module=so \
  --enable-module=proxy \
  --enable-module=rewrite \
  --enable-module=cgi \
  --disable-rule=expat \
  --enable-module=autoindex \
  --enable-module=auth

make && sudo make install



On Feb 10, 2005, at 2:46 AM, Boysenberry Payne wrote:

> I tried running one script below and got the following:
>
> ./installer: line 11: cd: /Users/boysie/src/mm-1.*: No such file or 
> directory
> Configuring for Apache, Version 1.3.33
>  + using installation path layout: Darwin (config.layout)
> configure:Error: No such module named 'yes'
> ./installer: line 16: cd: /Users/boysie/src/mod_ssl-2.*: No such file 
> or directory
> Configuring for Apache, Version 1.3.33
>  + using installation path layout: Darwin (config.layout)
> configure:Error: invalid option 
> '--with-apache=/Users/boysie/src/apache_1.3.33'
> Configuring for Apache, Version 1.3.33
>  + using installation path layout: Apache (config.layout)
> configure:Error: No such module named 'ssl'
> make: *** No targets specified and no makefile found.  Stop.
>
> So my questions are what is mm-1.* and if I put this all in a file 
> named
> installer and made it executable, then ./installer, am I doing it 
> right?
> Also, I'm using perl 5.8.6, is that ok?
>
> So far no matter how I try and install apache 1.3.33 I get an error 
> saying:
>
> dyld: /opt/local/apache/bin/httpd Undefined symbols:
> _log_config_module
>
> My real issue came when my mod_perl (default os x app) became confused 
> about which mysql database
> dyld file to use.  It's using one fink set up, when I want it to use 
> another.
> Maybe that's what I should try and see if I can change without 
> compiling it all over again.
> It showed up when I tried to use mod_perl instead of mod_cgi.  mod_cgi 
> was using the
> right database, where as mod_perl wasn't.
>
> Do you know how to change the dyld mod_perl looks for?
>
>
> On Feb 8, 2005, at 5:02 PM, Barry Hoggard wrote:
>
>>
>> INSTALL_ROOT=/usr/local/apache
>>
>> export SSL_BASE=/opt/ssl
>>
>> BUILD_DIR=$HOME/src
>>
>> cd $BUILD_DIR/apache_1.3.*
>> APACHE_DIR=`pwd`
>>
>> cd $BUILD_DIR/mm-1.*
>> export EAPI_MM=`pwd`
>>
>> ./configure --disable-shared && make
>>
>> cd $BUILD_DIR/mod_ssl-2.*
>> MODSSL_DIR=`pwd`
>>
>> ./configure --with-apache=$APACHE_DIR
>>
>> cd $APACHE_DIR
>>
>> ./configure \
>>  --prefix=$INSTALL_ROOT \
>>  --with-layout="Apache" \
>>  --disable-module=usertrack \
>>  --enable-module=so \
>>  --enable-module=proxy \
>>  --enable-module=rewrite \
>>  --disable-module=userdir \
>>  --enable-module=cgi \
>>  --disable-rule=expat \
>>  --disable-module=imap \
>>  --disable-module=include \
>>  --enable-module=autoindex \
>>  --enable-module=auth \
>>  --enable-module=ssl \
>>  --enable-shared=ssl \
>>  --disable-rule=SSL_COMPAT
>>
>> make && sudo make install
>


Re: At the end of my rope with apache and mod_perl

Posted by Boysenberry Payne <bo...@humaniteque.com>.
I tried running one script below and got the following:

./installer: line 11: cd: /Users/boysie/src/mm-1.*: No such file or 
directory
Configuring for Apache, Version 1.3.33
  + using installation path layout: Darwin (config.layout)
configure:Error: No such module named 'yes'
./installer: line 16: cd: /Users/boysie/src/mod_ssl-2.*: No such file 
or directory
Configuring for Apache, Version 1.3.33
  + using installation path layout: Darwin (config.layout)
configure:Error: invalid option 
'--with-apache=/Users/boysie/src/apache_1.3.33'
Configuring for Apache, Version 1.3.33
  + using installation path layout: Apache (config.layout)
configure:Error: No such module named 'ssl'
make: *** No targets specified and no makefile found.  Stop.

So my questions are what is mm-1.* and if I put this all in a file named
installer and made it executable, then ./installer, am I doing it right?
Also, I'm using perl 5.8.6, is that ok?

So far no matter how I try and install apache 1.3.33 I get an error 
saying:

dyld: /opt/local/apache/bin/httpd Undefined symbols:
_log_config_module

My real issue came when my mod_perl (default os x app) became confused 
about which mysql database
dyld file to use.  It's using one fink set up, when I want it to use 
another.
Maybe that's what I should try and see if I can change without 
compiling it all over again.
It showed up when I tried to use mod_perl instead of mod_cgi.  mod_cgi 
was using the
right database, where as mod_perl wasn't.

Do you know how to change the dyld mod_perl looks for?


On Feb 8, 2005, at 5:02 PM, Barry Hoggard wrote:

>
> INSTALL_ROOT=/usr/local/apache
>
> export SSL_BASE=/opt/ssl
>
> BUILD_DIR=$HOME/src
>
> cd $BUILD_DIR/apache_1.3.*
> APACHE_DIR=`pwd`
>
> cd $BUILD_DIR/mm-1.*
> export EAPI_MM=`pwd`
>
> ./configure --disable-shared && make
>
> cd $BUILD_DIR/mod_ssl-2.*
> MODSSL_DIR=`pwd`
>
> ./configure --with-apache=$APACHE_DIR
>
> cd $APACHE_DIR
>
> ./configure \
>  --prefix=$INSTALL_ROOT \
>  --with-layout="Apache" \
>  --disable-module=usertrack \
>  --enable-module=so \
>  --enable-module=proxy \
>  --enable-module=rewrite \
>  --disable-module=userdir \
>  --enable-module=cgi \
>  --disable-rule=expat \
>  --disable-module=imap \
>  --disable-module=include \
>  --enable-module=autoindex \
>  --enable-module=auth \
>  --enable-module=ssl \
>  --enable-shared=ssl \
>  --disable-rule=SSL_COMPAT
>
> make && sudo make install


Re: At the end of my rope with apache and mod_perl

Posted by Boysenberry Payne <bo...@humaniteque.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ok, I tried using darwinports to install apache 1.3 and mod_perl 1.26 
using
port install apache +mod_perl.
It seemed to off without a hitch, no errors, no problem.
Then I tried starting apache using:
sudo /opt/local/sbin/apachectl start and received the following error:

dyld: /opt/local/sbin/httpd Undefined symbols:
_include_module
/opt/local/sbin/apachectl: line 186:  8384 Trace/BPT trap          
$HTTPD
/opt/local/sbin/apachectl start: httpd could not be started


Its similar to one of the errors I get when trying to compile from 
source.
When I compared the httpd.conf files between my default (w/ os x 10.3)
apache and my darwin port I noticed the darwin port had the dso for
includes as such:
LoadModule log_config_module  libexec/apache/mod_log_config.so
where as my original httpd.conf is as such:
LoadModule config_log_module  libexec/apache/mod_log_config.so
changing it has no effect on the error.
The other inconsistency was in the os x original was the following line:
LoadModule perl_module        libexec/httpd/libperl.so
It was missing from the darwin port, not that it makes a difference 
with the error.

Why would a default module being missing?

Is there something about this particular module that is weird?

Thanks for all of the help so far.  Anything else?

I'm going to try using some of the set up configurations already 
suggested
with a source build and see if that gets me any further.  Please, don't 
give up
on me, I surely can't.

Boysenberry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iEYEARECAAYFAkIJ1HEACgkQBWcdy5xkwdzkIACg3wMJvR7NJD9weIfTQBwbE8k3
ursAn1F3m7VBG0r4SJ3/jV8/YX7lkLOu
=MsfI
-----END PGP SIGNATURE-----


Re: At the end of my rope with apache and mod_perl

Posted by Barry Hoggard <ba...@tristanmedia.com>.
On Feb 8, 2005, at 4:01 PM, Boysenberry Payne wrote:

> Since I can’t seem to figure out how to install apache_1.3.33 on mac 
> ox x from source, I’m going to try and fix my issues with my currently 
> installed version (comes with os x.)
> The problem I’m having is with mod_perl and mysql.  I used fink to 
> install mysql at one point and it confused mod_perl as to which mysql 
> database to use.  When I use mod_perl as a mod_cgi script it gets the 
> right database, when I use perl scripts using mod_perl it gives me the 
> following error:
>
> dyld: /usr/sbin/httpd can't open library: 
> /sw/lib/mysql/libmysqlclient.14.dylib  (No such file or directory, 
> errno = 2)
> [Tue Feb  8 14:43:05 2005] [notice] child pid 436 exit signal 
> Trace/BPT trap (5)
>
>
> What I think I need to do is get mod_perl to look for the right 
> library file for my currently working mysql database.


I use Marc Liyanage's package for MySQL on my PowerBook.

http://www.entropy.ch/software/macosx/

Your errors look like you're mixing versions of perl, as if the one 
you're compiling mod_perl with is getting confused between the system 
perl and the fink perl.

I compiled my own perl from source and put it in /opt. My ls -l /opt 
looks like this:

lrwxr-xr-x   1 root   admin    11  3 Apr  2004 perl -> perl-5.8.3/
drwxr-xr-x   5 root   admin   170  3 Apr  2004 perl-5.8.3

I then put /opt/perl/bin in my path via .bash_profile.  That way when I 
use sudo it sees that perl too.

I also installed Apache and mod_perl from source.  I'm using DSO for 
mod_perl.  My script to build Apache (with ssl):

---

INSTALL_ROOT=/usr/local/apache

export SSL_BASE=/opt/ssl

BUILD_DIR=$HOME/src

cd $BUILD_DIR/apache_1.3.*
APACHE_DIR=`pwd`

cd $BUILD_DIR/mm-1.*
export EAPI_MM=`pwd`

./configure --disable-shared && make

cd $BUILD_DIR/mod_ssl-2.*
MODSSL_DIR=`pwd`

./configure --with-apache=$APACHE_DIR

cd $APACHE_DIR

./configure \
  --prefix=$INSTALL_ROOT \
  --with-layout="Apache" \
  --disable-module=usertrack \
  --enable-module=so \
  --enable-module=proxy \
  --enable-module=rewrite \
  --disable-module=userdir \
  --enable-module=cgi \
  --disable-rule=expat \
  --disable-module=imap \
  --disable-module=include \
  --enable-module=autoindex \
  --enable-module=auth \
  --enable-module=ssl \
  --enable-shared=ssl \
  --disable-rule=SSL_COMPAT

make && sudo make install

---

My mod_perl so build script:

BUILD_DIR=$HOME/src

APXS=/usr/local/apache/bin/apxs

cd $BUILD_DIR/mod_perl-1.2*
MODPERL_DIR=`pwd`

perl Makefile.PL \
     USE_APXS=1 \
     WITH_APXS=$APXS \
     EVERYTHING=1

make && make test && sudo make install




--
Barry Hoggard
Tristan Media LLC
w: www.tristanmedia.com
yahoo/aim: hoggardb