Apache mod_ssl http 转 https

Apache mod_ssl http 转 https

我在 CentOS7 上安装了 OTRS 6 以探索它的功能,但我很难通过https.它安装了 Apache,我已经安装了 mod_ssl 模块,创建了自签名证书并修改了ssl.conf文件以指向私钥和证书文件。当我通过访问网页时https://server/otrs/index.pl我收到自签名证书警告,并且我能够访问它,但我仍然可以通过HTTP.经过几次谷歌搜索后,我仍然无法阻止或重定向所有HTTP请求https.我找到了这篇文章将 SSL 证书与 OTRS 结合使用它表示将以下几行放入 HTTP 虚拟主机配置中:

RewriteEngine On 
RewriteCond %{HTTPS} off 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

但问题是,在我的 ssl.conf 中没有 HTTP 虚拟主机的部分,我只能看到 HTTPS 的部分<VirtualHost_default_:443

我究竟做错了什么?任何帮助深表感谢!

相关内容