手持ちの MacBook Air (Mac OS X Snow Leopard) に、 Apache 1.3.42 をソースからインストールしてみる。

Apache 1.3.42 は、1.3系で最後のバージョン。もうサポートされない予感。

Apache 1.3.42 is also available 2010-02-02

Apache 1.3.42 is the final stable version of the 1.3 series, which has now reached end of life status.

For details see the Official Announcement and the CHANGES_1.3 and CHANGES_1.3.42 lists.

Use the Apache 1.3.42 version only if you must use a third party module that is not available as an Apache 2.x module. Modules compiled for Apache 2.x are not compatible with Apache 1.3, and modules compiled for Apache 1.3 are not compatible with Apache 2.x.

Apache 1.3 releases can be found on the archive download site.

Download - The Apache HTTP Server Project

ざっと、ダウンロードしてコンパイルしてインストールする流れ。

URLを操るための mod_rewrite と、リバースプロキシのために mod_proxy も入れる。


$ wget http://archive.apache.org/dist/httpd/apache_1.3.42.tar.gz
$ tar zxf ./apache_1.3.42.tar.gz
$ ls
apache_1.3.42		apache_1.3.42.tar.gz
$ cd apache_1.3.42
$ ./configure --enable-module=so --enable-module=rewrite --enable-shared=rewrite --enable-module=proxy --enable-shared=proxy
$ make
$ sudo make install

やけにいろいろな場所にファイルが配置された。デフォルトインストールなら /usr/local/apache 以下に全部インストールされるもんだと思ってたのに。

とりあえず、インストールされた Apache 1.3.42 の情報を出力。


$ /usr/sbin/httpd -V
Server version: Apache/1.3.42 (Darwin)
Server built:   Feb 18 2011 12:58:11
Server's Module Magic Number: 19990320:18
Server compiled with....
 -D HAVE_MMAP
 -D USE_MMAP_SCOREBOARD
 -D USE_MMAP_FILES
 -D HAVE_FCNTL_SERIALIZED_ACCEPT
 -D HAVE_FLOCK_SERIALIZED_ACCEPT
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D DYNAMIC_MODULE_LIMIT=64
 -D HARD_SERVER_LIMIT=256
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="/var/run/httpd.scoreboard"
 -D DEFAULT_LOCKFILE="/var/run/httpd.lock"
 -D DEFAULT_ERRORLOG="/var/log/httpd/error_log"
 -D TYPES_CONFIG_FILE="/etc/httpd/mime.types"
 -D SERVER_CONFIG_FILE="/etc/httpd/httpd.conf"
 -D ACCESS_CONFIG_FILE="/etc/httpd/access.conf"
 -D RESOURCE_CONFIG_FILE="/etc/httpd/srm.conf"

設定ファイルは /etc/httpd/ 以下に。


$ cd /etc/httpd
$ ls -la
total 432
drwxr-xr-x  12 root  wheel    408  2 18 12:59 .
drwxr-xr-x  91 root  wheel   3094  2 18 12:59 ..
-rw-r--r--   1 root  wheel    348  2 18 12:59 access.conf
-rw-r--r--   1 root  wheel    348  2 18 12:59 access.conf.default
-rw-r--r--   1 root  wheel  33641  2 18 12:59 httpd.conf
-rw-r--r--   1 root  wheel  33641  2 18 12:59 httpd.conf.default
-rw-r--r--   1 root  wheel  12965  2 18 12:59 magic
-rw-r--r--   1 root  wheel  12965  2 18 12:59 magic.default
-rw-r--r--   1 root  wheel  45472  2 18 12:59 mime.types
-rw-r--r--   1 root  wheel  45472  2 18 12:59 mime.types.default
-rw-r--r--   1 root  wheel    357  2 18 12:59 srm.conf
-rw-r--r--   1 root  wheel    357  2 18 12:59 srm.conf.default

ざっと httpd.conf の中をながめてみる。

以下に、ServerRoot や Port ディレクティブなどいくつかの情報をピックアップしておく。


ServerRoot "/usr"
Port 8080
PidFile /var/run/httpd.pid
ScoreBoardFile /var/run/httpd.scoreboard
DocumentRoot "/Library/WebServer/Documents"
ErrorLog /var/log/httpd/error_log
CustomLog /var/log/httpd/access_log common
Alias /icons/ "/usr/share/httpd/icons/"
ScriptAlias /cgi-bin/ "/Library/WebServer/CGI-Executables/"

Apache の起動。


$ sudo /usr/sbin/apachectl start
/usr/sbin/apachectl start: httpd started

ブラウザから http://localhost:8080/ にアクセスすると It works! と表示される。

Apache の停止。


$ sudo /usr/sbin/apachectl stop
/usr/sbin/apachectl stop: httpd stopped

アンインストールしてみる。
が、 Makefile には uninstall ターゲットがない。
ということは手動でファイルを削除しないといけない。

このへんにインストールされたファイルが入っているっぽいので、削除。


$ sudo rm -r /Library/WebServer
$ sudo rm -r /var/log/httpd
$ sudo rm -r /usr/share/httpd
$ sudo rm -r /etc/httpd

インストールされた日時からファイルのタイムスタンプを目視で見てみた感じでは、たぶんこのへんもインストール時に入ったファイルなので削除。


$ cd /usr/sbin
$ sudo rm ./apachectl ./apxs ./httpd ./logresolve ./rotatelogs

ふぅ。

tags: mac_os_x Apache zurazure

Posted by NI-Lab. (@nilab)