|
here are the steps
edit httpd.conf
1. change Users and Groups to www
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# . On SCO (ODT 3) use "User nouser" and "Group nogroup".
# . On HPUX you may not be able to use shared memory as nobody, and the
# suggested workaround is to create a user www and use that user.
# NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
# when the value of (unsigned)Group is above 60000;
# don't use Group nobody on these systems!
#
User www
Group www
2. Change Pidfile to /private/var/run/httpd.pid
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile /private/var/run/httpd.pid
3. edit apachectl and change path to pid file
# the path to your PID file
PIDFILE=/private/var/run/httpd.pid
4. make sure /System/Library/StartupItems/Apache/Apache looks something like this ($WEBSERVER vars must be used)
#!/bin/sh
##
# Apache HTTP Server
##
. /etc/rc.common
StartService ()
{
if [ "${WEBSERVER:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Starting Apache"
/usr/local/apache/bin/apachectl start
fi
}
StopService ()
{
ConsoleMessage "Stopping Apache"
/usr/local/apache/bin/apachectl stop
}
RestartService ()
{
if [ "${WEBSERVER:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Restarting Apache"
/usr/local/apache/bin/apachectl restart
else
StopService
fi
}
RunService "$1"
|