Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apache fails to start under RH7.1



>From: "Stephen J. Turnbull" <turnbull@example.com>
>
>     Jean-Christian> I use /etc/rc.d/init/httpd start.
>
>What are the contents of that file?

I pasted it at the end of this email as it is a bit long.

>That's why I call it "useless."  On Unix, the success flag is 0,
>meaning "no news is good news."  Bad news, on the other hand, should
>be verbose.

I agree! At first I thought it was related to a Perl problem but now I know 
better.

>     Jean-Christian> RH has /var/log/httpd and acccess.log, error.log
>     Jean-Christian> and ssl_request.log.
>
>Where are the latter three?  Also in /var/log?

Yes.

>What, if anything, do they have in them?  (Check their dates to make sure 
>they're related to your recent work.)

Nothing. When I have the FAILED error starting apache nothing gets appended 
to those files.

>No.  /etc/hosts is part of the DNS system.  /etc/hostname is something 
>else.

Hum . . . no file called hostname on my system then. Is that a Bad 
Thing[tm]?

>This is definitely wrong.  localhost is reserved for the loopback
>interface.

Ok. No more assigning localhost to ips besides 127.0.0.1 :)

>Yes.  If your host doesn't have a nameserver to ask, then it has to
>look in /etc/hosts for all DNS information.  Do you have a nameserver
>configured in /etc/resolv.conf?

Yes I do. But my machine has private IP address so no resolution should take 
place, I hope.

>     Jean-Christian> - where did the hostname devtwo come from?
>
>My guess is that you typed it into some random GUI configurator,
>possibly for the nameserver on the network.

Makes sense. But where is it stored now? I definitely have to get that 
fixed.

>     Jean-Christian> - why is RH unhappy if I don't put an entry in
>     Jean-Christian> /etc/hosts for my ip?
>
>Because some applications (especially IPv6-compliant ones) try to find
>out the hostname.  If one of them is started before the network is,
>then the only way to find out is a local file.  Or your nameserver may
>be screwed up, in which case they'll have problems even if the network
>is started.  If it's not a daemon process, then the boot will appear
>to hang at that point.

Ok. If I understand your logic this means that all machine with IPs (even 
private ones) must put an entry in /etc/hosts?

JC

[root@example.com /root]# cat /etc/rc.d/init.d/httpd
#!/bin/bash
#
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server.  It is used to serve \
#	       HTML files and CGI.
# processname: httpd
# pidfile: /var/run/httpd.pid
# config: /etc/httpd/conf/access.conf
# config: /etc/httpd/conf/httpd.conf
# config: /etc/httpd/conf/srm.conf

# Source function library.
. /etc/rc.d/init.d/functions

# This will prevent initlog from swallowing up a pass-phrase prompt.
INITLOG_ARGS=""

# Source additional OPTIONS if we have them.
if [ -f /etc/sysconfig/apache ] ; then
	. /etc/sysconfig/apache
fi

# Path to the httpd binary.
httpd=/usr/sbin/httpd
prog=httpd
RETVAL=0

# Change the major functions into functions.
moduleargs() {
	moduledir=/usr/lib/apache
	moduleargs=`
	/usr/bin/find ${moduledir} -type f -perm -0100 -name "*.so" | awk '{\
		gsub(".*/","");\
		gsub("^mod_","");\
		gsub("^lib","");\
		gsub("\.so$","");\
		print "-DHAVE_" toupper($0)}'`
	echo ${moduleargs}
}
start() {
	echo -n $"Starting $prog: "
	daemon $httpd `moduleargs` $OPTIONS
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && touch /var/lock/subsys/httpd
	return $RETVAL
}
stop() {
	echo -n $"Stopping $prog: "
	killproc $httpd
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/httpd /var/run/httpd.pid
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
	status $httpd
	;;
  restart)
	stop
	start
	;;
  reload)
	echo -n $"Reloading $prog: "
	killproc $httpd -HUP
	RETVAL=$?
	echo
	;;
  condrestart)
	if [ -f /var/run/httpd.pid ] ; then
		stop
		start
	fi
	;;
  *)
	echo $"Usage: $prog {start|stop|restart|reload|condrestart|status}"
	exit 1
esac

exit $RETVAL

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links