XAMPP中apache配置本地多根目录多端口
2017-08-11 11:46
288 查看
1.配置httpd.conf
1)、添加监听端口
在 Listen 80 后增加
Listen 8081
Listen 8082
Listen 8083 等
2)、开启虚拟站点
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
改为
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
(就是去掉注释符号#)
2.配置httpd-vhosts.conf
底部添加如下配置代码,路径根据自己项目路径填写
<VirtualHost *:8081>
DocumentRoot "E:/work/web/ftp/pc_web"
ServerName localhost:8081
ServerAlias 127.0.0.1:8081
<Directory "E:/work/web/ftp/pc_web">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
但是以“localhost:8081”访问的时候,却发现出现了“Access forbidden!”的403错误,显示没有访问权限。具体的错误信息如下:
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
权限<Directory>权限配置的问题,在httpd.conf
XAMPP默认的设置是这样的:
#<Directory />
AllowOverride none
Require all denied
</Directory>
修改成下面的就可以了!
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
顺利添加完成。
1)、添加监听端口
在 Listen 80 后增加
Listen 8081
Listen 8082
Listen 8083 等
2)、开启虚拟站点
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
改为
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
(就是去掉注释符号#)
2.配置httpd-vhosts.conf
底部添加如下配置代码,路径根据自己项目路径填写
<VirtualHost *:8081>
DocumentRoot "E:/work/web/ftp/pc_web"
ServerName localhost:8081
ServerAlias 127.0.0.1:8081
<Directory "E:/work/web/ftp/pc_web">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
但是以“localhost:8081”访问的时候,却发现出现了“Access forbidden!”的403错误,显示没有访问权限。具体的错误信息如下:
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
权限<Directory>权限配置的问题,在httpd.conf
XAMPP默认的设置是这样的:
#<Directory />
AllowOverride none
Require all denied
</Directory>
修改成下面的就可以了!
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
顺利添加完成。
相关文章推荐
- Apache配置多个监听端口和不同的网站目录的简单方法
- xampp3.2.2配置多个监听端口和不同的网站目录
- apache虚拟目录和多端口多主机名配置
- 配置本地环境之配置Apache虚拟目录的步骤
- Apache配置多个监听端口和不同的网站目录的简单方法(转)
- php学习笔记1 apache服务器使用及配置① 启动和停止 端口配置 apache的目录结构
- Apache配置多个监听端口和不同的网站目录的简单方法
- xampp3.2 apache 配置多端口 多域名
- Apache虚拟目录和多端口多主机名配置
- XAMPP Apache 配置多端口和多域名方法
- XAMPP集成环境下apache配置多端口多站点访问
- 黄聪:windows下使用xampp3.2.2配置多个监听端口和不同的网站目录
- Apache配置多个监听端口和不同的网站目录的简单方法
- XAMPP配置不同目录不同端口
- Apache配置多个监听端口和不同的网站目录的简单方法
- Apache通过配置端口访问不同目录
- XAMPP Apache 配置多端口和多域名方法
- XAMPP Apache 配置多端口和多域名方法
- 详解Apache配置多个监听端口和不同的网站目录
- XAMPP Apache 配置多端口和多域名方法