&tag(Homebrew/apache); *目次 [#k3bbf3df] #contents *参考情報 [#v5a49fd8] -[[Homebrew]] -[[./古い情報20140426]] *インストール [#yb2943dd] -tapが必要 #pre{{ $ brew tap homebrew/dupes $ brew install httpd }} -次のような指示が表示される。 #pre{{ To have launchd start httpd at login: ln -sfv /usr/local/opt/httpd/*.plist ~/Library/LaunchAgents Then to load httpd now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist }} *自動起動設定 [#e8aa8be3] **ポート80で起動し、実行ユーザーを自分とする [#p7ccf0c0] -rootユーザーで動かしたい場合、plistを/Library/LaunchDaemons以下にコピーする必要がある sudo cp /usr/local/opt/httpd/homebrew.mxcl.httpd.plist /Library/LaunchDaemons -設定ファイル/usr/local/etc/apache2/httpd.confを編集する。 #pre{{ User sora Group staff }} -launchctlで設定する sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.httpd.plist ※ちなみに「sudo brew services start httpd」でいけそうに思えるがうまくいかない。 -brew services start httpdは、homebrew.mxcl.httpd.plistを改変してから /Library/LaunchDaemons/homebrew.mxcl.httpd.plistへコピーする。 -このときUserNameにsoraという値が設定されてしまい、rootで起動する設定にもかかわらず一般ユーザー起動扱いになり、ポート80で動かなくなる。 -brew-services.rbを読む限り仕様っぽいがとにかくこのままでは使えない。 * ユーザーディレクトリを有効化 [#p1310a99] -httpd.confに以下を追加して再起動 #pre{{ UserDir Sites # # Control access to UserDir directories. The following is an example # for a site where these directories are restricted to read-only. # <Directory "/Users/*/Sites"> AllowOverride FileInfo AuthConfig Limit Indexes Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec <Limit GET POST OPTIONS> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS> Order deny,allow Deny from all </LimitExcept> </Directory> }}