更新 httpd.conf 后服务器关闭

Sep*_*gus 0 httpd apache-2.2

这是紧急情况。

我只想做一件愚蠢而简单的事情。我不想有 dom 日志。就是这样。

所以我编辑 vconf.local 并重建 httpd.conf。

出现一些错误,例如一个域存在所有权冲突。所以呢?我只是继续并重新启动apache

root@host [/var/cpanel/templates/apache2]# vi vhost.local
root@host [/var/cpanel/templates/apache2]# /usr/local/cpanel/bin/apache_conf_distiller --update
info [apache_conf_distiller] 'local' datastore in use (/var/cpanel/conf/apache/local)
info [apache_conf_distiller] Missing IP for domain host.buildingsuperteams.com, using 67.159.44.4
info [apache_conf_distiller] Missing port for domain host.buildingsuperteams.com, using 80
info [apache_conf_distiller] Missing user for domain host.buildingsuperteams.com, using nobody
info [apache_conf_distiller] Missing group for domain host.buildingsuperteams.com, using nobody
info [apache_conf_distiller] Missing ServerName for domain host.buildingsuperteams.com, using host.buildingsuperteams.com
info [apache_conf_distiller] Domain ownership conflict detected for buildingsuperteams.com, users nobody, building
Distilled successfully
root@host [/var/cpanel/templates/apache2]# /usr/local/cpanel/bin/build_apache_conf
info [build_apache_conf] 'local' datastore in use (/var/cpanel/conf/apache/local)
info [build_apache_conf] Missing IP for domain host.buildingsuperteams.com, using 67.159.44.4
info [build_apache_conf] Missing port for domain host.buildingsuperteams.com, using 80
info [build_apache_conf] Missing user for domain host.buildingsuperteams.com, using nobody
info [build_apache_conf] Missing group for domain host.buildingsuperteams.com, using nobody
info [build_apache_conf] Missing ServerName for domain host.buildingsuperteams.com, using host.buildingsuperteams.com
info [build_apache_conf] Domain ownership conflict detected for buildingsuperteams.com, users nobody, building
Built /usr/local/apache/conf/httpd.conf OK
root@host [/var/cpanel/templates/apache2]# /etc/init.d/httpd -k graceful
root@host [/var/cpanel/templates/apache2]# service httpd status

Looking up localhost
Making HTTP connection to localhost
Sending HTTP request.
HTTP request sent; waiting for response.
Retrying as HTTP0 request.
Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost/whm-server-status
root@host [/var/cpanel/templates/apache2]#
Run Code Online (Sandbox Code Playgroud)

如果我输入 service httpd restart 它只是退出而不透露任何错误消息

我检查 cpanel 错误日志没有结果

所有权冲突的发生很可能是因为主域是 buildingsuperteams.com 而我创建了另一个用户来处理 buildingsuperteams.com 这样我就可以更改人们访问我的 IP 时显示的内容

注意:虽然服务器在执行 service httpd start 后工作的评论是正确的,但输出强烈表明 httpd 服务器一直在线 15 分钟。就好像我真正需要做的只是等待。会有一些后续问题。

lynx: Can't access startfile http://localhost/whm-server-status
root@host [/var/cpanel/templates/apache2]# service httpd start
httpd (pid 2516) already running
root@host [/var/cpanel/templates/apache2]# service httpd status
                       Apache Server Status for localhost

   Server Version: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/1.0.0-fips
          mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635

   Server Built: Dec 20 2012 10:45:38
     __________________________________________________________________

   Current Time: Monday, 31-Dec-2012 22:08:15 CST
   Restart Time: Monday, 31-Dec-2012 21:52:58 CST
   Parent Server Generation: 3
   Server uptime: 15 minutes 16 seconds
Run Code Online (Sandbox Code Playgroud)

Gru*_*mpy 6

service httpd start
Run Code Online (Sandbox Code Playgroud)

看起来您实际上并未启动 apache。

可能是/etc/init.d/httpd -k graceful命令重启失败了。因此,没有运行 httpd 服务。或者优雅的人由于停滞过程而花费了很长时间。

cpanel 附带各种服务,这些服务不断检查基本(由 cpanel 定义)服务是否已关闭,并尝试“自动”重新启动该服务。但是,在进行这些检查之间存在延迟。因此,启动过程不是立即的。

当您第一次启动机器时,检查它们的运行时的不是 cpanel 的检查器,而是包含基本服务的操作系统的启动顺序。

为了将来参考,重新启动(非优雅)的命令是

service httpd restart
Run Code Online (Sandbox Code Playgroud)

此外,您可以在以下位置查看 error_log /usr/local/apache/logs/error_log