Skip to content

Instantly share code, notes, and snippets.

@nissuk
Created April 23, 2011 12:58
Show Gist options
  • Save nissuk/938585 to your computer and use it in GitHub Desktop.
Save nissuk/938585 to your computer and use it in GitHub Desktop.
Apache+XAMPP: VirtualHostを設定する単純な例
# C:\Windows\System32\drivers\etc
# ServerName で指定したドメイン名を127.0.0.1に向けます。
127.0.0.1 dev.localhost
# C:\xampp\apache\conf\extra\httpd-vhosts.conf
# VirtualHostを設定します。
<VirtualHost *:80>
DocumentRoot "C:/users/you/dev"
ServerName dev.localhost
</VirtualHost>
# VirtualHostのルートに設定するディレクトリの設定をします。
# ディレクトリの位置とhttpd.confの設定によっては
# ここでアクセス許可設定をしないと403 Forbiddenになるので注意してください。
# この例のディレクトリは<Directory />だけにマッチしており、
# <Directory />の設定が「Order deny,allow」「Deny from all」ですべて拒否だったため
# localhostだけにアクセスを許可しています。
<Directory "C:/users/you/dev">
Order deny,allow
Deny from all
Allow from localhost
</Directory>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment