码迷,mamicode.com
首页 > Web开发 > 详细

linux下apache启动问题(dummy-host.example.com does not exist, Could not..127.0.0.1 for ServerName)

时间:2016-06-15 00:11:50      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:dummy-host.example.com does not exist   linux下apache启动问题   httpd: could not reliably determine the server's fully qualified domain name   using 127.0.0.1 for servername   


一、Apache常见的启动错误及解决方法。

1.在配置虚拟主机时apache启动错误解决办法:

Warning: DocumentRoot [/application/apache2.2.27/docs/dummy-host.example.com] does not exist

其实出现这个错误的主要原因报错已近很明显了,是你的httpd-vhosts.conf中多了一个如下配置:

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error_log"
    CustomLog "logs/dummy-host.example.com-access_log" common

</VirtualHost>

在配置虚拟主机时,不能存在着这样的模板,解决方法:全部注释或删除。 

2.在编译安装Apache时出现如下错误:

httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.0.1 for ServerName

解决方法:打开httpd.conf找到#ServerName www.example.com:80后面加上如下代码:
ServerName  127.0.0.1:80ServerName  127.0.0.1:80


当然上面的操作都需检查语法后重启Apache服务:

/application/apche/bin/apachectl -t                  ---检查语法

/application/apache/bin/apachectl graceful    ---平滑重启


如果在配置虚拟主机完成后访问域名时出现403 -forbidden的原因可能是:

1)防火墙没有关闭

2)没有在httpd.conf中配置一个单独的站点目录如下:

<Directory "/application/apache2.2.27/htdocs">
    Options -Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

需详细Apache编译安装步骤点击:http://purify.blog.51cto.com/10572011/1772656

本文出自 “叫醒你的不是闹钟而是梦想” 博客,请务必保留此出处http://purify.blog.51cto.com/10572011/1789292

linux下apache启动问题(dummy-host.example.com does not exist, Could not..127.0.0.1 for ServerName)

标签:dummy-host.example.com does not exist   linux下apache启动问题   httpd: could not reliably determine the server's fully qualified domain name   using 127.0.0.1 for servername   

原文地址:http://purify.blog.51cto.com/10572011/1789292

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!