apacheをインストールしたけど動かなかった件

1: FreeBSDportsapacheを入れる。
2: /etc/rc.confに「apache2_enable="YES"」と書く
3: なぜかapacheを起動できない
4: twitterに泣きつく
5:

/usr/local/etc/rc.d/apache22 rcvar とか見てみるとよいかも? by taraijpn

6:

# /usr/local/etc/rc.d/apache22 rcvar
# apache22
apache22_enable=NO

7: 「apache22_enable="YES"」に書き換える。

# /usr/local/etc/rc.d/apache22 rcvar
# apache22
apache22_enable=YES

8: 「/usr/local/etc/rc.d/apache22 start」してみる。→ ps -x したけどhttpdapacheもいない。
9: http://www.mail-archive.com/freebsd-users-jp@jp.freebsd.org/msg01982.html
10: httpd.confも書き換えてみる。

# /usr/local/etc/rc.d/apache22 start
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.
# ps -awx | grep "httpd"
86314  p2  T      0:02.00 emacs /usr/local/etc/apache22/httpd.conf
# ps -awx | grep "apache"
86314  p2  T      0:02.00 emacs /usr/local/etc/apache22/httpd.conf
# ps -awx | grep "www"

なんのエラーメッセージも出さないのにプロセスもいない。

11: wwwユーザがいないと思ったけどいた

# ls /home/www
ls: /home/www: No such file or directory
(/home/wwwは存在しない)

# su www
This account is currently not available.
# su wwwwww
su: unknown login: wwwwww
(wwwというユーザ自体は存在するみたい)

追記:「cat /etc/passwd」でいい。cf. http://twitter.com/cent/statuses/800984873

12: どうにもわからないのでmake deinstallしてmake reinstallしてみる。

13: とりあえずリブートしてみるwindows脳。

14:

/var/log/apache22/ 以下で error log を読むべし by wtanabe

> cd /var/log/
> tail httpd-error.log
[Thu May 01 15:41:17 2008] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu May 01 15:41:17 2008] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "*******"
Configuration Failed

検索してみる。

エラーログを確認すると、
(EAI 8)host/servname not known: mod_unique_id: unable to find IPv4 address of "hostname"
って感じだったので、
/etc/hostsに追加

http://www.manami.st/clog/2006-11-17-2.html

おお!It works!って出た!みんなありがとう!!!

        • -

http://d.hatena.ne.jp/nishiohirokazu/20080421/1208764084 に書き足した。