繁体   English   中英

Apache 不同端口上的虚拟主机不工作

[英]Apache virtual host on different ports doesn't work

我正在尝试在我的本地主机上提供不同的文件夹。 我正在使用 Windows 操作系统。

我想在localhost:8080上提供E:/Programming/Projects ,在localhost:80上提供E:/htdocs

我的httpd-vhosts.conf文件是这样的:

Listen 8080
<VirtualHost *:8080>
    ServerName localhost
    DocumentRoot "E:/Programming/Projects"
    <Directory "E:/Programming/Projects">
        AllowOverride All
    </Directory>

</VirtualHost>

当我尝试导航 localhost:80 时,此端口运行良好。 但是 localhost:8080 给出了这个错误:

403 - Forbidden
You don't have permission to access this resource.

我已经重置了我的服务器,但它不起作用。

正确答案是:

Listen 8080

<VirtualHost *:8080>
    ServerName localhost:8080
    DocumentRoot "E:/Programming/Projects/"
    <Directory "E:/Programming/Projects/">
        Options +Indexes +FollowSymLinks +MultiViews
        require all granted
    </Directory>
</VirtualHost>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM