はじめに
- Apache HTTTPD Server(apache2)はデフォルトのbrewのリポジトリに登録されておらず,tapリポジトリを追加してインストールする.
brewでモジュールを検索
MBA2014:~ ujpadmin$ 🆑brew search apache
apache-activemq apache-flink apache-spark
apache-archiva apache-fop apachetop
apache-brooklyn-cli apache-forrest homebrew/versions/apache-spark141
apache-drill apache-opennlp homebrew/versions/apache-spark15
Caskroom/cask/apache-couchdb Caskroom/cask/apache-directory-studio
MBA2014:~ ujpadmin$
- Apacheプロジェクトのいろいろなものは出てくるが,httpdがない.httpdで探してみる.
MBA2014:~ ujpadmin$ 🆑brew search httpd
darkhttpd libmicrohttpd lighttpd mighttpd2
homebrew/apache/httpd22 homebrew/apache/httpd24🈁 homebrew/emacs/simple-httpd
MBA2014:~ ujpadmin$
MBA2014:~ ujpadmin$ 🆑brew info homebrew/apache/httpd24
Error: No available formula with the name "homebrew/apache/httpd24"
Please tap it and then try again: brew tap homebrew/apache
MBA2014:~ ujpadmin$
- brew tapでリポジトリを増やせと言われている.
brew tapでリポジトリを増やす
- そのままbrew tapを実行するとリポジトリが表示される.
MBA2014:~ ujpadmin$ 🆑brew tap
caskroom/cask
homebrew/apache
homebrew/core
homebrew/services
homebrew/versions
homebrew/x11
MBA2014:~ ujpadmin$
MBA2014:~ ujpadmin$ 🆑brew tap homebrew/apache
==> Tapping homebrew/apache
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-apache'...
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 15 (delta 6), reused 3 (delta 0), pack-reused 0
Unpacking objects: 100% (15/15), done.
Checking connectivity... done.
Tapped 11 formulae (49 files, 80.5K)
MBA2014:~ ujpadmin$
A0146:~ ujpadmin$ 🆑brew search apache
apache-activemq homebrew/apache/httpd24
apache-archiva homebrew/apache/mod_bonjour
apache-brooklyn-cli homebrew/apache/mod_fastcgi
apache-drill homebrew/apache/mod_fcgid
apache-flink homebrew/apache/mod_python
apache-fop homebrew/apache/mod_security
apache-forrest homebrew/apache/mod_suexec
apache-opennlp homebrew/apache/mod_wsgi
apache-spark homebrew/apache/mod_wsgi3
apachetop homebrew/versions/apache-spark141
homebrew/apache/ab homebrew/versions/apache-spark15
homebrew/apache/httpd22
- homebrew/apacheで色々と増えた.
- 今回は,この中からhttpd24(Apache httpd 2.4系)をインストールしてみる.
Apache httpdのインストール
MBA2014:~ ujpadmin$ 🆑brew info homebrew/apache/httpd24
homebrew/apache/httpd24: stable 2.4.18 (bottled)
HTTP server
https://httpd.apache.org/
Conflicts with: homebrew/apache/httpd22
Not installed
From: https://github.com/Homebrew/homebrew-apache/blob/master/httpd24.rb
==> Dependencies
Required: openssl ✔, pcre ✔, homebrew/dupes/zlib ✘, apr-util ✘🈁
==> Options
--with-http2
Build and enable the HTTP/2 shared Module
--with-ldap
Include support for LDAP
--with-mpm-event
Use the Event Multi-Processing Module instead of Prefork
--with-mpm-worker
Use the Worker Multi-Processing Module instead of Prefork
--with-privileged-ports
Use the default ports 80 and 443 (which require root privileges), instead of 8080 and 8443
==> Caveats
To have launchd start homebrew/apache/httpd24 now and restart at login:
brew services start homebrew/apache/httpd24
Or, if you don't want/need a background service you can just run:
apachectl start
MBA2014:~ ujpadmin$
- 依存しているzlibとapr-utilが入ってない模様.
- インストールを実行.
MBA2014:~ ujpadmin$ 🆑brew install homebrew/apache/httpd24
==> Installing httpd24 from homebrew/apache
==> Tapping homebrew/dupes
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-dupes'...
remote: Counting objects: 42, done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 42 (delta 0), reused 5 (delta 0), pack-reused 0
Unpacking objects: 100% (42/42), done.
Checking connectivity... done.
Tapped 38 formulae (103 files, 119.8K)
==> Installing dependencies for homebrew/apache/httpd24: homebrew/dupes/zlib, apr, apr-u
==> Installing homebrew/apache/httpd24 dependency: homebrew/dupes/zlib
==> Downloading https://homebrew.bintray.com/bottles-dupes/zlib-1.2.8.yosemite.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring zlib-1.2.8.yosemite.bottle.1.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/zlib/lib
CPPFLAGS: -I/usr/local/opt/zlib/include
==> Summary
🍺 /usr/local/Cellar/zlib/1.2.8: 11 files, 357.9K
==> Installing homebrew/apache/httpd24 dependency: apr
==> Downloading https://homebrew.bintray.com/bottles/apr-1.5.2.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring apr-1.5.2.yosemite.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
Apple's CLT package contains apr.
==> Summary
🍺 /usr/local/Cellar/apr/1.5.2: 56 files, 1.2M
==> Installing homebrew/apache/httpd24 dependency: apr-util
==> Downloading https://homebrew.bintray.com/bottles/apr-util-1.5.4_1.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring apr-util-1.5.4_1.yosemite.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
Apple's CLT package contains apr.
==> Summary
🍺 /usr/local/Cellar/apr-util/1.5.4_1: 50 files, 684.6K
==> Installing homebrew/apache/httpd24
==> Downloading https://homebrew.bintray.com/bottles-apache/httpd24-2.4.18.yosemite.bottle.tar.
######################################################################## 100.0%
==> Pouring httpd24-2.4.18.yosemite.bottle.tar.gz
==> Caveats
To have launchd start homebrew/apache/httpd24 now and restart at login:
brew services start homebrew/apache/httpd24🈁
Or, if you don't want/need a background service you can just run:
apachectl start
==> Summary
🍺 /usr/local/Cellar/httpd24/2.4.18: 209 files, 4.2M
MBA2014:~ ujpadmin$
- 以下のコマンドでOS起動時に実行されるよう設定できる.
launchd start homebrew/apache/httpd24 now and restart
brew services start homebrew/apache/httpd24
Apacheを起動する
MBA2014:~ ujpadmin$ 🆑which apachectl
/usr/local/bin/apachectl
MBA2014:~ ujpadmin$
MBA2014:~ ujpadmin$ 🆑apachectl start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using MBA2014.local.
Set the 'ServerName' directive globally to suppress this message
MBA2014:~ ujpadmin$
- さすがに動かない.ServerNameが設定されてないため.
- プログラムは以下のようにインストールされている.
MBA2014:~ ujpadmin$ 🆑brew list httpd24
/usr/local/Cellar/httpd24/2.4.18/bin/ab
/usr/local/Cellar/httpd24/2.4.18/bin/apachectl
/usr/local/Cellar/httpd24/2.4.18/bin/apxs
/usr/local/Cellar/httpd24/2.4.18/bin/checkgid
/usr/local/Cellar/httpd24/2.4.18/bin/dbmmanage
/usr/local/Cellar/httpd24/2.4.18/bin/fcgistarter
/usr/local/Cellar/httpd24/2.4.18/bin/htcacheclean
/usr/local/Cellar/httpd24/2.4.18/bin/htdbm
/usr/local/Cellar/httpd24/2.4.18/bin/htdigest
/usr/local/Cellar/httpd24/2.4.18/bin/htpasswd
/usr/local/Cellar/httpd24/2.4.18/bin/httpd
/usr/local/Cellar/httpd24/2.4.18/bin/httxt2dbm
/usr/local/Cellar/httpd24/2.4.18/bin/logresolve
/usr/local/Cellar/httpd24/2.4.18/bin/rotatelogs
/usr/local/Cellar/httpd24/2.4.18/bin/suexec
/usr/local/Cellar/httpd24/2.4.18/build/ (9 files)
/usr/local/Cellar/httpd24/2.4.18/homebrew.mxcl.httpd24.plist
/usr/local/Cellar/httpd24/2.4.18/include/httpd/ (62 files)
/usr/local/Cellar/httpd24/2.4.18/libexec/ (103 files)
/usr/local/Cellar/httpd24/2.4.18/share/man/ (14 files)
MBA2014:~ ujpadmin$
**httpd.confの確認
以下のディレクトリに保管されている.
MBA2014:~ ujpadmin$ 🆑ls -la /usr/local/etc/apache2/2.4/
total 96
drwxr-xr-x 9 ujpadmin admin 306 7 7 11:20 .
drwxr-xr-x 3 ujpadmin admin 102 7 7 11:20 ..
-rw-r--r-- 1 ujpadmin admin 1111 7 7 11:20 envvars
-rw-r--r-- 1 ujpadmin admin 1111 7 7 11:20 envvars-std
drwxr-xr-x 14 ujpadmin admin 476 7 7 11:20 extra
-rw-r--r-- 1 ujpadmin admin 19371 7 7 11:20 httpd.conf
-rw-r--r-- 1 ujpadmin admin 13077 7 7 11:20 magic
-rw-r--r-- 1 ujpadmin admin 53011 7 7 11:20 mime.types
drwxr-xr-x 4 ujpadmin admin 136 7 7 11:20 original
MBA2014:~ ujpadmin$