Обсуждение: compiling mod_auth_pgsql

Поиск
Список
Период
Сортировка

compiling mod_auth_pgsql

От
cliff@cliffmeyers.com
Дата:
Hello,

I posted this message to pgsql-interfaces but I figured I'd post to the general
list as well.

I'm trying to install mod_auth_pgsql 0.9.12 with apache 1.3.27 on Red Hat Linux
8.  I've followed the directions for installation to the letter, but the apache
'make' command dies on me, complaining that it can't find libpq.so.3 even though
it exists in my /usr/local/pgsql/lib directory.  What's strange is that it dies
during part of the apache 'make' that seems to have nothing to do with the
mod_auth_pgsql module.

Does anyone have any tips or pointers on this?  I previously installed this
statically into apache with success, but apparently the documentation I wrote
then missed something since it won't work now :-(  Below is the output from the
configure and make commands I used to build the module and apache.  Any help
would be greatly appreciated - thanks.



[root@vanadium apache_1.3.27]# ./configure --prefix=/usr/local/apache
Configuring for Apache, Version 1.3.27
 + using installation path layout: Apache (config.layout)
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
 + configured for Linux platform
 + setting C compiler to gcc
 + setting C pre-processor to gcc -E
 + checking for system header files
 + adding selected modules
 + using system Expat
 + checking sizeof various data types
 + doing sanity check on compiler and options
Creating Makefile in src/support
Creating Makefile in src/regex
Creating Makefile in src/os/unix
Creating Makefile in src/ap
Creating Makefile in src/main
Creating Makefile in src/modules/standard
[root@vanadium apache_1.3.27]# cd ../mod_auth_pgsql-0.9.12
[root@vanadium mod_auth_pgsql-0.9.12]# ./configure
--with-apache=/usr/local/src/apache_1.3.27 --with-pgsql=/usr/local/pgsql
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for ranlib... ranlib
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for static Apache module support... yes - Apache 1.3.x
checking for Apache module support via DSO through APXS... no
checking for pgsql... checking for pgsql lib... checking for pgsql include...
found in /usr/local/pgsql
updating cache ./config.cache
creating ./config.status
creating Makefile
creating Makefile.tmpl
creating mod_auth_pgsql.module
creating config.h
[root@vanadium mod_auth_pgsql-0.9.12]# make
cc -c   -I/usr/local/src/apache_1.3.27/src/include
-I/usr/local/src/apache_1.3.27/src/os/unix -I/usr/local/pgsql/include -g -O2
-DEAPI -fPIC mod_auth_pgsql.c -o mod_auth_pgsql.o
rm -f mod_auth_pgsql.a
ar rc mod_auth_pgsql.a mod_auth_pgsql.o
ranlib mod_auth_pgsql.a
[root@vanadium mod_auth_pgsql-0.9.12]# make install
mkdir -p /usr/local/src/apache_1.3.27/src/modules/auth_pgsql; cp mod_auth_pgsql.a
 mod_auth_pgsql.c mod_auth_pgsql.exp Makefile.tmpl Makefile.libdir
mod_auth_pgsql.module auth_pgsql_shared_stub.c
/usr/local/src/apache_1.3.27/src/modules/auth_pgsql
[root@vanadium mod_auth_pgsql-0.9.12]# cd ../apache_1.3.27
[root@vanadium apache_1.3.27]# ./configure --prefix=/usr/local/apache
--activate-module=src/modules/auth_pgsql/mod_auth_pgsql.c
Configuring for Apache, Version 1.3.27
 + using installation path layout: Apache (config.layout)
 + activated auth_pgsql module (modules/auth_pgsql/mod_auth_pgsql.c)
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
 + configured for Linux platform
 + setting C compiler to gcc
 + setting C pre-processor to gcc -E
 + checking for system header files
 + adding selected modules
    o auth_pgsql_module uses ConfigStart/End
 + using system Expat
 + checking sizeof various data types
 + doing sanity check on compiler and options
Creating Makefile in src/support
Creating Makefile in src/regex
Creating Makefile in src/os/unix
Creating Makefile in src/ap
Creating Makefile in src/main
Creating Makefile in src/modules/standard
Creating Makefile in src/modules/auth_pgsql
[root@vanadium apache_1.3.27]# make
===> src
make[1]: Entering directory `/usr/local/src/apache_1.3.27'
make[2]: Entering directory `/usr/local/src/apache_1.3.27/src'
===> src/regex
sh ./mkh  -p regcomp.c >regcomp.ih
gcc -I.  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` -DPOSIX_MISTAKE   -c -o regcomp.o regcomp.c
sh ./mkh  -p engine.c >engine.ih
gcc -I.  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` -DPOSIX_MISTAKE   -c -o regexec.o regexec.c
gcc -I.  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` -DPOSIX_MISTAKE   -c -o regerror.o regerror.c
gcc -I.  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` -DPOSIX_MISTAKE   -c -o regfree.o regfree.c
rm -f libregex.a
ar cr libregex.a regcomp.o regexec.o regerror.o regfree.o
ranlib libregex.a
<=== src/regex
===> src/os/unix
gcc -c  -I../../os/unix -I../../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../../apaci` os.c
gcc -c  -I../../os/unix -I../../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../../apaci` os-inline.c
rm -f libos.a
ar cr libos.a os.o os-inline.o
ranlib libos.a
<=== src/os/unix
===> src/ap
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` ap_cpystrn.c
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` ap_execve.c
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` ap_fnmatch.c
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` ap_getpass.c
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` ap_md5c.c
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` ap_signal.c
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` ap_slack.c
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` ap_snprintf.c
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` ap_sha1.c
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` ap_checkpass.c
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` ap_base64.c
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` ap_ebcdic.c
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` ap_strtol.c
rm -f libap.a
ar cr libap.a ap_cpystrn.o ap_execve.o ap_fnmatch.o ap_getpass.o ap_md5c.o
ap_signal.o ap_slack.o ap_snprintf.o ap_sha1.o ap_checkpass.o ap_base64.o
ap_ebcdic.o ap_strtol.o
ranlib libap.a
<=== src/ap
===> src/main
gcc -c  -I../os/unix -I../include   -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` gen_test_char.c
gcc  -DLINUX=22 -DUSE_HSREGEX -DNO_DL_NEEDED `../apaci`   -o gen_test_char
gen_test_char.o  -L/usr/local/pgsql/lib -lpq  -lm -lcrypt -lexpat
./gen_test_char >test_char.h
./gen_test_char: error while loading shared libraries: libpq.so.3: cannot open
shared object file: No such file or directory
make[3]: *** [test_char.h] Error 127
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/usr/local/src/apache_1.3.27/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/usr/local/src/apache_1.3.27'
make: *** [build] Error 2
[root@vanadium apache_1.3.27]#

Re: compiling mod_auth_pgsql

От
Richard Huxton
Дата:
On Wednesday 21 May 2003 6:18 pm, cliff@cliffmeyers.com wrote:
> Hello,
>
> I posted this message to pgsql-interfaces but I figured I'd post to the
> general list as well.
>
> I'm trying to install mod_auth_pgsql 0.9.12 with apache 1.3.27 on Red Hat
> Linux 8.  I've followed the directions for installation to the letter, but
> the apache 'make' command dies on me, complaining that it can't find
> libpq.so.3 even though it exists in my /usr/local/pgsql/lib directory.
> What's strange is that it dies during part of the apache 'make' that seems
> to have nothing to do with the mod_auth_pgsql module.

Two things to check:

1. Have you made the relevant changes in /etc/ld.so.conf and run ldconfig?
or
2. Have you told ./configure where to find the pgsql directory?

Step 1 just requires you add the path to the ld.so.conf file and run ldconfig
(as root). That tells the linker where to look for libraries.

--
  Richard Huxton

Re: compiling mod_auth_pgsql

От
Martijn van Oosterhout
Дата:
On Wed, May 21, 2003 at 10:18:21AM -0700, cliff@cliffmeyers.com wrote:
> Hello,
>
> I posted this message to pgsql-interfaces but I figured I'd post to the general
> list as well.
>
> I'm trying to install mod_auth_pgsql 0.9.12 with apache 1.3.27 on Red Hat Linux
> 8.  I've followed the directions for installation to the letter, but the apache
> 'make' command dies on me, complaining that it can't find libpq.so.3 even though
> it exists in my /usr/local/pgsql/lib directory.  What's strange is that it dies
> during part of the apache 'make' that seems to have nothing to do with the
> mod_auth_pgsql module.

Look at this:
> gen_test_char.o  -L/usr/local/pgsql/lib -lpq  -lm -lcrypt -lexpat
> ./gen_test_char >test_char.h
> ./gen_test_char: error while loading shared libraries: libpq.so.3: cannot open
> shared object file: No such file or directory

It's building a program called gen_test_char and then running it. While
compiling it suggested finding that lib in /usr/local/pgsql/lib. That
worked, so you program compiled and linked fine.

But when you run it, the loader doesn't know where to find that library and
looks in the list in /etc/ld.so.conf. So you have a few options:

1. Add /usr/local/pgsql/lib to your ld.so.conf and run ldconfig
2. Soft/hard or copy the library to /usr/local/lib (if that's listed)
  or even /usr/lib of you prefer.

Don't forget ldconfig.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
>   - Samuel P. Huntington

Вложения

Re: compiling mod_auth_pgsql

От
Thomas Beutin
Дата:
Hi Cliff,

On Wed, May 21, 2003 at 10:18:21AM -0700, cliff@cliffmeyers.com wrote:
> Hello,
>
> I posted this message to pgsql-interfaces but I figured I'd post to the general
> list as well.
>
> I'm trying to install mod_auth_pgsql 0.9.12 with apache 1.3.27 on Red Hat Linux
> 8.  I've followed the directions for installation to the letter, but the apache
> 'make' command dies on me, complaining that it can't find libpq.so.3 even though
> it exists in my /usr/local/pgsql/lib directory.  What's strange is that it dies
> during part of the apache 'make' that seems to have nothing to do with the
> mod_auth_pgsql module.
>
> Does anyone have any tips or pointers on this?  I previously installed this
> statically into apache with success, but apparently the documentation I wrote
> then missed something since it won't work now :-(  Below is the output from the
> configure and make commands I used to build the module and apache.  Any help
> would be greatly appreciated - thanks.
1. Compile and install apache and postgres as usual
2. make sure the path to the postgres libs is in /etc/ld.so.config and do an
   /sbin/ldconfig after adding it (reboot should do this automagically)
   Or You have to set the LD_LIBRARY_PATH in every shell where You want to
   use applications linked against the shared postgres libs
3. Compile mod_auth_pgsql (respect Your paths to apache and postgres!):
    /usr/local/apache/bin/apxs  -I/usr/local/pgsql/include -L/usr/local/pgsql/lib -lpq -o mod_auth_pgsql.so -c *.c
4. Install mod_auth_pgsql (respect Your paths to apache!):
    /usr/local/apache/bin/apxs -i -a -n auth_pgsql mod_auth_pgsql.so

Hope this helps.

Greetings,
-tb
--
Thomas Beutin                             tb@laokoon.IN-Berlin.DE
Beam me up, Scotty. There is no intelligent live down in Redmond.