Apache2でのバーチャルホストの設定
構築したredmineに http://192.168.24.93:8000/ なんてな感じでアクセスしていました。しかしせっかくBIND9も設置したしそれっぽい名前でアクセスしたいなと思いまして設定しました。
2. Apache2の設定
/etc/apache2/sites-available/redmine を以下のように変更。
- <VirtualHost *:8000> + <VirtualHost *:80> - ServerName redmine + ServerName redmine.naoyes.mnb DocumentRoot /usr/share/redmine/public </VirtualHost>
/etc/apache2/ports.conf を以下のように、8000ポートでListenしないようにしました。
- Listen 8000 +
以上です。簡単ですね。
接続の確認
ヘッダが取得できました。問題なさそうです。
$ telnet redmine.naoyes.mnb 80 Trying 192.168.24.93... Connected to argyle.mnb. Escape character is '^]'. HEAD / HTTP/1.1 Host: redmine.naoyes.mnb HTTP/1.1 200 OK Date: Wed, 23 Nov 2011 14:55:12 GMT Server: Apache/2.2.17 (Ubuntu) X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 2.2.11 Content-Type: text/html; charset=utf-8