apache虚拟目录及问题解决
来源:互联网 发布:生成工作证明软件 编辑:程序博客网 时间:2024/05/05 14:36
我的apache版本是2.4,安装路径是D:/php/Apache24/
按照网上教程实现在其他路径下的文件夹下的网页html,php,当做网站管理
修改D:\php\Apache24\conf下的httpd.conf
1.添加虚拟目录的节点
#配置虚拟目录
<IfModule dir_module>
#direcotory 相当于是欢迎页面
DirectoryIndex index.html index.htm index.php
#你的站点别名
Alias /wamp "E:/wamp"
<Directory E:/wamp>
#这是访问权限设置
Order allow,deny
Allow from all
</Directory>
</IfModule>
2. 注销 documentroot 路径
#DocumentRoot "D:/php/Apache24/htdocs"
3. 测试
http://localhost/
http://localhost/new.html
--------------------------
结果怎是报错
Forbidden
You don't have permission to access / on this server.
网上查找资料,解决办法很多种:
1.
index.html是用root用户建的文件,apache权限不够。
解决方法:更改文件权限;chmod 755 index.html
2.
打开apache配置文件httpd.conf,找到这么一段:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
deny from all
Satisfy all
</Directory>
然后试着把deny from all中的deny改成了allow,保存后重起了apache
3.
是Apache 的配置文件httpd-vhosts.conf里,打开了扩展配置
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
前面的#去掉了,就 引入了扩展配置,而扩展配置 文件里又没配好相应 的权限“Allow from all”,所以提示此错误
------------------
我试验了网上这几种办法发现还是不行,查看原因
2.4版本的apache在注销 documentroot 路径
#DocumentRoot "D:/php/Apache24/htdocs"
的同时还需要修改
#<Directory "D:/php/Apache24/htdocs">
<Directory "E:/wamp">
重启apache服务器,测试
http://localhost/wamp/
http://localhost/wamp/new.html
- apache虚拟目录及问题解决
- apache配置虚拟主机及虚拟目录
- apache 虚拟目录配置及详解
- apache配置虚拟主机及虚拟目录
- apache配置虚拟主机及虚拟目录
- apache配置虚拟主机及虚拟目录
- Ubuntu升级后apache虚拟目录设置全部失效问题解决
- apache 虚拟目录
- 28讲 apache服务器使用及配置③ apache虚拟目录
- apache服务器使用及配置③ apache虚拟目录
- apache服务器使用及配置③ apache虚拟目录
- apache 启用虚拟目录的设置方法,及配置合集
- 关于apache配置多个虚拟目录操作及…
- Apache 根目录修改及虚拟目录、虚拟主机的配置
- apache配置虚拟目录
- apache中设置虚拟目录
- APACHE网站虚拟目录设置
- 指定Apache的虚拟目录
- this 关键字的用法
- web js
- 6款漂亮HTML CSS样式用户留言表单
- 关于android shape 的使用
- qt模仿QQ截图另一种方式
- apache虚拟目录及问题解决
- C/C++之 交换字符串中相邻两个字节
- 使用CocoaPods时提示安装高版本ruby遇到的坑。
- WireShark帧格式解析
- 数据挖掘
- MATLAB可以不启动图形界面运行
- TOMCAT输出控制台信息
- 一种动态为apk写入信息的方案
- 读书笔记之安卓线程