以下のもので仮想ホストはApacheで動作しました。
D:\ wamp \ bin \ apache \ apache2.2.8 \ conf \ extra
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.localhost
#DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.localhost"
DocumentRoot "D:/wamp/www/"
ServerName localhost
#ServerAlias www.dummy-host.localhost
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" common
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
# DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost"
DocumentRoot "D:/wamp/www/facebook_post_style"
ServerName localhost1
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
# DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost"
DocumentRoot "D:/wamp/www/crop"
ServerName www.example.net
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>
ホストで:
C:\ Windows \ System32 \ drivers \ etc \ hosts
127.0.0.1 localhost
127.0.0.1 localhost1
127.0.0.1 www.example.net
タスクバーのwampアイコンをクリック>Apache>httpd.conf
以下の行を有効にする
仮想ホスト
conf / extra/httpd-vhosts.confをインクルードします