【问题标题】:https doesn't work on Xampphttps 在 Xampp 上不起作用
【发布时间】:2018-11-03 03:56:06
【问题描述】:

如何让 https 在 xampp 上运行。我正在创建一个网站,但如果使用 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

非常感谢。

【问题讨论】:

    标签: ssl https openssl xampp ssl-certificate


    【解决方案1】:

    确保您的服务器正在侦听端口 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

    【讨论】:

    • 感谢您的关注。但上面的代码不起作用。结果“404 Page Not Found”。
    • 您使用什么样的应用程序?例如;当您访问 www.foo.com/index.html 时,您会得到响应吗?否则你可以尝试添加这样的一行: DirectoryIndex index.html index.php
    • 我使用了应用程序codeigniter。我试过“DirectoryIndex index.html index.php”,但结果是一样的。结果“未找到 404 页面”
    猜你喜欢
    • 2016-03-14
    • 2015-07-01
    • 2013-09-11
    • 1970-01-01
    • 2015-02-23
    • 2015-02-27
    • 2011-09-03
    • 2016-06-20
    • 2017-03-12
    相关资源
    最近更新 更多