The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to install mod_auth_db for Apache ?

Discussion in 'EasyApache' started by ramiel, May 4, 2005.

  1. ramiel

    ramiel Member

    Joined:
    Mar 14, 2005
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Mountain View, CA, USA
    Hello,

    I need to install mod_auth_db.so in the apache. I looked at the EastApache page and it doesn't have this module. It is not in in the libexec directory either.

    Is there a way to tell EasyApache to also install this i.e. to modify the "./configure" line which easyapache runs?

    Kind Regards,
    Ramiel
     
  2. ramiel

    ramiel Member

    Joined:
    Mar 14, 2005
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Mountain View, CA, USA
    /scripts/easyapache Advanced didn't work either.

    I ran from /scripts/easyapache the advanced mode and there were no features to enable additional modules or add new modules on the apache build "./configure" script.

    There has to be a normal way to modify the configure script right?

    I just need to end up enabled a line like this in httpd.conf
    # LoadModule db_auth_module /usr/lib/apache/1.3/mod_auth_db.so


    Regards,
    Ramiel
     
  3. ramiel

    ramiel Member

    Joined:
    Mar 14, 2005
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Mountain View, CA, USA
    Red Hat Enterprise Linux 3.0 <=> cPanel <=> Apache 1.3.33 support issues

    My customer's script uses Berkeley DBM files for the password file.

    cPanel is using Apache 1.3.33 on Red Hat Enterprise Linux 3.0

    Red Hat Enterprise Linux 3.0 does NOT support Apache 1.3.33
    but cPanel supports Apache 1.3.33 on Red Hat Enterprise Linux 3.0

    The Apache that comes with cPanel does not come with "mod_auth_db" which
    is what we need to read the password file.

    I've posted this message and haven't got any help from the cPanel folks yet :-(

    I've been doing research on how to make this work.

    The problem is that Apache 1.3.33 needs an older version of libdb.so and
    libexpat. The ones that come with Red Hat Enterprise 3.0 are much newer
    and won't work on it. So one alternative is to go with Apache 2.0.

    Problem with Apache 2.0 is that it's not well supported by cPanel:

    "Apache 2 Support (Experimental & Very Broken, Not for Production
    Use)"

    So I'm trying to find a way to stick with Apache 1.3.33 and get the older
    version of Berkely DB support (version 2) since version 4 is the one on
    your system. I tried even making symbolic links since I would assume
    Berkeley DB 4 would have backward compatibility with Berkeley DB 2 but
    that also didn't work.

    I hope you can see this is a fairly complex problem unfortunately which
    has stemed from using cPanel. If we were on Debian we would not have this
    problem, but Debian is in Beta support on cPanel... and Red Hat Enterprise
    Linux is the most support OS for cPanel (according to cPanel sales rep).

    Any help/assitance is greatly appreciated.

    Regards,
    Ramiel
     
  4. ramiel

    ramiel Member

    Joined:
    Mar 14, 2005
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Mountain View, CA, USA
    Hacking at it... still no luck... could really use some help.

    Maybe I'm going at this all the wrong way? The best way is if I could control the Apache's Makefile for cPanel but I have no idea how to do that with the cpanel easyapache builder.

    So here we go:


    # I went and copied the "mod_auth_db.so" from another server with Apache 1.3.28 and copied it and
    # loaded the config for it with the proper permissions into httpd.conf
    # I tried to start Apache and it complained about:


    root@www [/lib]# /etc/init.d/httpd configtest
    Syntax error on line 226 of /usr/local/apache/conf/httpd.conf:
    Cannot load /usr/local/apache/libexec/mod_auth_db.so into server: libdb2.so.2: cannot open shared object file: No such file or directory


    # I looked for that file libdb2.so.2 and it was missing:

    root@www [/lib]# ls -l libdb2.so.*
    -rwxr-xr-x 1 root root 244192 Sep 30 2004 libdb2.so.3*


    # So I symlinked it assuming there is backward compatability:

    root@www [/lib]# ln -s libdb2.so.3 libdb2.so.2
    root@www [/lib]# ls -l libdb2.so.*
    lrwxrwxrwx 1 root root 11 May 4 12:49 libdb2.so.2 -> libdb2.so.3*
    -rwxr-xr-x 1 root root 244192 Sep 30 2004 libdb2.so.3*


    # Now got a new error:

    root@www [/lib]# /etc/init.d/httpd configtest
    Syntax error on line 226 of /usr/local/apache/conf/httpd.conf:
    Cannot load /usr/local/apache/libexec/mod_auth_db.so into server: libexpat.so.1: cannot open shared object file: No such file or directory

    # looking for what libexpat I have:

    root@www [/lib]# cd /usr/lib
    root@www [/usr/lib]# ls libexpat.*
    libexpat.a libexpat.la* libexpat.so@ libexpat.so.0@ libexpat.so.0.4.0*

    # tried another sym link:

    root@www [/usr/lib]# ln -s libexpat.so libexpat.so.1
    root@www [/usr/lib]# ls libexpat.* -l
    -rw-r--r-- 1 root root 270618 Apr 29 12:56 libexpat.a
    -rwxr-xr-x 1 root root 706 Apr 29 12:56 libexpat.la*
    lrwxrwxrwx 1 root root 17 Apr 29 12:56 libexpat.so -> libexpat.so.0.4.0*
    lrwxrwxrwx 1 root root 17 Apr 29 12:56 libexpat.so.0 -> libexpat.so.0.4.0*
    -rwxr-xr-x 1 root root 241464 Apr 29 12:56 libexpat.so.0.4.0*
    lrwxrwxrwx 1 root root 11 May 4 13:19 libexpat.so.1 -> libexpat.so*


    # got error again:

    root@www [/usr/lib]# /etc/init.d/httpd configtest
    Syntax error on line 226 of /usr/local/apache/conf/httpd.conf:
    Cannot load /usr/local/apache/libexec/mod_auth_db.so into server: libdb2.so.2: cannot open shared object file: No such file or directory


    # mind you I'm not a programmer and learning how to mess with all this just now... looking at what
    # ldd wants for mod_auth_db.so

    root@www [/usr/local/apache/libexec]# ldd mod_auth_db.so
    libm.so.6 => /lib/tls/libm.so.6 (0x002a2000)
    libcrypt.so.1 => /lib/libcrypt.so.1 (0x00ef3000)
    libdb.so.2 => /usr/lib/libdb.so.2 (0x001ad000)
    libdb2.so.2 => not found
    libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00752000)
    libc.so.6 => /lib/tls/libc.so.6 (0x00794000)
    /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00214000)


    # so I went and got the older Berkeley DB2

    root@www [~]# wget ftp://ftp.sleepycat.com/releases/db-2.7.7.tar.gz

    # and installed it:

    root@www [~/db-2.7.7/build_unix]# ../dist/configure
    creating cache ./config.cache
    checking if building in the top-level directory... checking for a BSD compatible install... /usr/bin/install -c
    checking host system type... i686-pc-linux-gnu
    checking if --enable-debug option specified... no
    checking for cc... cc
    checking for gcc... (cached) cc
    checking for gcc... (cached) cc
    checking whether the C compiler (cc -O2 ) works... yes
    checking whether the C compiler (cc -O2 ) is a cross-compiler... no
    checking whether we are using GNU C... yes
    checking whether cc accepts -g... yes
    checking if --enable-diagnostic option specified... no
    checking if --enable-cxx option specified... no
    checking if --enable-compat185 option specified... no
    checking if --enable-dump185 option specified... no
    checking for ar... /usr/bin/ar
    checking for chmod... /bin/chmod
    checking for cp... /bin/cp
    checking for mkdir... /bin/mkdir
    checking for ranlib... /usr/bin/ranlib
    checking for rm... /bin/rm
    checking for sh... /bin/sh
    checking for strip... /usr/bin/strip
    checking how to run the C preprocessor... cc -E
    checking for ANSI C header files... yes
    checking for ssize_t... yes
    checking whether byte ordering is bigendian... no
    checking for working const... yes
    checking for st_blksize in struct stat... yes
    checking whether stat file-mode macros are broken... no
    checking for mode_t... yes
    checking for off_t... yes
    checking for pid_t... yes
    checking for size_t... yes
    checking for dirent.h that defines DIR... yes
    checking for opendir in -ldir... no
    checking for sys/select.h... yes
    checking for sys/time.h... yes
    checking for getcwd... yes
    checking for getopt... yes
    checking for memcmp... yes
    checking for memcpy... yes
    checking for memmove... yes
    checking for raise... yes
    checking for snprintf... yes
    checking for strerror... yes
    checking for strsep... yes
    checking for vsnprintf... yes
    checking for getuid... yes
    checking for pread... yes
    checking for pstat_getdynamic... no
    checking for sysconf... yes
    checking for shmget... yes
    checking for mmap... yes
    checking for munmap... yes
    checking for qsort... yes
    checking for select... yes
    checking for sigfillset... yes
    checking for int type sprintf return value... yes
    checking if --disable-bigfile option specified... no
    checking for spinlocks... x86/gcc
    checking for u_char... yes
    checking for u_short... yes
    checking for u_int... yes
    checking for u_long... yes
    checking for u_int8_t... yes
    checking for u_int16_t... yes
    checking for int16_t... yes
    checking for u_int32_t... yes
    checking for int32_t... yes
    checking if --enable-test option specified... no
    updating cache ./config.cache
    creating ./config.status
    creating Makefile
    creating include.tcl
    creating db.h
    creating db_int.h
    creating db_185.h
    creating config.h
    root@www [~/db-2.7.7/build_unix]# make
    (I omitted this output to make the post shorter)

    # and installed the files:

    root@www [~/db-2.7.7/build_unix]# make install
    Installing DB include files: /usr/local/BerkeleyDB/include ...
    Installing DB library: /usr/local/BerkeleyDB/lib ...
    Installing DB utilities: /usr/local/BerkeleyDB/bin ...
    Installing documentation: /usr/local/BerkeleyDB/docs ...
    root@www [~/db-2.7.7/build_unix]# cd /usr/local/BerkeleyDB/


    # however there is no .so file :-( so figured how to make that:

    root@www [/usr/local/BerkeleyDB/lib/tmp]# ar xv ../libdb.a
    x - bt_compare.o
    x - bt_conv.o
    x - bt_curadj.o
    x - bt_cursor.o
    x - bt_delete.o
    x - bt_open.o
    x - bt_page.o
    x - bt_put.o
    x - bt_rec.o
    x - bt_recno.o
    x - bt_rsearch.o
    x - bt_search.o
    x - bt_split.o
    x - bt_stat.o
    x - btree_auto.o
    x - db.o
    x - db_appinit.o
    x - db_am.o
    x - db_apprec.o
    x - db_auto.o
    x - db_byteorder.o
    x - db_conv.o
    x - db_dispatch.o
    x - db_dup.o
    x - db_err.o
    x - db_iface.o
    x - db_join.o
    x - db_log2.o
    x - db_overflow.o
    x - db_pr.o
    x - db_rec.o
    x - db_region.o
    x - db_ret.o
    x - db_salloc.o
    x - db_shash.o
    x - dbm.o
    x - hash.o
    x - hash_auto.o
    x - hash_conv.o
    x - hash_dup.o
    x - hash_func.o
    x - hash_page.o
    x - hash_rec.o
    x - hash_stat.o
    x - hsearch.o
    x - lock.o
    x - lock_conflict.o
    x - lock_deadlock.o
    x - lock_util.o
    x - lock_region.o
    x - log.o
    x - log_archive.o
    x - log_auto.o
    x - log_compare.o
    x - log_findckp.o
    x - log_get.o
    x - log_put.o
    x - log_rec.o
    x - log_register.o
    x - mp_bh.o
    x - mp_fget.o
    x - mp_fopen.o
    x - mp_fput.o
    x - mp_fset.o
    x - mp_open.o
    x - mp_pr.o
    x - mp_region.o
    x - mp_sync.o
    x - mutex.o
    x - os_abs.o
    x - os_alloc.o
    x - os_config.o
    x - os_dir.o
    x - os_fid.o
    x - os_fsync.o
    x - os_map.o
    x - os_oflags.o
    x - os_open.o
    x - os_rpath.o
    x - os_rw.o
    x - os_seek.o
    x - os_sleep.o
    x - os_spin.o
    x - os_stat.o
    x - os_tmpdir.o
    x - os_unlink.o
    x - txn.o
    x - txn_auto.o
    x - txn_rec.o
    x - xa.o
    x - xa_db.o
    x - xa_map.o

    root@www [/usr/local/BerkeleyDB/lib/tmp]# gcc -shared -o libdb.so *.o

    # and ended up with:

    root@www [/usr/local/BerkeleyDB/lib]# ls -laF
    total 700
    drwxr-xr-x 2 root root 4096 May 4 13:45 ./
    drwxr-xr-x 6 root root 4096 May 4 13:28 ../
    -r--r--r-- 1 root root 391884 May 4 13:28 libdb.a
    -rwxr-xr-x 1 root root 303818 May 4 13:45 libdb.so*


    # ran ldconfig and started apache again:

    root@www [/usr/local/BerkeleyDB/lib]# /etc/init.d/httpd configtest
    Syntax error on line 226 of /usr/local/apache/conf/httpd.conf:
    Cannot load /usr/local/apache/libexec/mod_auth_db.so into server: libdb2.so.2: cannot open shared object file: No such file or directory


    # seems needed the libdb2.so.2 and made the link and ran apache configtest again:

    root@www [/usr/local/BerkeleyDB/lib]# ln -s libdb.so libdb2.so.2
    root@www [/usr/local/BerkeleyDB/lib]# ldconfig
    root@www [/usr/local/BerkeleyDB/lib]# /etc/init.d/httpd configtest
    Syntax error on line 226 of /usr/local/apache/conf/httpd.conf:
    Cannot load /usr/local/apache/libexec/mod_auth_db.so into server: /usr/local/apache/libexec/mod_auth_db.so: symbol dbopen, version DB2 not defined in file libdb2.so.2 with link time reference





    ... can someone please help me through this?

    I just want to be able to read Berkeley DBM files since my client's password file is in DBM format.
     
  5. ramiel

    ramiel Member

    Joined:
    Mar 14, 2005
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Mountain View, CA, USA
    Correct Makefile

    I got the correct Makefile I need... still have no idea how to hack the cPanel easyapache builder to use it...

    but basically I just go and download Berkeley DB3 (I already did version 2above) and remove one package, and then build Apache this way.

    Has anyone gone through things like this?

    I'll my progress noted here. Here's the Makefile

    # Apache with mod_ssl

    include gmakefiles/common.mak

    PACKAGE = Apache
    FILE:=$(wildcard net/web/apache_*.tar.gz)
    SSL_FILE:=$(wildcard net/web/mod_ssl-*.tar.gz)
    VERSION= $(FILE:net/web/apache_%.tar.gz=%)
    SSL_VER= $(SSL_FILE:net/web/mod_ssl-%.tar.gz=%)

    PERL_FILE:=$(wildcard CPAN/Apache/mod_perl-*.tar.gz)
    PERL_VER= $(PERL_FILE:CPAN/Apache/mod_perl-%.tar.gz=%)

    #CONF_PRE= CFLAGS="-g" SSL_BASE=$(PREFIX)/ssl RSA_BASE=$(PREFIX)/rsaref
    CONF_PRE= SSL_BASE=$(PREFIX)/ssl RSA_BASE=$(PREFIX)/rsaref

    #EXTRA_LIBS= "-L/usr/local/lib -L/usr/local/BerkeleyDB.3/lib -L/usr/local/ssl/lib
    -L/usr/lib -L/lib -L/usr/lib/db3 -ldb-3.3 -lgdbm"
    #EXTRA_LIBS= "-ldb-3.3 -L/usr/local/BerkeleyDB.3/lib"
    INCLUDES="-I/usr/local/BerkeleyDB.3/include -I/usr/local/include -I/usr/include"
    LIBS="-L/usr/local/BerkeleyDB.3/lib -L/usr/local/lib -L/usr/lib -ldb-3.3 -lpthread"

    #EXTRA_INCLUDES= "-I. -I/usr/local/BerkeleyDB.3/include -I/usr/local/ssl/include
    -I/usr/include -I/usr/local/apache/include"

    CONF_FLAGS= --prefix=$(PREFIX)/apache --enable-module=so \
    --enable-module=mime_magic \
    --enable-module=proxy \
    --enable-module=rewrite \
    --enable-module=info \
    --enable-module=headers \
    --enable-module=ssl \
    --enable-shared=ssl \
    --activate-module=src/modules/perl/libperl.a \
    --activate-module=src/modules/extra/mod_proxy_add_forward.c \
    --enable-module=proxy_add_forward \
    --enable-module=expires \
    --enable-module=auth_db \
    --enable-shared=auth_db


    all: abanner apache_$(VERSION)/src/httpd
    abanner:
    @echo ======================================================
    @echo ======================================================
    @echo "building Apache version $(VERSION)"
    @echo "mod_ssl version $(SSL_VER) "
    @echo "mod_perl version $(PERL_VER) "
    @echo ======================================================
    @echo ======================================================

    apache_$(VERSION)/src/httpd: apache_$(VERSION)/Makefile
    (cd apache_$(VERSION); env LIBS=$(LIBS) INCLUDES=$(INCLUDES) make )
    apache_$(VERSION)/Makefile: apache_$(VERSION)/Makefile.tmpl
    apache_$(VERSION)/src/modules/ssl/libssl.module
    (cd apache_$(VERSION); env LIBS=$(LIBS) INCLUDES=$(INCLUDES) $(CONFIGURE) $(CFOPT))
    apache_$(VERSION)/Makefile.tmpl: $(FILE)
    zcat $(FILE)|tar xf -
    zcat $(PERL_FILE)|tar xf -
    (cp dhd/mod_auth_db.c apache_$(VERSION)/src/modules/standard)
    (cp net/web/mod_proxy_add_forward/mod_proxy_add_forward.c
    apache_$(VERSION)/src/modules/extra)
    -(cd mod_perl-$(PERL_VER); perl Makefile.PL APACHE_SRC=../apache_$(VERSION)/src
    DO_HTTPD=1 USE_APACI=1 EVERYTHING=1 \
    --prefix=$(PREFIX)/apache --enable-module=so \
    --enable-module=mime_magic \
    --enable-module=proxy \
    --enable-module=rewrite \
    --enable-module=info \
    --enable-module=headers \
    --enable-module=ssl \
    --enable-shared=ssl \
    --enable-module=expires \
    --activate-module=src/modules/perl/libperl.a \
    --activate-module=src/modules/extra/mod_proxy_add_forward.c \
    --enable-module=auth_db \
    --enable-shared=auth_db \
    --enable-module=proxy_add_forward \
    make $(CONF_PRE) ; make install )
    # work-around bug in 1.3.23 supposedly fixed in 1.3.24
    -(cd apache_$(VERSION)/src; sed -e 's/-lnsl/-lnsl -lpthread/g' Configure > sop;mv sop
    Configure; chmod +x Configure)

    -(cd apache_$(VERSION)/src/modules/standard; sed -e 's/LIBS=/EXTRA_LIBS="-ldb-3.3
    -L\/usr\/local\/BerkeleyDB.3\/lib/ -lpthread" Makefile >sop; cp sop Makefile )

    install: $(PREFIX)/apache/bin/httpd
    $(PREFIX)/apache/bin/httpd: apache_$(VERSION)/src/httpd
    -(cd apache_$(VERSION); make install)
    # to avoid problems with permissions on SSL semaphores and the like
    chmod 777 $(PREFIX)/apache/logs
    # sed -e s=/usr/local=$(PREFIX)=g init.d/apache > /etc/init.d/apache
    # chmod +x /etc/init.d/apache
    # -rm -f /etc/rc2.d/K80apache /etc/rc3.d/S80apache
    # ln -s /etc/init.d/apache /etc/rc3.d/S80apache
    # ln -s /etc/init.d/apache /etc/rc2.d/K80apache
    # catman -w -M $(PREFIX)/apache/man

    mod_ssl: apache_$(VERSION)/src/modules/ssl/libssl.module
    apache_$(VERSION)/src/modules/ssl/libssl.module: $(SSL_FILE)
    apache_$(VERSION)/Makefile.tmpl
    gzip -cd $(SSL_FILE)|tar xf -

    (cd mod_ssl*; env LIBS=$(LIBS) INCLUDES=$(INCLUDES) $(CONFIGURE)
    --with-apache=../apache_$(VERSION))
    touch apache_$(VERSION)/src/modules/ssl/libssl.module

    clean:
    -rm -rf apache* mm-* mod_ssl-* mod_perl*
     
  6. PanelGuy

    PanelGuy Well-Known Member

    Joined:
    Oct 13, 2004
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Figured out

    I found the problem, had to compile a new .so

    Now I just need to figure out why PHP 5.0.4 won't run as a module inside Apache.
     
  7. jackie46

    jackie46 BANNED

    Joined:
    Jul 25, 2005
    Messages:
    537
    Likes Received:
    0
    Trophy Points:
    0
    Who know. Seems like an aweful amount of trouble to go to just to make one customer happy. If its going to hose your installation why not tell the client to take a hike? :confused:

    Also, your talking about Apache 1.3.33 but the last time i ran easyapache the installation upgrade was Apache 1.3.34.
     
    #7 jackie46, Oct 28, 2005
    Last edited: Oct 28, 2005
  8. PanelGuy

    PanelGuy Well-Known Member

    Joined:
    Oct 13, 2004
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    I;m using 1.3.4 and PHP 5.0.4
    I made my own PHP no problem.

    Sites dont' show it. Ok, let WHM build Apache and rebuild my PHP. OK, still no love.
    Eyeing at the hammer....

    It does a version check fine from SSH2, so it's there, but it doesn't seem to do anything on the web. Not even simple phpinfo.php files.

    Any clues whatsoever? Some small thing I have mised?

    I made sure I rqan Zend, newest vesion, etc.

    It's Fedora Core 4
    Upgraded to Current.
     
Loading...

Share This Page