External access web page with VirtualHosts and Wampserver

…衆ロ難τιáo~ 提交于 2019-12-12 02:17:42

问题


I am a newbie in wampserver.

I installed it and I can acesss web pages with localhost port 8000 without problems. Yes, I changed default port to 8000 and all works well with localhost.

Now, I created a simple project web page and I need external access. Here is my settings: But I get the next error when I try to acesss remotely:

Forbidden

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

My sample project:

Folders:
c:\wamp64\www
...........cloudappoint.myvnc.com(subfolder in www)

File in cloudappoint.myvnc.com folder:  index.php

NOIP DNS:

- Host:cloudappoint.myvnc.com       
- Target IP:XXX.XXX.XXX:8000(My host is located at amazon ec2 with elastic ip- XXXX.XXX.XXX)
- type:URL

WampServer VirtualHosts:

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

EDITED: Here is my complete Virtual hosts file:

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


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

I am unable to acesss remotely cloudappoint.myvnc.com, but if I move

<Directory "c:/wamp64/www/webagenda/">
            Options +Indexes +FollowSymLinks +MultiViews 
            DirectoryIndex index.php
            AllowOverride All
            Require all granted
 </Directory>

out from VirtualHost, all works well. Then, I guess 3.06 has broken Directory into Virtual Hosts.

来源:https://stackoverflow.com/questions/40809747/external-access-web-page-with-virtualhosts-and-wampserver

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