&tag(Homebrew/apache); *目次 [#k3bbf3df] #contents *参考情報 [#v5a49fd8] -[[Homebrew]] *インストール [#yb2943dd] -tapが必要 #pre{{ $ brew tap Homebrew/dupes $ brew install httpd }} -次のようなインストラクションが表示される #pre{{ You should reload httpd: launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist launchctl load ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist }} *起動 [#t209dc83] -/usr/local/sbin/apachectlで制御する。 -デフォルト設定のポート80で動かす場合root権限が必要。(ログインユーザーで起動するとエラーになるはず)。 sudo /usr/local/sbin/apachectl start -ブラウザで、http://localhost にアクセスし動いていればOK。 ※[[httpd log and run directories not being created · Issue #119 · Homebrew/homebrew-dupes · GitHub:https://github.com/Homebrew/homebrew-dupes/issues/119]]に、run、logディレクトリが作られず起動できないエラーが報告されている。手動でディレクトリを作らないとだめかも(と思ったけど、rootで起動すれば大丈夫かも。場所は/usr/local/var/apache2/log)。 *自動起動 [#i738145d] -以下のコマンドを実行。 sudo brew services start httpd -/Library/LaunchAgents/homebrew.mxcl.httpd.plistが作られる(ログインユーザーで実行した場合~/Library/LaunchAgents/homebrew.mxcl.httpd.plistが作られる)。 sudo launchctl load -w /Library/LaunchAgents/homebrew.mxcl.httpd.plist