apache - 不同端口上的 Apache 虚拟主机不起作用
问题描述
我正在尝试在我的本地主机上提供不同的文件夹。我正在使用 Windows 操作系统。
我想E:/Programming/Projects
在,localhost:8080
和E:/htdocs
localhost:80
我的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>
推荐阅读
- sql - 将行分组到范围内,同时也显示间隙
- javascript - 将 express 控制器拆分为多个文件
- np - SAT 是 NP 完备的,那么为什么我们没有 k-SAT 对于任意 k 值是 NP 完备的
- oop - 为什么我的表返回 NIL 并且没有填充?
- javascript - 如何将 chessboard.js 节点模块导入 Angular 项目?
- python - 映射/连接到发布 Django 网站时的错误请求问题
- sql - IBM Db2 on Cloud 中使用的 SQL 方言是什么
- visual-studio-code - 在 Visual Studio Code 中的模板字符串之间添加用户创建的片段
- forth - 在 Forth 中执行一个字符或字符串,就好像它是一个单词一样
- python - python中的回溯是什么?