apache配置问题

问答中心分类: OneinStackapache配置问题
年如风 asked 7 年 ago
系统:centos7.4、php7.2、数据库不在本地,apache2.2/2.4均报错
如果忽略,每次重启apache都要执行两次重启命令,第一次执行完毕,无法访问网站,
 
服务器拒绝了您的浏览请求. 
请确认您拥有所需的访问权限.
错误码 102 (net::ERR_CONNECTION_REFUSED)(不能插图,抱歉,次三行为第一次执行完浏览器显示信息)
 
 
第二次执行完毕,正常访问。
apachectl configtest命令下:
[Thu Jun 14 02:32:55 2018] [error] (EAI 2)Name or service not known: Could not resolve host name *: -- ignoring!
[Thu Jun 14 02:32:55 2018] [error] (EAI 2)Name or service not known: Could not resolve host name *: -- ignoring!
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Syntax OK
错误日志:
[Thu Jun 14 01:05:45 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Thu Jun 14 01:05:45 2018] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 14 01:05:45 2018] [notice] Digest: done
[Thu Jun 14 01:05:46 2018] [notice] Apache/2.2.34 (Unix) DAV/2 configured -- resuming normal operations
[Thu Jun 14 01:13:05 2018] [notice] SIGHUP received. Attempting to restart
[Thu Jun 14 01:13:05 2018] [error] (EAI 2)Name or service not known: Could not resolve host name *: -- ignoring!
[Thu Jun 14 01:13:05 2018] [error] (EAI 2)Name or service not known: Could not resolve host name *: -- ignoring!
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Thu Jun 14 01:13:05 2018] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 14 01:13:05 2018] [notice] Digest: done
[Thu Jun 14 01:13:06 2018] [notice] Apache/2.2.34 (Unix) DAV/2 configured -- resuming normal operations
[Thu Jun 14 01:22:06 2018] [notice] caught SIGTERM, shutting down
[Thu Jun 14 01:22:29 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Thu Jun 14 01:22:29 2018] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 14 01:22:29 2018] [notice] Digest: done
[Thu Jun 14 01:22:30 2018] [notice] Apache/2.2.34 (Unix) DAV/2 configured -- resuming normal operations
[Thu Jun 14 01:30:28 2018] [error] [client 180.102.226.106] File does not exist: /data/wwwroot/default/favicon.ico
[Thu Jun 14 01:30:40 2018] [notice] caught SIGTERM, shutting down
[Thu Jun 14 01:30:50 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Thu Jun 14 01:30:50 2018] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 14 01:30:50 2018] [notice] Digest: done
[Thu Jun 14 01:30:51 2018] [notice] Apache/2.2.34 (Unix) DAV/2 configured -- resuming normal operations
[Thu Jun 14 01:31:11 2018] [notice] caught SIGTERM, shutting down
[Thu Jun 14 01:36:49 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Thu Jun 14 01:36:49 2018] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 14 01:36:49 2018] [notice] Digest: done
[Thu Jun 14 01:36:50 2018] [notice] Apache/2.2.34 (Unix) DAV/2 configured -- resuming normal operations
[Thu Jun 14 01:36:50 2018] [error] [client 180.102.226.106] File does not exist: /data/wwwroot/default/favicon.ico
[Thu Jun 14 01:45:33 2018] [error] [client 123.125.71.117] File does not exist: /data/wwwroot/default/robots.txt
[Thu Jun 14 01:48:44 2018] [error] [client 207.46.13.201] File does not exist: /data/wwwroot/default/robots.txt
[Thu Jun 14 01:51:02 2018] [error] [client 207.46.13.95] File does not exist: /data/wwwroot/default/robots.txt

[Thu Jun 14 02:03:53 2018] [notice] caught SIGTERM, shutting down
[Thu Jun 14 02:03:55 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Thu Jun 14 02:03:55 2018] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 14 02:03:55 2018] [notice] Digest: done
[Thu Jun 14 02:03:56 2018] [notice] Apache/2.2.34 (Unix) DAV/2 configured -- resuming normal operations

[Thu Jun 14 02:08:48 2018] [notice] caught SIGTERM, shutting down
[Thu Jun 14 02:09:02 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Thu Jun 14 02:09:02 2018] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 14 02:09:02 2018] [notice] Digest: done
[Thu Jun 14 02:09:03 2018] [notice] Apache/2.2.34 (Unix) DAV/2 configured -- resuming normal operations
[Thu Jun 14 02:20:00 2018] [notice] caught SIGTERM, shutting down
[Thu Jun 14 02:21:15 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Thu Jun 14 02:21:15 2018] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 14 02:21:15 2018] [notice] Digest: done
[Thu Jun 14 02:21:16 2018] [notice] Apache/2.2.34 (Unix) DAV/2 configured -- resuming normal operations
[Thu Jun 14 02:25:13 2018] [notice] caught SIGTERM, shutting down
[Thu Jun 14 02:25:56 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Thu Jun 14 02:25:56 2018] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 14 02:25:56 2018] [notice] Digest: done
[Thu Jun 14 02:25:57 2018] [notice] Apache/2.2.34 (Unix) DAV/2 configured -- resuming normal operations
[Thu Jun 14 02:32:51 2018] [notice] caught SIGTERM, shutting down
[Thu Jun 14 02:33:54 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Thu Jun 14 02:33:54 2018] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 14 02:33:54 2018] [notice] Digest: done
[Thu Jun 14 02:33:55 2018] [notice] Apache/2.2.34 (Unix) DAV/2 configured -- resuming normal operations
[Thu Jun 14 02:50:28 2018] [notice] caught SIGTERM, shutting down
[Thu Jun 14 02:52:19 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Thu Jun 14 02:52:19 2018] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 14 02:52:19 2018] [notice] Digest: done
[Thu Jun 14 02:52:20 2018] [notice] Apache/2.2.34 (Unix) DAV/2 configured -- resuming normal operations

4 Answers
oneinstack answered 7 年 ago
Name or service not known: Could not resolve host name 这个提示,尝试将devsrv对应的ip加到文件名/etc/hosts中试试
第一次重启应该是httpd没有启动,第二次启动才正常把httpd进程拉起来!

oneinstack answered 7 年 ago
方便左下角私信IP root密码,还有描述下具体问题现象?

oneinstack answered 7 年 ago
已经修复!

年如风 answered 7 年 ago
谢谢你,辛苦了