【问题标题】:WAMP 3.06, is Directory into Virtual Hosts broken?WAMP 3.06,虚拟主机目录是否损坏?
【发布时间】:2017-04-10 23:49:35
【问题描述】:

我正在使用 WAMP 3.06。我有一个托管在“c:/wamp64/www/webagenda”中的网站

当我尝试使用“http://cloudappoint.myvnc.com”远程访问该站点时,我得到:

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

我的虚拟主机文件是:

# 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>

从我的 cmets 可以看出,如果我取消注释下一行,问题就结束了:

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

请问这里有什么问题?

【问题讨论】:

    标签: windows apache wamp virtualhost


    【解决方案1】:

    如果将&lt;Directory&gt; 块移出&lt;VirtualHost&gt; 块会导致允许访问,那么可以合理地假设&lt;VirtualHost&gt; 定义有问题。

    我可以建议你在你的定义中尝试这个改变

    <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>
    

    编辑

    我假设您在尝试访问该站点时将非标准端口号添加到 url?

    http://cloudappoint.myvnc.com:8000
    

    当我添加 :8000 时,我没有收到错误消息,我得到一个离线页面,说

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

    【讨论】:

    • 可能您忘记在 URL :8000 中添加端口号
    猜你喜欢
    • 1970-01-01
    • 2011-09-30
    • 2017-03-08
    • 2013-03-15
    • 2014-07-15
    • 2014-09-20
    • 2019-06-04
    • 2011-03-08
    • 2012-04-06
    相关资源
    最近更新 更多