laravel - 为虚拟主机 laravel 提供 SSL 证书
问题描述
我有一个项目,我想作为前端开发人员工作,而 laravel 中的后端
一切都很好,我会开始工作,但是当我访问网站上的任何页面时,链接(例如图像、css、js 等链接)是HTTPS,但是我机器中的链接是HTTP,所以我大部分有SSL来运行项目
我试过虚拟主机:
<VirtualHost *:8000>
DocumentRoot "C:/xampp/htdocs/bm/public"
ServerName business.example.lc:8000
ServerAdmin admin@example.com
# SSL Engine Switch: Enable/Disable SSL for this virtual host.
SSLEngine on
SSLCertificateFile "C:/xampp/apache/conf/ssl.crt/server.crt"
SSLCertificateKeyFile "C:/xampp/apache/conf/ssl.key/server.key"
<Directory "C:/xampp/htdocs/bm/public">
#SSLOptions +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "C:/xampp/htdocs/bm/public"
ServerName business.example.lc:443
ServerAdmin admin@example.com
# SSL Engine Switch: Enable/Disable SSL for this virtual host.
SSLEngine on
SSLCertificateFile "C:/xampp/apache/conf/ssl.crt/server.crt"
SSLCertificateKeyFile "C:/xampp/apache/conf/ssl.key/server.key"
<Directory "C:/xampp/htdocs/bm/public">
#SSLOptions +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
和主机文件
127.0.0.1:8000 business.example.lc
但是当我访问https://business.example.lc/
它时它会看到我 404 仅适用于http://business.example.lc/
我也试过:
> C://xampp/htdocs/bm> makecert.bat
但是在这里当我提交时,它需要一个密码:
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
返回:
C:\xampp\apache>makecert.bat
Generating a RSA private key
..........+++++
....................................................................................................+++++
writing new private key to 'privkey.pem'
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
Verify failure
7920:error:2807106B:UI routines:UI_process:processing error:crypto\ui\ui_lib.c:545:while reading strings
7920:error:0906406D:PEM routines:PEM_def_callback:problems getting password:crypto\pem\pem_lib.c:59:
7920:error:0907E06F:PEM routines:do_pk8pkey:read key:crypto\pem\pem_pk8.c:83:
unable to load Private Key
5656:error:0909006C:PEM routines:get_name:no start line:crypto\pem\pem_lib.c:745:Expecting: ANY PRIVATE KEY
Can't open server.csr for reading, No such file or directory
8304:error:02001002:system library:fopen:No such file or directory:crypto\bio\bss_file.c:69:fopen('server.csr','r')
8304:error:2006D080:BIO routines:BIO_new_file:no such file:crypto\bio\bss_file.c:76:
Could Not Find C:\xampp\apache\.rnd
Could Not Find C:\xampp\apache\server.csr
The system cannot find the file specified.
The system cannot find the file specified.
-----
Das Zertifikat wurde erstellt.
The certificate was provided.
Press any key to continue . . .
解决方案
推荐阅读
- python - 如何解释 scipy 峰值检测中的参数“宽度”?
- javascript - 将支付服务(PayPal 和 Stripe)集成到 Chrome 扩展中
- scala - 火花流 | 将不同的数据帧写入 Synapse DW 中的多个表
- c# - 当我使用 Console.Readline() 时,单元测试在中间停止
- python - 使用 seaborn displot 我无法指定色调来分隔 kde 图的三个类别
- sqlalchemy - 将现有类定义与现有数据库 sqlalchemy 一起使用
- c# - 为什么创建这些线程不会释放内存?
- python - 使用python弹性搜索包访问aws弹性搜索角色
- angular - 将 Salesforce Login Soap Api 与 Angular 集成
- c# - 使用 C# SDK SSR_DeleteEnrollData 的 ZK / ESSL 生物识别集成