更新 httpd.conf 后服务器关闭

更新 httpd.conf 后服务器关闭

这是紧急情况。

我只想做一件愚蠢而简单的事情。我不想有 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]#

如果我输入 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

答案1

service httpd start

看起来你实际上并没有启动 apache。

重启命令可能/etc/init.d/httpd -k graceful失败。因此,没有 httpd 服务正在运行。或者由于进程停滞,优雅过程需要较长时间。

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

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

供将来参考,重新启动(非平稳)的命令是

service httpd restart

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

相关内容