一、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时出现如下提示:FQDN:

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