Virtual machines implement HTTPS network settings

Source: Internet
Author: User
Tags openssl x509 ssl certificate

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.