Shearer-Services
asked on
FreeBSD 6.1, Apache 2.1.4, and rc.d
Apache runs great but I have to manually start it after a reboot. I have included "apache_enable="YES" in /etc/rc.conf. And checked it twice for typos and consider it good. I looked into /etc/rc.d and do not see anything "Apache" there. I think this is the problem but wonder where can I get a copy of the 6.1 start up script to test my theory?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Settings of the user-installed aplications is placed in the /usr/local base. So the the directories to take a look at are /usr/local/etc and /usr/local/etc/rc.d. For apache the configuration files are placed in /usr/local/etc/apache/ and the start-up script is /usr/local/etc/rc.d/apache .sh . The script is placed there by the "make install" but here is the listing anyway:
### start listing here
# cat /usr/local/etc/rc.d/apache .sh
#!/bin/sh
# $FreeBSD: ports/www/apache13-modssl/ files/rcng .sh,v 1.5 2006/02/20 20:47:46 dougb Exp $
# PROVIDE: apache
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
# Define these apache_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/apache
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
apache_enable="${apache_en able-NO}"
apache_flags="-DSSL"
apache_pidfile="/var/run/h ttpd.pid"
. /etc/rc.subr
name="apache"
rcvar=`set_rcvar`
command="/usr/local/sbin/h ttpd"
load_rc_config $name
pidfile="${apache_pidfile} "
start_precmd="`/usr/bin/li mits -e -U www`"
run_rc_command "$1"
### stop listing here
Try to start apache with:
#/usr/local/etc/rc.d/apach e.sh star
And check if it is running:
# /usr/local/etc/rc.d/apache .sh status
apache is running as pid 646.
You do not have to reboot the box.
### start listing here
# cat /usr/local/etc/rc.d/apache
#!/bin/sh
# $FreeBSD: ports/www/apache13-modssl/
# PROVIDE: apache
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
# Define these apache_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/apache
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
apache_enable="${apache_en
apache_flags="-DSSL"
apache_pidfile="/var/run/h
. /etc/rc.subr
name="apache"
rcvar=`set_rcvar`
command="/usr/local/sbin/h
load_rc_config $name
pidfile="${apache_pidfile}
start_precmd="`/usr/bin/li
run_rc_command "$1"
### stop listing here
Try to start apache with:
#/usr/local/etc/rc.d/apach
And check if it is running:
# /usr/local/etc/rc.d/apache
apache is running as pid 646.
You do not have to reboot the box.
Errata:
Try to start apache with:
#/usr/local/etc/rc.d/apach e.sh start
Try to start apache with:
#/usr/local/etc/rc.d/apach
/usr/local/etc/rc.d/
There you'll find a .sh script named:
apache21.sh (hence the apache21_enable line in rc.conf)
If the apache script is called differently, use a corresponding line in rc.conf