Windows環境でのVirtualHostの設定
「C:¥WINDOWS¥system32¥drivers¥etc¥hosts」に
127.0.0.1 localhost
と記載されているので、
127.0.0.1 localhost hoge
を追記する。
Apacheの「httpd.conf」に
<VirtualHost *:80> ServerAdmin webmaster@hoge.com DocumentRoot "C:/hoge/htdocs" ServerName hoge </VirtualHost>
を追記。
もしかするとlocalhostの設定も必須なのかも。
(↑試してないです、ごめんなさい)
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot "C:/www_root" ServerName localhost </VirtualHost>
Apacheの設定を変更したので、restartは必要。
以上でブラウザからhttp://hoge/にアクセスできるはず。
NameVirtualHost *:80
あと、この行のコメントもはずしておく必要があるっぽい。
コメントする