我无法在 centos7 中启动我的 apache 服务。这是我的 journalctl -e 结果。
enter code here
[root@qlntrk pam.d]# journalctl -xe
Feb 06 07:28:05 qlntrk.com sshd[2391]: Failed password for root from 58.242.83.11 port 47194 ssh2
Feb 06 07:28:06 qlntrk.com sshd[2391]: Failed password for root from 58.242.83.11 port 47194 ssh2
Feb 06 07:28:07 qlntrk.com sshd[2391]: Failed password for root from 58.242.83.11 port 47194 ssh2
Feb 06 07:28:07 qlntrk.com sshd[2391]: Failed password for root from 58.242.83.11 port 47194 ssh2
Feb 06 07:28:08 qlntrk.com sshd[2391]: Failed password for root from 58.242.83.11 port 47194 ssh2
Feb 06 07:28:09 qlntrk.com sshd[2391]: Failed password for root from 58.242.83.11 port 47194 ssh2
Feb 06 07:28:09 qlntrk.com sshd[2391]: error: maximum authentication attempts exceeded for root from 58.242.83.11 port 47194 ssh2 [preauth]
-- Unit httpd.service has begun starting up.
Feb 06 07:28:24 qlntrk.com sshd[2395]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Feb 06 07:28:25 qlntrk.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Feb 06 07:28:25 qlntrk.com kill[2406]: kill: cannot find process ""
Feb 06 07:28:25 qlntrk.com systemd[1]: httpd.service: control process exited, code=exited status=1
Feb 06 07:28:25 qlntrk.com systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has failed.
Apache 访问日志:
54.39.100.61 - - [03/Feb/2019:03:12:10 +0000] "GET / HTTP/1.1" 200 - "-" "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586"
109.173.40.29 - - [03/Feb/2019:03:12:14 +0000] "GET / HTTP/1.1" 200 - "https://yandex.ru/clck/jsredir?from=yandex.ru%3Bsearch%3Bweb%3B%3B&text=&etext=2052.mhf8iA27ddRBnN3GnTJNwaviWpAholnz9GtCGTnPy7Y.592bb885899fd7e8363e6a21ace078195106d9ae&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXmeppkgUc0YD4hgzqAYr5iuWBiLZQy-rY&data=UlNrNmk5WktYejR0eWJFYk1LdmtxcHpqQmU2dU5tYVlwd2xPZThPcklINUFidXh2ZWx0N3ZzUVlLSXNHcU9wYWhsV0tiRVFXUjJnYXNBUmhORDhFYU02YzNqT2ZJUXV3&b64e=2&sign=6cad9be581189005b123fac70153802b&keyno=0&cst=AiuY0DBWFJ7IXge4WdYJQaYgAYq7Jarr9EZ3-2YfDUgWOTEO_6wwpH_QbobMiT-yBt-68yoLcIDBh8xTQdkoZkQE1HXlIlQ218ih1JfRCw3avu7UGfUUVfRu045j-3qtC8voEApgZUm0GD0ShPyz1I_TDd6xsXAo&ref=orjY4mGPRjk5boDnW0uvlrrd71vZw9kp5uQozpMtKCXvzya1eNB8qvbLUvO794CgdbnZmMdloMdkfR6qB2deoeK1qxCCD8ZnBxige6Zlc7Y&l10n=ru&cts=1549159368762&mc=5.38327860459" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0; MASBJS)"
34.220.99.163 - - [03/Feb/2019:03:12:15 +0000] "GET / HTTP/1.1" 200 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"
82.80.230.228 - - [03/Feb/2019:03:12:15 +0000] "GET / HTTP/1.1" 200 - "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22"
54.39.100.61 - - [03/Feb/2019:03:12:15 +0000] "GET / HTTP/1.1" 200 - "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36"
Apache 错误日志:
[Sun Feb 03 03:12:02.579986 2019] [auth_digest:notice] [pid 20329] AH01757: generating secret for digest authentication ...
[Sun Feb 03 03:12:02.582071 2019] [lbmethod_heartbeat:notice] [pid 20329] AH02282: No slotmem from mod_heartmonitor
[Sun Feb 03 03:12:02.589849 2019] [ssl:warn] [pid 20329] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Sun Feb 03 03:12:02.607009 2019] [mpm_prefork:notice] [pid 20329] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.2.12 configured -- resuming normal operations
答案1
经过 3 小时的挖掘,我发现我的 SSL 配置文件存在问题。我更新了 letsencrypt SSL 证书,然后出现了这个问题。
https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-centos-7
我使用以下步骤检查这个“httpd -t”但“语法OK”。
然后从虚拟主机文件中删除 SSL 证书的行,然后它就可以正常工作了。例如
谢谢你的帮助。