Col*_*acX 76 xampp ssl https http-status-code-404
我一直在关注本指南,尽可能多地 http://robsnotebook.com/xampp-ssl-encrypt-passwords.
但是,每当我浏览到以https开头的页面时,apache服务器都会回复404 Object Not Found.
我缺少什么设置?谢谢你的帮助.
Col*_*acX 102
找到了答案.在文件中xampp\apache\conf\extra\httpd-ssl.conf,在SSL Virtual Host Context端口443上的注释页面下,意味着在不同的文档根目录下查找https.
只需将文档根目录更改为同一个,问题就解决了.
Tob*_*ann 79
您还可以xampp/apache/conf/extra/httpd-vhost.conf像这样配置SSL :
<VirtualHost *:443>
DocumentRoot C:/xampp/htdocs/yourProject
ServerName yourProject.whatever
SSLEngine on
SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
我想,httpd-ssl.conf如果你有多个项目并且你需要多个SSL上的SSL,最好不要改变它
Pri*_*ari 11
对于XAMPP,请执行以下步骤:
G:\ XAMPP\apache的\的conf \额外\的httpd-ssl.conf中"
搜索"DocumentRoot"文字.
将DocumentRoot DocumentRoot"G:/ xampp/htdocs"更改为DocumentRoot"G:/ xampp/htdocs/project name".
在xampp / apache / conf / extra / httpd-vhost.conf中配置SSL
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/myproject/web"
ServerName www.myurl.com
<Directory "C:/xampp/htdocs/myproject/web">
Options All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
<VirtualHost *:443>
DocumentRoot "C:/xampp/htdocs/myproject/web"
ServerName www.myurl.com
SSLEngine on
SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"
<Directory "C:/xampp/htdocs/myproject/web">
Options All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
确保正确指定server.crt和server.key路径,否则将无法正常工作。
不要忘记在httpd.conf中启用vhost
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
Run Code Online (Sandbox Code Playgroud)
这里有一个更好的 Windows 指南:
https://shellcreeper.com/how-to-create-valid-ssl-in-localhost-for-xampp/
基本步骤:
使用此方法为您的本地域创建 SSL 证书:请参阅上面的链接中的更多详细信息 https://gist.github.com/turtlepod/3b8d8d0eef29de019951aa9d9dcba546 https://gist.github.com/turtlepod/e94928cddbfc46cfbaf8c3e5856577d0
在 Windows(受信任的根证书颁发机构)中安装此证书请参阅上面的链接查看更多详细信息
在 Windows 主机 (C:\Windows\System32\drivers\etc\hosts) 中添加站点,例如:127.0.0.1 site.test
在 XAMPP conf (C:\xampp\apache\conf\extra\httpd-vhosts.conf) 中添加站点,例如:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "C:/xampp/htdocs"
ServerName site.test
ServerAlias *.site.test
SSLEngine on
SSLCertificateFile "crt/site.test/server.crt"
SSLCertificateKeyFile "crt/site.test/server.key"
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
重新启动 Apache 和浏览器即可完成!
| 归档时间: |
|
| 查看次数: |
244446 次 |
| 最近记录: |