Apacheバーチャルホスト


httpd.confの設定で
1台のサーバーを違うホスト名で見せることができる。
さらに、ホストごとに、ルートディレクトリを設定できます。


ServerName a.test.com
DocumentRoot /var/www/a


ServerName b.test.com
DocumentRoot /var/www/b

a.test.comなら/var/www/aにアクセス。
b.test.comなら/var/www/bにアクセス。


また、異なるホスト名で同じルートディレクトリにアクセスさせることもできる。

ServerName c.test.com
ServerAlias test.com hoge.com #ここポイント!
DocumentRoot /var/www/c

c.test.comでも、test.comでも、 hoge.comでも、/var/www/cにアクセスする