Now many websites use the HTTPS protocol, want to implement on their own computers,
Because my computer is win10, I always feel that the environment on Windows is not as stable as Linux, so I installed the virtual machine on the computer, Cento the system.
Last weekend in the virtual machine installed LNMP environment and laravel and background, OAuth, hard to write down the installation steps, did not expect to open the computer yesterday, to find notes, inexplicable wonderful No, lost and I saved the virtual computer (depressed a minute ...) )
How to disappear somehow, I suspect that the WIN10 system automatically restart the alarm, and then decisively turn off the automatic restart function (fork waist)
Forget it, don't spit it out, go straight to the subject
I am in the virtual machine layout of the LNMP environment, want to let the site can use HTTPS access, first to apply for a certificate, just want to set up an environment to satisfy their curiosity, no need to apply for a paid SSL certificate, then apply for free bar
Generate private keys and certificates
1. Generate the private key of the server (placed in Nginx configuration directory)
OpenSSL genrsa-des3-out Server.key 1024
2. Create a request file for the server certificate
OpenSSL Req-new-key server.key-out SERVER.CSR
3. Build the server's certificate
OpenSSL x509-req-days 365-in server.csr-signkey server.key-out server.crt
The certificate has been generated, and then you can deploy the certificate.
Deploying certificates
Add the following configuration to the Nginx configuration file
server { listen 443default SSL; SSL on; /etc/nginx/conf.d/server.crt; /etc/nginx/conf.d/Server.key;
Virtual machines implement HTTPS network settings