Mailing List Archive

Fault in the /etc/init.d/httpd script?
Hello all,

A while ago (10th of december 2001) I reported a problem with the Apache
HTTPD server running on my development server (subject was: "[crit] (98)
Address already in use: make_sock: could not bind to port 80"). After a
short conversation, I came to the conclusion that the fault must be in
the initialisation script. I still hold to that conclusion, and have
found the time to do some more digging.
In the launch script, there's a line 'daemon $httpd `moduleargs`
$OPTIONS'. If I comment out everything after $httpd, httpd doesn't crash
after startup. If I don't it does. If I put the hash (for commenting)
after `moduleargs`, httpd crashes after launching.
If I leave the $OPTIONS in, but remove the `moduleargs`, it doesn't
crash.
Here's a dump of the moduleargs subroutine:
-- BEGIN moduleargs() --
moduleargs() {
moduledir=/usr/lib/apache
moduleargs=`
/usr/bin/find ${moduledir} -type f -perm -0100 -name "*.so" | env -i
tr '[:lower:]' '[:upper:]' | awk '{\
gsub(/.*\//,"");\
gsub(/^MOD_/,"");\
gsub(/^LIB/,"");\
gsub(/\.SO$/,"");\
print "-DHAVE_" $0}'`
echo ${moduleargs}
}
--- END moduleargs() ---
and a listing of the /usr/lib/apache directory:
-- BEGIN ll /usr/lib/apache --
-rw-r--r-- 1 root root 8304 Sep 5 23:12 httpd.exp
-rwxr-xr-x 1 root root 121448 Jul 24 16:08 libdav.so
-rwxr-xr-x 1 root root 1230754 Jun 24 2001 libperl.so
-rwxr-xr-x 1 root root 1365307 Aug 27 20:47 libphp4.so
-rwxr-xr-x 1 root root 75587 Sep 5 23:12 libproxy.so
-rwxr-xr-x 1 root root 210030 Jul 25 05:05 libssl.so
-rwxr-xr-x 1 root root 10134 Sep 5 23:12 mod_access.so
-rwxr-xr-x 1 root root 8641 Sep 5 23:12 mod_actions.so
-rwxr-xr-x 1 root root 10717 Sep 5 23:12 mod_alias.so
-rwxr-xr-x 1 root root 7024 Sep 5 23:12 mod_asis.so
-rwxr-xr-x 1 root root 8266 Sep 5 23:12 mod_auth_anon.so
-rwxr-xr-x 1 root root 9586 Sep 5 23:12 mod_auth_dbm.so
-rwxr-xr-x 1 root root 9404 Sep 5 23:12 mod_auth_db.so
-rwxr-xr-x 1 root root 10533 Sep 5 23:12 mod_auth.so
-rwxr-xr-x 1 root root 27520 Sep 5 23:12 mod_autoindex.so
-rwxr-xr-x 1 root root 9587 Sep 5 23:12 mod_cern_meta.so
-rwxr-xr-x 1 root root 15040 Sep 5 23:12 mod_cgi.so
-rwxr-xr-x 1 root root 10723 Sep 5 23:12 mod_digest.so
-rwxr-xr-x 1 root root 8086 Sep 5 23:12 mod_dir.so
-rwxr-xr-x 1 root root 8017 Sep 5 23:12 mod_env.so
-rwxr-xr-x 1 root root 13517 Sep 5 23:12 mod_example.so
-rwxr-xr-x 1 root root 9968 Sep 5 23:12 mod_expires.so
-rwxr-xr-x 1 root root 8009 Sep 5 23:12 mod_headers.so
-rwxr-xr-x 1 root root 16074 Sep 5 23:12 mod_imap.so
-rwxr-xr-x 1 root root 35122 Sep 5 23:12 mod_include.so
-rwxr-xr-x 1 root root 20059 Sep 5 23:12 mod_info.so
-rwxr-xr-x 1 root root 7538 Sep 5 23:12 mod_log_agent.so
-rwxr-xr-x 1 root root 17770 Sep 5 23:12 mod_log_config.so
-rwxr-xr-x 1 root root 8470 Sep 5 23:12 mod_log_referer.so
-rwxr-xr-x 1 root root 22637 Sep 5 23:12 mod_mime_magic.so
-rwxr-xr-x 1 root root 14897 Sep 5 23:12 mod_mime.so
-rwxr-xr-x 1 root root 10640 Sep 5 23:12 mod_mmap_static.so
-rwxr-xr-x 1 root root 26832 Sep 5 23:12 mod_negotiation.so
-rwxr-xr-x 1 root root 53193 Sep 5 23:12 mod_rewrite.so
-rwxr-xr-x 1 root root 10276 Sep 5 23:12 mod_setenvif.so
-rwxr-xr-x 1 root root 11984 Sep 5 23:12 mod_speling.so
-rwxr-xr-x 1 root root 18465 Sep 5 23:12 mod_status.so
-rwxr-xr-x 1 root root 8469 Sep 5 23:12 mod_unique_id.so
-rwxr-xr-x 1 root root 8838 Sep 5 23:12 mod_userdir.so
-rwxr-xr-x 1 root root 9884 Sep 5 23:12 mod_usertrack.so
-rwxr-xr-x 1 root root 9951 Sep 5 23:12 mod_vhost_alias.so
--- END ll /usr/lib/apache ---
I am tempted to come to the conclusion that one of these modules is
causing httpd to crash - but I don't know which one. My guess would be
either one of libperl.so, libphp4.so, libdav.so or libssl.so, because
these are in IfDefine wrappers in the /etc/httpd/conf/httpd.conf file
(and, if I am correct in this, are not loaded when no modules are
defined on the command-line).

The Apache version I'm using is still apache-1.3.20-16

My questions:
* Am I correct in assuming that one of the modules must be the cause
of the crashes?
* Am I correct in assuming it's one of the four I mentioned?
* Any recommendations to get rid of this error?

Other things I noticed: Perl is working fine (or seems to be) if httpd
is started without arguments - PHP doesn't work (PHP4 is installed).

Any pointers are greatly appreciated.

Thanx!

Ronald


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org