我在我的服务器上运行contos7,昨天我试图重启我的apache,但是失败了,从那以后就不能再重启了。每次我尝试start它都会显示下面的警告。
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details
我试着关注这篇文章https://stackoverflow.com/a/37131726/8778864,但是在我列出所有端口后,我想知道下一步要做什么,请我是linux / server的新手,有人能帮我吗?
netstat -punta | grep LISTEN
运行上述命令时的输出
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 394/dovecot
tcp 0 0 0.0.0.0:2082 0.0.0.0:* LISTEN 426/cwpsrv: master
tcp 0 0 0.0.0.0:2083 0.0.0.0:* LISTEN 426/cwpsrv: master
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 394/dovecot
tcp 0 0 0.0.0.0:7777 0.0.0.0:* LISTEN 376/sshd
tcp 0 0 0.0.0.0:2086 0.0.0.0:* LISTEN 426/cwpsrv: master
tcp 0 0 0.0.0.0:2087 0.0.0.0:* LISTEN 426/cwpsrv: master
tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN 552/master
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 552/master
tcp 0 0 0.0.0.0:2030 0.0.0.0:* LISTEN 426/cwpsrv: master
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 394/dovecot
tcp 0 0 0.0.0.0:2095 0.0.0.0:* LISTEN 426/cwpsrv: master
tcp 0 0 0.0.0.0:2031 0.0.0.0:* LISTEN 426/cwpsrv: master
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 394/dovecot
tcp 0 0 0.0.0.0:2096 0.0.0.0:* LISTEN 426/cwpsrv: master
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 552/master
tcp 0 0 132.17.288.75:53 0.0.0.0:* LISTEN 411/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 411/named
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 397/pure-ftpd (SERV
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 552/master
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 411/named
tcp 0 0 127.0.0.1:2302 0.0.0.0:* LISTEN 426/cwpsrv: master
tcp 0 0 0.0.0.0:4190 0.0.0.0:* LISTEN 394/dovecot
tcp6 0 0 :::7777 :::* LISTEN 376/sshd
tcp6 0 0 :::3306 :::* LISTEN 434/mysqld
tcp6 0 0 :::587 :::* LISTEN 552/master
tcp6 0 0 :::465 :::* LISTEN 552/master
tcp6 0 0 ::1:53 :::* LISTEN 411/named
tcp6 0 0 :::21 :::* LISTEN 397/pure-ftpd (SERV
tcp6 0 0 :::25 :::* LISTEN 552/master
tcp6 0 0 ::1:953 :::* LISTEN 411/named根@主机admin101#系统root状态httpd.service
● httpd.service - Web server Apache
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2019-01-02 05:38:34 UTC; 2h 38min ago
Process: 15750 ExecStart=/usr/local/apache/bin/apachectl start (code=exited, status=1/FAILURE)
Dec 31 11:11:12 host.example.com systemd[1]: Failed to start Web server Apache.
Dec 31 11:11:12 host.example.com systemd[1]: Unit httpd.service entered failed state.
Dec 31 11:11:12 host.example.com systemd[1]: httpd.service failed.
Dec 31 11:19:37 host.example.com systemd[1]: Starting Web server Apache...
Dec 31 11:19:37 host.example.com apachectl[26747]: AH00526: Syntax error on line 15 of /usr/local/apache/conf.d/vhosts-ssl.conf:
Dec 31 11:19:37 host.example.com apachectl[26747]: SSLCertificateFile: file '/etc/pki/tls/certs/website1.com.cert' does not exist or is empty
Dec 31 11:19:37 host.example.com systemd[1]: httpd.service: control process exited, code=exited status=1
Dec 31 11:19:37 host.example.com systemd[1]: Failed to start Web server Apache.
Dec 31 11:19:37 host.example.com systemd[1]: Unit httpd.service entered failed state.
Dec 31 11:19:37 host.example.com systemd[1]: httpd.service failed.
[root@host admin101]#发布于 2019-08-23 17:00:10
很可能存在主机名与证书解析问题。
请参阅以下内容:https://forum.centos-webpanel.com/centos-7-problems/cwpsrv-service-failed-emerg/
确保以下文件中列出的证书正确: /usr/local/cwpsrv/conf/cwpsrv.conf/cwpsrv.conf
} ssl_certificate /etc/pki/tls/certs/hostname.cert;
} ssl_certificate_key /etc/pki/tls/private/hostname.key;然后: 1)从cwp再次保存您的主机名,它将生成一个新的证书和密钥
如果不能像我一样访问CWP ...通过CLI访问服务器并键入以下命令
脚本sh /
/生成主机名ssl
或者如果上面的方法不起作用;
sh /usr/local/cwpsrv/htdocs/resources/scripts/generate_hostname_ssl
发布于 2019-02-06 21:20:49
Dec 31 11:19:37 host.example.com apachectl26747: SSLCertificateFile:文件'/etc/pki/tls/certs/website1.com.cert‘不存在或为空
看起来您正在尝试安装SSL,但配置错误。先用你的SSL结账,然后重建vhosts。这将解决您的问题,并让您再次启动apache。
发布于 2020-03-18 20:25:36
如果你使用"AutoSSL“删除所有从它构建的证书(全部让我们加密),然后重启Apache服务。
https://stackoverflow.com/questions/54002031
复制相似问题