XAMPPを使って開発環境を整えるにあたり、バーチャルホストを導入しようとしても上手く行きません。
http://qiita.com/devsparks/items/c4f6a5d4897301e832a7
の記事を参考に
httpd.confの一部コメントを外してhttpd-vhosts.confを有効にし、httpd-vhosts.confを以下のように書き換えました。
lang
1# Virtual Hosts 2# 3# Required modules: mod_log_config 4 5# If you want to maintain multiple domains/hostnames on your 6# machine you can setup VirtualHost containers for them. Most configurations 7# use only name-based virtual hosts so the server doesn't need to worry about 8# IP addresses. This is indicated by the asterisks in the directives below. 9# 10# Please see the documentation at 11# <URL:http://httpd.apache.org/docs/2.4/vhosts/> 12# for further details before you try to setup virtual hosts. 13# 14# You may use the command line option '-S' to verify your virtual host 15# configuration. 16 17# 18# VirtualHost example: 19# Almost any Apache directive may go into a VirtualHost container. 20# The first VirtualHost section is used for all requests that do not 21# match a ServerName or ServerAlias in any <VirtualHost> block. 22# 23#<VirtualHost *:80> 24# ServerAdmin webmaster@dummy-host.example.com 25# DocumentRoot "/Applications/XAMPP/xamppfiles/docs/dummy-host.example.com" 26# ServerName dummy-host.example.com 27# ServerAlias www.dummy-host.example.com 28# ErrorLog "logs/dummy-host.example.com-error_log" 29# CustomLog "logs/dummy-host.example.com-access_log" common 30#</VirtualHost> 31 32#<VirtualHost *:80> 33# ServerAdmin webmaster@dummy-host2.example.com 34# DocumentRoot "/Applications/XAMPP/xamppfiles/docs/dummy-host2.example.com" 35# ServerName dummy-host2.example.com 36# ErrorLog "logs/dummy-host2.example.com-error_log" 37# CustomLog "logs/dummy-host2.example.com-access_log" common 38#</VirtualHost> 39 40NameVirtualHost *:80 41 42<VirtualHost *:80> 43 DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs" 44 ServerName localhost 45</VirtualHost> 46 47<VirtualHost *:80> 48 DocumentRoot "/User/yoshiyuki/Dropbox/mexell/mexell/01_telepo/30_dev_main_site/06_telepo_server_omori/telepo-server" 49 ServerName telepo-server 50 <Directory "/User/yoshiyuki/Dropbox/mexell/mexell/01_telepo/30_dev_main_site/06_telepo_server_omori/telepo-server"> 51 AllowOverride All 52 Require all granted 53 </Directory> 54</VirtualHost> 55 56 57
その後、hostsファイルに「127.0.0.1 telepo-server」と追加して、telepo-serverにアクセスしようとしたのですが、
Access forbidden!
要求されたディレクトリへのアクセス権限がありません。 インデックスドキュメントが存在しないか、 ディレクトリの読み込みが許可されていません。
サーバーの障害と思われる場合は、ウェブ管理者までご連絡ください。
Error 403
telepo-server
Apache/2.4.12 (Unix) OpenSSL/1.0.1m PHP/5.6.8 mod_perl/2.0.8-dev Perl/v5.16.3
と表示されてしまい、バーチャルホストが導入できません。
httpd-vhosts.confの書き方に問題があると思うのですが、どのように修正したらよいでしょうか。
ご教授いただければ幸いです。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。