Apacheのバーチャルホストの設定
バーチャルホストとは一つの IP アドレスでいくつかの名前ベースのウェブサイトを実行することです。
やりかたは本家が詳しいですが バーチャルホストの例 - Apache HTTP サーバ バージョン 2.2
一番単純なのは
# Ensure that Apache listens on port 80 Listen 80 # Listen for virtual host requests on all IP addresses NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /www/example1 ServerName www.example.com # Other directives here </VirtualHost> <VirtualHost *:80> DocumentRoot /www/example2 ServerName www.example.org # Other directives here </VirtualHost>
です。
ポートを使い分けたり、ぎゃくに違うURLでも同じサイトを参照させたりする場合はderectiveを足していく形になります。