[英]Apache failed to start on centos7 on cwp
我在我的服務器上運行 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
[root@host admin101]# systemctl status 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]#
很可能存在主機名與證書解析問題。
請參閱以下內容: 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 /scripts/generate_hostname_ssl
或者,如果上述方法不起作用;
sh /usr/local/cwpsrv/htdocs/resources/scripts/generate_hostname_ssl
12 月 31 日 11:19:37 host.example.com apachectl[26747]:SSLCertificateFile:文件“/etc/pki/tls/certs/website1.com.cert”不存在或為空
看起來您正在嘗試安裝 SSL 但配置錯誤。 首先使用您的 SSL 簽出,然后重建虛擬主機。 這將解決您的問題,並讓您再次啟動 apache。
如果您使用“AutoSSL”刪除從中構建的所有證書(All Let's Encrypt),然后重新啟動 Apache 服務。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.