回答:
Apacheは80
機密性の高いシステムレベルのポートと見なされる予約ポート()で実行されるためapachectl restart
、次のsudo
ように実行する必要があります。
sudo apachectl -k restart
パスワードを入力すると、パスワードが入力されます。管理者権限がある場合、パスワードを入力するだけでApacheが再起動します。その他のコマンドにはstart
、stop
Apacheを起動するために次のように実行できるものがあります。
sudo apachectl -k start
Apacheを停止するには、次のようにします。
sudo apachectl -k stop
また、apachectl
何も入力せずにapachectl
入力すると、コマンドで使用できるオプションとディレクティブのリストが表示されます。これはMac OS X 10.9.5からの私の出力です:
Usage: /usr/sbin/httpd [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
-S : a synonym for -t -D DUMP_VHOSTS
-t -D DUMP_MODULES : show all loaded modules
-M : a synonym for -t -D DUMP_MODULES
-t : run syntax check for config files
-T : start without DocumentRoot(s) check