使用自定义证书为SSL设置Apache Web服务器时无法启动

内特

我已经在RHEL 7实例上设置了Apache Web服务器

yum install mod_ssl openssl
openssl genrsa -out ca.key 2048 
openssl req -new -key ca.key -out ca.csr
openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt
cp ca.crt /etc/pki/tls/certs
cp ca.key /etc/pki/tls/private/ca.key
cp ca.csr /etc/pki/tls/private/ca.csr

在httpd.conf文件和ssl.conf文件中,我将指向443的虚拟主机更改为使用以下SSLCertificateFile /etc/pki/tls/certs/ca.crt SSLCertificateKeyFile /etc/pki/tls/private/ca.key

httpd重新启动可以正常工作

当我用自定义证书替换它们时,出现以下错误

httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2020-03-08 19:36:43 UTC; 12s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 6763 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 6761 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 6761 (code=exited, status=1/FAILURE)

Mar 08 19:36:43 hostname systemd[1]: Starting The Apache HTTP Server...
Mar 08 19:36:43 hostname httpd[6761]: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf/httpd.conf:13
Mar 08 19:36:43 hostname systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 08 19:36:43 hostname kill[6763]: kill: cannot find process ""
Mar 08 19:36:43 hostname systemd[1]: httpd.service: control process exited, code=exited status=1
Mar 08 19:36:43 hostname systemd[1]: Failed to start The Apache HTTP Server.
Mar 08 19:36:43 hostname systemd[1]: Unit httpd.service entered failed state.
Mar 08 19:36:43 hostname systemd[1]: httpd.service failed.
===============================================
=================================
-- Unit httpd.service has begun starting up.
Mar 08 19:19:39 hostname polkitd[616]: Registered Authentication Agent for unix-process:6681:1188860 (system bus name :1.51 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Mar 08 19:19:39 hostname systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has begun starting up.
Mar 08 19:19:39 hostname httpd[6687]: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf/httpd.conf:13
Mar 08 19:19:39 hostname audispd[583]: node=hostname type=AVC msg=audit(1583695179.383:732): avc:  denied  { read } for  pid=6687 comm="httpd" name="hostname.cer" dev="nvme0n1p2" ino=539462 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=0
Mar 08 19:19:39 hostname audispd[583]: node=hostname type=SYSCALL msg=audit(1583695179.383:732): arch=c000003e syscall=2 success=no exit=-13 a0=7ffd30429940 a1=80000 a2=0 a3=7ffd30428b60 items=0 ppid=1 pid=6687 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
Mar 08 19:19:39 hostname audispd[583]: node=hostname type=PROCTITLE msg=audit(1583695179.383:732): proctitle=2F7573722F7362696E2F6874747064002D44464F524547524F554E44
Mar 08 19:19:39 hostname systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 08 19:19:39 hostname kill[6689]: kill: cannot find process ""
Mar 08 19:19:39 hostname systemd[1]: httpd.service: control process exited, code=exited status=1
Mar 08 19:19:39 hostname 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.
--
-- The result is failed.
Mar 08 19:19:39 hostname systemd[1]: Unit httpd.service entered failed state.
Mar 08 19:19:39 hostname systemd[1]: httpd.service failed.
Mar 08 19:19:39 hostname audispd[583]: node=hostname type=SERVICE_START msg=audit(1583695179.413:733): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=httpd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Mar 08 19:19:39 hostname polkitd[616]: Unregistered Authentication Agent for unix-process:6681:1188860 (system bus name :1.51, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Mar 08 19:31:55 hostname adclient[1767]: INFO  AUDIT_TRAIL|Centrify Suite|Trusted Path|1.0|2700|Trusted path granted|5|[email protected] pid=1767 utc=1583695915114 centrifyEventID=23700 DASessID=N/A DAInst=N/A status=GRANTED server=ldap/[email protected]
lines 1869-1900/1900 (END)

由于证书的专有性,我无法共享证书的详细信息,请让我知道还要寻找什么?谢谢内特

内特

必须将证书文件的所有权更改为ec2-user:root,以获取访问证书文件的过程。这解决了问题。非常感谢Roaima。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

无法重新启动Apache Web服务器-Ubuntu

来自分类Dev

使用Qjackctl时出现“无法启动JACK服务器”

来自分类Dev

使用Qjackctl时出现“无法启动JACK服务器”

来自分类Dev

配置Unix apache Web服务器以在重新启动时自动启动?

来自分类Dev

每次重新启动时都启动 apache web 服务器 cloud-init

来自分类Dev

在Mac OS X 10.8上无法使用“启动时自动启动MySQL服务器”

来自分类Dev

在Mac OS X 10.8上无法使用“启动时自动启动MySQL服务器”

来自分类Dev

Apache,问题无法启动LSB:Apache2 Web服务器

来自分类Dev

Apache,问题无法启动LSB:Apache2 Web服务器

来自分类Dev

为自定义 api 设置 ruby 服务器

来自分类Dev

XAMPP 1.8.2-2 Apache Web服务器无法启动,总是立即停止

来自分类Dev

XAMPP 1.8.2-2 Apache Web服务器无法启动,总是立即停止

来自分类Dev

XAMPP 1.8.2-2 Apache Web服务器无法启动,总是立即停止

来自分类Dev

为什么服务器启动时“无法定义类”警告?

来自分类Dev

Erlang / Yaws:无法使用.conf文件在应用程序中启动Web服务器

来自分类Dev

列出为SAN的自定义域的EV SSL证书无法上传

来自分类Dev

使用NodeJS更改配置文件时重新启动Web服务器

来自分类Dev

启动服务器时使用Pycharm启动后台作业

来自分类Dev

使用绑定将我的自定义名称服务器设置为我的域

来自分类Dev

Web服务器上没有活动登录时无法访问证书

来自分类Dev

重新安装后使用 Subversion 服务器启动 Apache Web 服务器时出现“未知 DAV 提供程序:svn”

来自分类Dev

我的SP网站的自定义设置,而不使用列表或无法访问服务器场/服务器?

来自分类Dev

Apache2“无法启动Apache HTTP服务器”

来自分类Dev

在共享服务器上使用自定义编译的Apache编译Subversion时出错

来自分类Dev

无法将AWS Cloudfront与IAM中的自定义SSL证书一起使用

来自分类Dev

无法启动apache2服务器

来自分类Dev

无法在 Ubuntu 18.4 上启动 Apache HTTP 服务器

来自分类Dev

在sts内嵌apache tomcat服务器无法启动

来自分类Dev

服务器以django框架启动时如何运行自定义python代码?

Related 相关文章

  1. 1

    无法重新启动Apache Web服务器-Ubuntu

  2. 2

    使用Qjackctl时出现“无法启动JACK服务器”

  3. 3

    使用Qjackctl时出现“无法启动JACK服务器”

  4. 4

    配置Unix apache Web服务器以在重新启动时自动启动?

  5. 5

    每次重新启动时都启动 apache web 服务器 cloud-init

  6. 6

    在Mac OS X 10.8上无法使用“启动时自动启动MySQL服务器”

  7. 7

    在Mac OS X 10.8上无法使用“启动时自动启动MySQL服务器”

  8. 8

    Apache,问题无法启动LSB:Apache2 Web服务器

  9. 9

    Apache,问题无法启动LSB:Apache2 Web服务器

  10. 10

    为自定义 api 设置 ruby 服务器

  11. 11

    XAMPP 1.8.2-2 Apache Web服务器无法启动,总是立即停止

  12. 12

    XAMPP 1.8.2-2 Apache Web服务器无法启动,总是立即停止

  13. 13

    XAMPP 1.8.2-2 Apache Web服务器无法启动,总是立即停止

  14. 14

    为什么服务器启动时“无法定义类”警告?

  15. 15

    Erlang / Yaws:无法使用.conf文件在应用程序中启动Web服务器

  16. 16

    列出为SAN的自定义域的EV SSL证书无法上传

  17. 17

    使用NodeJS更改配置文件时重新启动Web服务器

  18. 18

    启动服务器时使用Pycharm启动后台作业

  19. 19

    使用绑定将我的自定义名称服务器设置为我的域

  20. 20

    Web服务器上没有活动登录时无法访问证书

  21. 21

    重新安装后使用 Subversion 服务器启动 Apache Web 服务器时出现“未知 DAV 提供程序:svn”

  22. 22

    我的SP网站的自定义设置,而不使用列表或无法访问服务器场/服务器?

  23. 23

    Apache2“无法启动Apache HTTP服务器”

  24. 24

    在共享服务器上使用自定义编译的Apache编译Subversion时出错

  25. 25

    无法将AWS Cloudfront与IAM中的自定义SSL证书一起使用

  26. 26

    无法启动apache2服务器

  27. 27

    无法在 Ubuntu 18.4 上启动 Apache HTTP 服务器

  28. 28

    在sts内嵌apache tomcat服务器无法启动

  29. 29

    服务器以django框架启动时如何运行自定义python代码?

热门标签

归档