WAMP 3.06, is Directory into Virtual Hosts broken?

别说谁变了你拦得住时间么 提交于 2019-12-25 04:09:19

问题


I am using WAMP 3.06. I have a web site hosted in "c:/wamp64/www/webagenda"

When I try to access the site remotely using "http://cloudappoint.myvnc.com", I get:

Forbidden

You don't have permission to access /webagenda on this server.
Apache/2.4.23 (Win64) PHP/5.6.25 Server at agenda.myvnc.com Port 8000

My virtual host file is:

# Virtual Hosts

<VirtualHost *:8000>
    ServerName localhost
    DocumentRoot c:/wamp64/www
    <Directory  "c:/wamp64/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>


#if I uncomment the next lines the problem is over
#<Directory "c:/wamp64/www/webagenda">
#Options Indexes FollowSymLinks Includes ExecCGI
#DirectoryIndex index.php
#AllowOverride None
#Require all granted
#</Directory>


<VirtualHost *:8000>
    ServerName cloudappoint
    ServerAlias cloudappoint.myvnc.com
    DocumentRoot c:/wamp64/www/webagenda
    ErrorLog "logs/agenda-error.log"
    CustomLog "logs/agenda-access.log" common
    <Directory "c:/wamp64/www/webagenda/">
        Options +Indexes +FollowSymLinks +MultiViews 
        DirectoryIndex index.php
        AllowOverride All
        Require all granted
   </Directory>
</VirtualHost>

As you can see from my comments, if I I uncomment the next lines the problem is over:

<Directory "c:/wamp64/www/webagenda">
Options Indexes FollowSymLinks Includes ExecCGI
DirectoryIndex index.php
AllowOverride None
Require all granted
</Directory>

What is wrong here, please?


回答1:


If moving the <Directory> block out of the <VirtualHost> block causes access to be allowed then it is a fair assumption that there is something wrong with the <VirtualHost> definition.

Can I suggest that you try this change in your definition

<VirtualHost *:8000>

    ServerName cloudappoint.myvnc.com           <--change
    ServerAlias www.cloudappoint.myvnc.com      <--change

    DocumentRoot c:/wamp64/www/webagenda
    ErrorLog "logs/agenda-error.log"
    CustomLog "logs/agenda-access.log" common
    <Directory "c:/wamp64/www/webagenda/">
        Options +Indexes +FollowSymLinks +MultiViews 
        DirectoryIndex index.php
        AllowOverride All
        Require all granted
   </Directory>
</VirtualHost>

EDIT

I assume you are adding the non standard port number to the url when trying to access the site?

http://cloudappoint.myvnc.com:8000

When I add the :8000 I do not get the error I get an offline page saying

The site you have requested is currently unavailable, 
please try back again later.


来源:https://stackoverflow.com/questions/40824268/wamp-3-06-is-directory-into-virtual-hosts-broken

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!