https不适用于Xampp

时间:2018-05-24 03:43:04

标签: ssl https openssl xampp ssl-certificate

如何在xampp上运行https。我正在创建一个网站,但是如果使用https://调用则不起作用。 我试试

DocumentRoot C:/xampp/htdocs/yourProject
ServerName yourProject.whatever
SSLEngine on
SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"

RewriteCond     %{SERVER_PORT} ^80$
RewriteRule     ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

结果: enter image description here

非常感谢你。

1 个答案:

答案 0 :(得分:0)

确保您的服务器正在侦听端口443.示例:

  <VirtualHost *:443>
  ServerName www.foo.com
  DocumentRoot /var/www/www.foo.com/htdocs

  CustomLog /var/log/apache/www.foo.com-access.log combined
  ErrorLog /var/log/apache/www.foo.com-error.log

  # Example SSL configuration
  SSLEngine on
  SSLProtocol all -SSLv2
  SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
  SSLCertificateFile "/var/www/www.foo.com/ssl/server.crt"
  SSLCertificateKeyFile "/var/www/www.foo.com/ssl/server.key"
</VirtualHost>

来源:https://wiki.apache.org/httpd/ExampleVhosts