为虚拟主机 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>

hosts 文件

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 . . .

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)