Apache服务器的启动以及 403 forbidden 问题的解决
来源:互联网 发布:高德软件股票行情 编辑:程序博客网 时间:2024/04/30 09:34
1:判断本地计算机的Apache服务器是否启动
在浏览器地址栏中输入:localhost
通过是否有返回结果,即可判断本地的Apache是否正常工作
2:启动 sudoapachectl-k start,启动成功如下图所示;
重新启动 sudo apachectl-k restart
3:修改apache的默认文档目录
首先,定位到文档中:cd /etc/apache2/,sudo vimhttpd.conf,/DocumentRoot,
接下来需要修改DocumentRoot和Directory
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
#DocumentRoot "/Library/WebServer/Documents"
DocumentRoot "/Users/aaron/sites"
#<Directory "/Library/WebServer/Documents">
<Directory "/User/aaron/sites">
修改完成后,在site目录下添加html文件,如果没问题的话,在浏览器输入localhost或者127.0.0.1就能显示自己添加的html文件了。4:解决apache 403 forbidden 问题的解决
a)(旧版本403问题)的修改:
打开 apache的配置文件httpd.conf,找到这段代码:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
有时候由于配置了php后,这里的“Deny from all”已经拒绝了一切连接。把该行改成“allow from all”,修改后的代码如下,问题解决。
b)(新版本403问题)的修改,新版本有所不同,<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
打开 apache的配置文件httpd.conf,找到这段代码:
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
AllowOverride none
Require all denied
</Directory>
将其中的Require all denied修改为Require all granted就行了
<Directory />
AllowOverride none
Require all granted
</Directory>
成功后如下图所示
- Apache服务器的启动以及 403 forbidden 问题的解决
- apache httpd服务器403 forbidden的问题
- 解决php服务器(apache)下403 Forbidden错误的方法
- nginx img 403 forbidden问题的解决
- 解决Nginx服务器中403 forbidden的错误
- apache中虚拟目录总是403 Forbidden的问题
- apache服务出现Forbidden 403问题的解决方法总结
- 关于Apache服务器不能访问,无权限,forbidden的各种问题
- apache 403 forbidden怎么解决
- 解决bugzilla安装后出现的403Forbidden问题。
- 解决Apache/PHP无法启动的问题
- 解决无法启动Apache的问题
- 解决Apache/PHP无法启动的问题
- 解决Apache/PHP无法启动的问题
- 解决Apache/PHP无法启动的问题
- 解决Apache/PHP无法启动的问题
- apache无法启动问题的解决
- 解决windows启动Apache失败的问题
- ecache页面缓存问题及处理
- QML 自定义Slider
- 51单片机的data、idata、pdata、xdata的区别
- 深入解读Tomcat(三)
- C#操作sql通用类 SQLHelper
- Apache服务器的启动以及 403 forbidden 问题的解决
- java 容器深入研究之使用Abstract类定制
- 查找maven中的groupId,artifactId,version等信息的方式
- Servlet 3.0 新特性详解(五)ServletContext 的性能增强及HttpServletRequest 对文件上传的支持
- 04 多线程
- 博客园学习网站
- cocos2dx 点击事件分析(1)
- C语言中函数的思考(可以返回局部变量吗)
- 郝斌数据结构教学视频下载地址