问题解决:Apache: You don't have permission to access / on this server
虚拟主机(Virtual Host)是指在一个机器上运行多个网络站点 (比如:www.company1.com和www.company2.com)。 如果每个网络站点拥有不同的IP地址,则虚拟主机可以是"基于IP"的; 如果只有一个IP地址,也可以是"基于主机名"的, 其实现对最终用户是透明的。具体细节可以查看Apache官方说明 。
一. “基于主机名”虚拟主机的配置
Listen 81
NameVirtualHost *:81
<VirtualHost *:81 >
ServerAdmin example@company.com
DocumentRoot yourRoot
<Directory "yourRoot ">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
配置说明:
81 : 为端口号,可以是其他现在系统未用的端口
yourRoot : linux下格式形如: /export/www 注意最后没有"/"
将上面的添加到apache的配置文件httpd.conf(linux下在/usr/local/apache2/conf/,视具体情况而定),然后重新启动Apache .
注意:
要配置基于主机名的虚拟主机,必须保留原有的80端口。
二. 查看配置是否成功
在浏览器中输入 http://localhost:81 查看是否配置成功。
三. 常见问题常见解决方案
当在浏览器中查看配置成功与否出现问题时,可优先到Apache官方网站的FAQ 上或用搜索引擎搜索你的问题。
我这里就最常见403问题:
Forbidden
You don't have permission to access / on this server.
提供几种常见的解决方法:
1.按上面的配置正确,特别是:
Order allow,deny
Allow from all
2. 确保youRoot文件夹下有index.html文件(或名为index而后缀为其他形式(如.jsp .php等)的文件) ,因为Apache默认以index.html为网站首页,如果没有这个文件就会出现上面的403错误。
注:如果你想以其他形式的文件(如:index.jsp或index.php等)作为出现的网页,可将Apache的配置文件中的:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
改为(如你想用index.jsp):
<IfModule dir_module>
DirectoryIndex index.html index.jsp
</IfModule>
如果需要浏览该文件夹下的内容,可以在</Directory>前添加:
Options Indexes
就可以了。
3. 针对linux用户,windows或其他用户一般没这种情况。linux系统中一般会自带apache,在修改了配置文件后,最好到安装Apache的目录下重启Apache。
http://blog.csdn.net/crazyboy2005/article/details/4768928
转载于:https://www.cnblogs.com/chen110xi/p/3719987.html
问题解决:Apache: You don't have permission to access / on this server相关推荐
- apache:You don't have permission to access on this server.
You don't have permission to access on this server. 查日志: No matching DirectoryIndex (index.html) fou ...
- Apache提示You don‘t have permission to access / on this server问题解决
Apache提示You don't have permission to access / on this server问题解决 参考文章: (1)Apache提示You don't have per ...
- 【Apache】You don't have permission to access / on this server.问题解决
目录 背景 正文 总结 背景 在服务器中输入localhost出现 Forbidden,You don't have permission to access / on this server. 在外 ...
- you don't have permission to access / on this server(Apache Server权限访问问题)
Apache Http Server已经在linux上安装完成,可是通过浏览器访问,却出现了"you don't have permission to access / on this se ...
- 输入http://localhost/,apache出现You don't have permission to access/on this server.的提示,如何解决?...
本地搭建wamp,输入http://127.0.0.1访问正常,当输入http://localhost/,apache出现You don't have permission to access/on ...
- [备忘][转载]apache 403错误 You don't have permission to access on this server
apache 403错误 You don't have permission to access on this server. 在配置好了Apache服务器后,测试已经通过了,但是通过浏览器访问lo ...
- (已解决)wamp + Apache报错:出现403Forbidden You don't have permission to access / on this server.
文章目录 `解决办法:` `*** `附件 · 延伸阅读 · 参考: 解决办法: 注意: 案例环境:win7 x64 或 win10 仅仅只需要修改apache配置文件httpd.conf 即可. 上 ...
- [乐意黎原创]访问Centos下Apache主机页面抛You don't have permission to access / on this server.
Forbidden You don't have permission to access / on this server. Server unable to read htaccess file, ...
- Linux Centos7 Apache 访问 You don't have permission to access / on this server.
折腾了很久,今天才找到了最正确的答案.感言真不容易. 百度出来的99%都是采集的内容,全都是错误的. You don't have permission to access / on this ser ...
最新文章
- 6月27日任务 配置Tomcat监听80端口、配置Tomcat虚拟主机、Tomcat日志
- java链式编程_Java 链式编程 和 lombok 实现链式编程
- 【知识库专访】亲加CTO郝飞:直播技术架构解密与优化之道
- web前端常用代码于面试等资源
- 【渝粤教育】广东开放大学 PHP动态网站设计 形成性考核 (48)
- 【MongoDB 工具篇】MongoDB Compass介绍与简单使用
- java 异步_聊聊java高并发系统之异步非阻塞
- 非递归分治法排序 MergeSort without recursion
- 中国互联网网站尴尬排行榜[转]
- 【BZOJ】2553: [BeiJing2011]禁忌 AC自动机+期望+矩阵快速幂
- 为什么现在的很多酒店都不收押金,只收房费了?
- plt.imshow显示CT/MRI图像
- think in uml 2.1
- Verilog初级教程(18)Verilog中的函数与任务
- 当HR压你价,说你只值7K,你该怎么回答?
- 美化windows xp 完全教程
- 卡耐基梅隆大学教授邢波:Petuum,大数据分布式机器学习平台
- brew install速度过慢
- 电子学会2022年9月青少年软件编程(图形化)等级考试试卷(三级)答案解析
- 2019 徐州 icpc 树状数组套线段树 H - Yuuki and a problem