【发布时间】:2018-11-11 12:55:08
【问题描述】:
我正在尝试将 http 重定向到 https VirtualHost 这是我添加到 httpd-vhosts.conf 的代码
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/html/dummy-host.example.com
ServerName apache1.poc
Redirect / https://apache1.poc
ServerAlias www.apache1.poc
ErrorLog /var/log/httpd/dummy-host.example.com-error_log
CustomLog /var/log/httpd/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost *:443>
ServerName apache1.poc
DocumentRoot /var/www/html/dummy-host.example.com
SSLEngine On
# etc...
</VirtualHost>
但 httpd.service 没有重新启动,我得到以下状态
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2018-06-01 13:20:17 WET; 5min ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 4813 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 4811 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 4811 (code=exited, status=1/FAILURE)
Jun 01 13:20:16 Apache1.POC systemd[1]: Starting The Apache HTTP Server...
Jun 01 13:20:16 Apache1.POC systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jun 01 13:20:17 Apache1.POC kill[4813]: kill: cannot find process ""
Jun 01 13:20:17 Apache1.POC systemd[1]: httpd.service: control process exited, code=exited status=1
Jun 01 13:20:17 Apache1.POC systemd[1]: Failed to start The Apache HTTP Server.
Jun 01 13:20:17 Apache1.POC systemd[1]: Unit httpd.service entered failed state.
Jun 01 13:20:17 Apache1.POC systemd[1]: httpd.service failed.
【问题讨论】:
-
错误日志中有什么内容?
-
谢谢我找到了解决办法
标签: apache http https redhat httpd.conf