Forum Moderators: phranque

Message Too Old, No Replies

Can't get apache server to automatically start on boot

apache server start script for the shell

         

bowie101

4:27 pm on May 2, 2006 (gmt 0)

10+ Year Member




Hi all. I'm using apache 2.0.53 that I compiled from a tarball on my RHEL4 OS. There's a reason why I didn't go with the Apache that comes preinstalled. But that reason might not be so big anymore. anyway...

I installed the Apache binary to it's directory in /usr/local/apache2/bin/httpd . My guess is that the system keeps thinking it's gonna be in /etc/httpd, but alas, it's not there. I'm getting ahead of myself. ...

At startup, the HTTPD service doesn't start. After start up, I try to do it manually using the same file in the init.d directory (instead of directly on the binary, as a form of troubleshooting)

and I get this :

service httpd start
Starting httpd: execvp: No such file or directory
[FAILED]

-----------------------------------------------------

I'm VERY MUCH a newbie with shell scripts, as I am just modifying ones i find. but for the life of me, i can't see what'swrong with the script. maybe there is it's something that isn't there that should be.

/etc/rc.d/init.d/httpd {start¦stop¦restart¦reload¦status}
[root@icecream etc]# /etc/rc.d/init.d/httpd status
httpd dead but subsys locked

and /etc/rc.d/init.d/httpd script reads like thus:

!/bin/sh
#
# Startup script for the Apache Web Server
#
# chkconfig: 345 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd

# config: /usrlocal/apache2/bin/httpd
# config: /usr/local/apache2/conf/httpd.conf

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

# See how we were called.
case "$1" in
start)
echo -n "Starting httpd: "
daemon httpd
echo
touch /var/lock/subsys/httpd
;;
stop)
echo -n "Shutting down http: "
killproc httpd
echo
rm -f /var/lock/subsys/httpd
rm -f /var/run/httpd.pid
touch /var/lock/subsys/httpd
;;
stop)
echo -n "Shutting down http: "
killproc httpd
echo
rm -f /var/lock/subsys/httpd
rm -f /var/run/httpd.pid
;;
status)
status httpd
;;
;;
status)
status httpd
;;
restart)
$0 stop
$0 start
;;
reload)
echo -n "Reloading httpd: "
killproc httpd -HUP
echo
;;
*)
echo "Usage: $0 {start¦stop¦restart¦reload¦status}"
exit 1
esac

exit 0
-----------------------------------------
I read somewhere that I maybe have to put a symbolic link somewhere in a subdirectory of the rc.d directory?

please help!