Я пытаюсь запустить PHP и Apache с SSL на сервере RedHat, AWS. После настройки развертывания перезапуск apache не выполняется.
Задание для httpd.service завершилось неудачно, поскольку процесс управления завершился с кодом ошибки. См. "Systemctl status httpd.service" и "journalctl -xe" для подробностей.
Статус systemctl httpd.service дает:
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-04-20 15:21:17 EDT; 3min 25s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 11017 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 11015 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 11015 (code=exited, status=1/FAILURE)
Apr 20 15:21:17 ip-172-16-255-255.internal systemd[1]: Starting The Apache HTTP Server...
Apr 20 15:21:17 ip-172-16-255-255.internal systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Apr 20 15:21:17 ip-172-16-255-255.internal kill[11017]: kill: cannot find process ""
Apr 20 15:21:17 ip-172-16-255-255.internal systemd[1]: httpd.service: control process exited, code=exited status=1
Apr 20 15:21:17 ip-172-16-255-255.internal systemd[1]: Failed to start The Apache HTTP Server.
Apr 20 15:21:17 ip-172-16-255-255.internal systemd[1]: Unit httpd.service entered failed state.
Apr 20 15:21:17 ip-172-16-255-255.internal systemd[1]: httpd.service failed.
В моем журнале есть:
var / log / httpd / error.log:
[Чт, 20 апреля, 14:25: 07.649234 2017] [suexec: notice] [pid 10823] AH01232: механизм suEXEC включен (оболочка: / usr / sbin / suexec)
[Чт, 20 апреля, 14:25: 07.665400 2017] [ssl: emerg] [pid 10823] AH02311: Неустранимая ошибка при инициализации mod_ssl, выход. См. /Var/log/httpd/dev.example.com/error2.log для получения дополнительной информации.
В журнале ошибок для конкретного развертывания я получаю:
[Чт, 20 апреля, 14: 24: 30.258985 2017] [ssl: emerg] [pid 10795] AH01895: Невозможно настроить расположение проверки для аутентификации клиента
[Чт, 20 апреля, 14:25: 07.665388 2017] [ssl: Emerg] [pid 10823] AH01895: невозможно настроить проверочные местоположения для аутентификации клиента
Конфигурация, которую я пробую:
#NameVirtualHost new.example.com:80
<VirtualHost new.example.com:80>
ServerAdmin webmaster@example.com
DocumentRoot /var/www/html/dev.example.com
ServerName new.example.com
DirectoryIndex index.html
DirectoryIndex index.php
LogLevel notice
ErrorLog /var/log/httpd/dev.example.com/error2.log
LogFormat "%{%Y-%m-%d %H:%M:%S}t %a %u %A %p %m %U %q %>s \"%{User-agent}i\"" w3c_extended
CustomLog /var/log/httpd/dev.example.com/access.log w3c_extended
</VirtualHost>
#NameVirtualHost new.example.com:443
<VirtualHost new.example.com:443>
ServerAdmin webmaster@example.com
DocumentRoot /var/www/html/dev.example.com
ServerName new.example.com
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
SSLProtocol all
SSLCertificateFile /usr/local/ssl/crt/example_2015.cert
SSLCertificateKeyFile /usr/local/ssl/private/ssl_2015.key
SSLCACertificateFile /usr/local/ssl/crt/example_2015_intermediate.pem
DirectoryIndex index.html
DirectoryIndex index.php
LogLevel notice
ErrorLog /var/log/httpd/dev.example.com/error2.log
LogFormat "%{%Y-%m-%d %H:%M:%S}t %a %u %A %p %m %U %q %>s \"%{User-agent}i\"" w3c_extended
CustomLog /var/log/httpd/dev.example.com/access.log w3c_extended
</VirtualHost>
Я перешел по этой ссылке:
https://forums.cpanel.net/threads/httpd-fails-to-restart-after-install-ssl-certificate.55823/
что позволило мне запустить Apache и PHP, но это не позволило SSL функционировать, поэтому я думаю, что это что-то с сертификатами.
Я потерял нить, в которой я был, но я также сравнил md5 ключа с сертификатом, и они оба совпали.
openssl x509 -noout -modulus -in ../crt/example_2015.cert | openssl md5
openssl rsa -noout -modulus -in ssl_2015.key | openssl md5
Я не уверен, что еще включить сюда, поэтому дайте мне знать, если я что-то пропустил.
Apache2ctl -S дает:
VirtualHost configuration:
255.255.255.255:80 new.example.com (/etc/httpd/conf.d/new.example.conf:2)
255.255.255.255:443 new.example.com (/etc/httpd/conf.d/new.example.conf:15)
*:443 ip-172-16-255-255.internal (/etc/httpd/conf.d/ssl.conf:56)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48