Apache のVirtualHost 設定を一覧化する方法をいつも忘れるのでメモ。
こんな感じで IPベース、名前ベースの一覧を得ることができます。
# apachectl -t -D DUMP_VHOSTSVirtualHost configuration:192.168.1.1:443 is a NameVirtualHost default server example.net (/path/to/conf.d/00-ssl.conf:132) port 443 namevhost example.net (/path/to/conf.d/00-ssl.conf:132) port 443 namevhost blog.example.jp (/path/to/conf.d/01-blog.example.jp.conf:22) port 443 namevhost example.jp (/path/to/conf.d/01-example.jp.conf:19)192.168.1.1:80 is a NameVirtualHost default server example.net (/path/to/conf.d/00-virtualhost.conf:1) port 80 namevhost example.net (/path/to/conf.d/00-virtualhost.conf:1) port 80 namevhost blog.example.jp (/path/to/conf.d/01-blog.example.jp.conf:22) port 80 namevhost example.jp (/path/to/conf.d/01-example.jp.conf:19) port 80 namevhost dev.example.jp (/path/to/conf.d/01-dev.example.jp.conf:19) port 80 namevhost example.com (/path/to/conf.d/01-example.com.conf:19) alias www.example.com port 80 namevhost hoge.example.jp (/path/to/conf.d/01-hoge.example.jp.conf:19) port 80 namevhost www.example.jp (/path/to/conf.d/01-www.example.jp.conf:19)
最近は VPS が安いので1台のサーバにいくつも VirtualHost をする必要性はないのかもしれませんが。。。。