0

Binary is located in /usr/sbin/

When I ran strace -o httpdstart.txt /usr/bin/httpd -k start

It has the following lines to open the httpd.conf

stat("/etc/httpd/conf/httpd.conf", {st_mode=S_IFREG|0644, st_size=35894, ...}) = 0
open("/etc/httpd/conf/httpd.conf", O_RDONLY|O_CLOEXEC) = 3

So when loading manually via:

httpd -k start

or

/usr/bin/httpd -k start

httpd loads as expected with the /etc/httpd/conf/httpd.conf for configuration.

I also ran strace -o httpdstart.txt /etc/init.d/httpd -k start

i get:

Usage: httpd {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful|help|configtest}

So the usage says that I cannot use any option with httpd rc script.

So I ran strace -o httpdstart1.txt /etc/init.d/httpd start. It does not have trace of opening any httpd.conf file.


the httpd rc script in init.d has:

apachectl=/usr/sbin/apachectl
httpd=${HTTPD-/usr/sbin/httpd}

i.e. its pointing to the proper binary file.


httpd -V has the following output:

Server version: Apache/2.2.21 (Unix)
Server built: Sep 13 2011 13:46:54
Server's Module Magic Number: 20051115:30
Server loaded: APR 1.4.5, APR-Util 1.3.10
Compiled using: APR 1.4.5, APR-Util 1.3.12
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"


When loaded through rcscript, DocumentRoot doesn't get set and

ErrorDocument 403 /error/noindex.html

happens(present in welcome.conf), and loads the Fedora Test Page. If I remove the welcome.conf. I will get a Forbidden You don't have permission to access / on this server. What is it that is going wrong here?

1 Answer 1

2

It looks to me like it's two different apaches. One was at /usr/bin/httpd and the other at /usr/sbin/httpd. Try manually starting the "sbin" one and see if the output of httpd -V is the same as when it starts up through the rc script.

9
  • There is no httpd present in /usr/bin Jan 13, 2012 at 15:15
  • and yes that output is the same as /usr/sbin/httpd -V Jan 13, 2012 at 15:17
  • Hmm.. as a work around, could you use the '-f' argument to specify a config file in the /etc/init.d/httpd script? That script also makes mention of an alternate conf file located in /etc/sysconfig/httpd.. does it have anything to do with it?
    – Safado
    Jan 13, 2012 at 15:18
  • One more thing, I am trying to start httpd during the startup. Jan 13, 2012 at 15:29
  • My guess would be under that Start() function, like "LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd -f "/etc/httpd/conf/httpd.conf" $OPTIONS". I don't have an idle web server to test it on though, so I have no idea if it will work like I'm thinking it will.
    – Safado
    Jan 13, 2012 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.