Re: [問題]關於APACHE2 啟動時問題
※ 引述《epstudio.bbs@bbs.isu.edu.tw》之銘言:
> ※ 引述《chairco.bbs@bbs.yzu.edu.tw (chairco)》之銘言:
> > OS:FREEBSD 6
> > APACHE版本:APACHE2
> > PHP:PHP5
> > 問題:已經編譯好httpd.conf,下啟動指令時,出現:
> > Performing sanity check on apache2 configuration:
> > Syntax OK
> > apache2 not running? (check /var/run/httpd.pid).
> > Starting apache2.
> > 要我確定var/run/底下的httpd.pid是否有動.
> > 但我移動到那裡發現,沒有這個檔案.
> > 用top也發現apache沒有動作.
> > 請問是什麼原因呢?
> > 我在httpd.pid中檢查PIDFILE有設定:
> > <IfModule !mpm_netware.c>
> > PidFile /var/run/httpd.pid
> > </IfModule>
> 你可能沒有在核心中編入這兩項...
> options ACCEPT_FILTER_DATA
> options ACCEPT_FILTER_HTTP
> 放進核心理面,重編核心,應該就可以正常啟動了...
您好,我已經將usr/src/sys/i386/conf裡的原始碼重新編譯,但問題還是存在。
我在猜測,是不是為/usr/local/etc/rc.d/apache2.sh 啟動檔裡的問題呢?
不過我用同學實驗機對照結果,不太懂一些意思,po出給各位大大看一下。
/etc/rc.subr
name="apache2"
rcvar=`set_rcvar`
start_precmd="apache2_precmd"
restart_precmd="apache2_checkconfig"
reload_precmd="apache2_checkconfig"
command="/usr/local/sbin/httpd"
_pidprefix="/var/run/httpd"
^^^^^^^^^^^^^^^^^^^^^^^ 這兩個地方應該沒錯?還請大大開示.
pidfile="${_pidprefix}.pid"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
required_files=/usr/local/etc/apache2/httpd.conf
[ -z "${apache2_enable}" ] && apache2_enable="NO"
[ -z "${apache2ssl_enable}" ] && apache2ssl_enable="NO"
[ -z "${apache2_flags}" ] && apache2_flags=""
[ -z "${apache2limits_enable}" ] && apache2limits_enable="NO"
[ -z "${apache2limits_args}" ] && apache2limits_args="-e -C daemon"
[ -z "${apache2_configfile}" ] && apache2_configfile=""
load_rc_config $name
if [ -n "${2}" ]; then
profile=${2}
if [ "x${apache2_profiles}" != "x" ]; then
pidfile="${_pidprefix}.${profile}.pid"
[ "x${apache2_configfile}" = "x" ] && {
echo "You must define a configuration file (apache2_${profile}_conf
exit 1
}
eval apache2_enable=\${apache2_${profile}_enable:-YES}
eval apache2ssl_enable=\${apache2ssl_${profile}_enable:-NO}
eval apache2_flags=\${apache2_${profile}_flags:-${apache2_flags}}
eval apache2limits_enable=\${apache2limits_${profile}_enable:-${apache2limi
eval apache2limits_args=\${apache2limits_${profile}_args:-${apache2limits_a
pidfile="${_pidprefix}.${profile}.pid"
apache2_flags="-c \"PidFile ${pidfile}\" ${apache2_flags}"
else
echo "$0: extra argument ignored"
fi
else
if [ "x${apache2_profiles}" != "x" ]; then
for profile in ${apache2_profiles}; do
echo "===> apache2 profile: ${profile}"
$0 $1 $profile
retcode=$?
if [ "$?" -ne 0 ]; then
failed="${profile} ({$retcode}) ${failed}"
else
success="${profile} ${success}"
fi
done
exit 0
fi
fi
checkyesno apache2ssl_enable && \
apache2_flags="-DSSL $apache2_flags"
[ "x${apache2_configfile}" != "x" ] && {
apache2_flags="-f ${apache2_configfile} ${apache2_flags}"
required_files=${apache2_configfile}
}
apache2_checkconfig()
{
echo "Performing sanity check on apache2 configuration:"
eval "${command} ${apache2_flags} -t"
}
apache2_precmd()
{
if test -f /usr/local/sbin/envvars
then
. /usr/local/sbin/envvars
fi
if checkyesno apache2limits_enable
then
eval `/usr/bin/limits ${apache2limits_args}` 2>/dev/null
else
fi
}
sig_reload=SIGUSR1
extra_commands="reload"
run_rc_command "$1"
--
※ Origin: 元智大學 風之塔 <bbs.yzu.edu.tw>
※ From : 140.128.8.16
※ X-Info: Re: [問題]關於APACHE2 啟動時問題
※ X-Sign: 12CDJL1/PqliEv8wpUjw (06/07/26 10:08:33 )
討論串 (同標題文章)
FreeBSD 近期熱門文章
PTT數位生活區 即時熱門文章