WAMP 3.06,是虚拟主机的目录坏了吗?

时间:2016-11-26 23:34:53

标签: windows apache wamp virtualhost

我正在使用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>

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

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

这里有什么问题?

1 个答案:

答案 0 :(得分:-1)

如果将<Directory>块移出<VirtualHost>块导致允许访问,则可以公平地假设<VirtualHost>定义有问题。

我是否可以建议您在定义中尝试此更改

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

修改

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

http://cloudappoint.myvnc.com:8000

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

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