Linux(Centos)Apache安装配置过程中可能出现的错误
2015-11-02 17:19
836 查看
httpd:unrecognized service
//将apache安装为系统服务 cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd //然后 vi /etc/rc.d/init.d/httpd 添加(#!/bin/sh下面) chkconfig: 2345 50 90 description: Activates/Deactivates Apache Web Server //最后,运行chkconfig把Apache添加到系统的启动服务组里面: chkconfig --add httpd chkconfig httpd on //然后再service httpd start
httpd: Could not reliably determine the server’s fully qualified domain name
//用记事本打开 httpd.conf //将里面的 #ServerName localhost:80 注释去掉即可。 //再执行 httpd //然后可以通过浏览器访问 http://localhost:80 ,如果页面显示 “It works!” ,即表示apache已安装并启动成功。
You don’t have permission to access / on this server
原来是因为我的虚拟主机目录为非apache安装目录下的htdocs,所以违反了apache对默认对网站根访问权限。apache的默认虚拟主机根目录地址为../Apache Software Foundation/Apache2.2/htdocs 目录下,需要对httpd.conf文件进行修改才能指向其他目录。
在
httpd.conf文件下找到这段:
<span style="font-size: x-small;"># # Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories). # # First, we configure the "default" to be a very restrictive set of # features. # <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory></span>
将之修改为
<span style="font-size: x-small;"># 允许指向外部的目录进行访问 <Directory /> Options Indexes FollowSymLinks AllowOverride None </Directory></span>
重启httpd。
相关文章推荐
- Linux socket 初步
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Centos6 编译安装Python
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户
- Scientific Linux 5.5 图形安装教程