2005-07-12
_ Mac OS X で Apache 2.x
インストール
何も考えずにデフォルト。
rin@kahori[/usr/pkgsrc/www/apache2]% sudo bmake install
設定
起動項目を修正。
/usr/sbin/apachectl が実行されてしまうので /usr/pkg/sbin/apachectl をフルパスで指定する。
rin@kahori[/System/Library/StartupItems/Apache]% diff -u Apache.20040528 Apache
--- Apache.20040528 Tue Jul 12 20:37:42 2005
+++ Apache Wed Jul 13 22:57:41 2005
@@ -10,10 +10,7 @@
{
if [ "${WEBSERVER:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Starting Apache web server"
- if [ ! -e /etc/httpd/httpd.conf ] ; then
- cp -p /etc/httpd/httpd.conf.default /etc/httpd/httpd.conf
- fi
- apachectl start
+ /usr/pkg/sbin/apachectl start
if [ "${WEBPERFCACHESERVER:=-NO-}" = "-YES-" ]; then
if [ -x /usr/sbin/webperfcachectl ]; then
ConsoleMessage "Starting web performance cache server"
@@ -30,14 +27,14 @@
/usr/sbin/webperfcachectl stop
fi
ConsoleMessage "Stopping Apache web server"
- apachectl stop
+ /usr/pkg/sbin/apachectl stop
}
RestartService ()
{
if [ "${WEBSERVER:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Restarting Apache web server"
- apachectl restart
+ /usr/pkg/sbin/apachectl restart
if [ "${WEBPERFCACHESERVER:=-NO-}" = "-YES-" ]; then
if [ -x /usr/sbin/webperfcachectl ]; then
ConsoleMessage "Restarting web performance cache server"
起動確認
すでに動いている apache を止める。
% sudo /usr/sbin/apachectl stop /usr/sbin/apachectl stop: httpd stopped
開始。
rin@kahori[/System/Library/StartupItems/Apache]% sudo ./Apache start Starting Apache web server
停止。
rin@kahori[/System/Library/StartupItems/Apache]% sudo ./Apache stop Stopping Apache web server
[ツッコミを入れる]



