微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为虚拟主机 laravel 提供 SSL 证书

如何解决为虚拟主机 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 举报,一经查实,本站将立刻删除。