Deployment of NameCheap SSL certificates in Nginx/Apache

Source: Internet
Author: User
Following the "Namecheap SSL certificate (PositiveSSL) activate and obtain Nginx environment SSL "the article has been shared to the left to learn how to activate and install PositiveSSL purchased cheaply on Black Friday, although HTTPS addresses do not support the Chinese environment well now, they will become a trend in the future. Therefore, you can keep them in place to learn and organize technologies.

 

Because the time and energy of the previous article were not recorded together, we took some time to deploy the obtained SSL certificate to the website during the New Year's Day, A little different from waotong SSL certificates, the Nginx and Apache environments all use a set of certificate files, so we can deploy the certificate files obtained from Namecheap to the Nginx and Apache website environments.

 

 

The above is the certificate file we obtained from the Namecheap official website. Different from the one that once used NC, the certificate file has been merged into two files, I have used to know that 4 files need to be merged by myself. It is much simpler now.

 

1. Prepare the Namecheap SSL certificate

 

Whether we deploy the SSL certificate to the Nginx environment or Apache environment, we must at least copy the laozuo. csr and laozuo. key files generated on the server to the local machine.

 

Second, we also need to extract the compressed package files downloaded from NC, decompress both files and put them together with the above two files, although not all of them need to be used, but somehow also back up together, later used to upload to the specified directory, we here custom name laozuo_org.ca-bundle, laozuo_org.crt, name we define, because the following fear of chaos so do not name.

 

2. Deploy SSL in the Nginx environment

 

1. Upload The laozuo. key and laozuo_org.crt files to the/usr/local/nginx/conf/directory.

 

2. Configure the. conf file

 

The code is as follows: Copy code

/Usr/local/nginx/conf/vhost/

 

In the above Directory, we need to configure the. conf file of the SSL certificate site to modify the configuration.

 

 

In the configuration file, we can see that the annotation is added by me, and then the update file can take effect after restarting NGINX, and all the original HTTP is redirected to the HTTPS address. Of course, this is just a simple configuration. I have seen a lot of tutorials and many parameters that can be set, such as the cache time. I will study this later. If you have any questions, I can give some advice.

 

3. Restart nginx to take effect.

 

3. Deploy SSL certificates in Apache

 

After reading the previous blog article, I wrote in "LAMP (Apache) environment deployment and installation of SSL security certificates and HTTPS-encrypted websites" that I deployed SSL certificates in the Apache environment, the method is somewhat similar. In this environment, the old version is in the Apache 2.2 environment, and the version 2.4 may be different.

 

1. Make sure that the SSL module is deployed.

 

The code is as follows: Copy code

Yum install openssl
Yum install mod_ssl

 

Regardless of whether the environment is deployed or not, we need to redeploy it on our own.

 

2. Check and start the SSL module

 

In our environment, it is the ssl. conf file in the/etc/httpd/conf. d/Directory. Open it in the Submlime editor on the left.

 

Check the LoadModule ssl_module modules/mod_ssl.so line, and if you see the previous # Remove start, if it has been removed, it will not matter.

 

3. Edit and deploy SSL

 

In the same ssl. conf file, edit the rows below the <VirtualHost _ default _: 443> Location

 

The code is as follows: Copy code

DocumentRoot "/var/www/laozuo.org/public_html /"
ServerName laozuo.org: 443
SSLEngine on
SSLCertificateFile/root/laozuo.org. crt
SSLCertificateKeyFile/root/laozuo. key
SSLCertificateChainFile/root/laozuo_root_bundle.crt

 

Note that the three file paths to be uploaded are used as the URL.

 

4. Restart apache

 

The code is as follows: Copy code

Service httpd restart

 

IV. Summary of Namecheap SSL certificate deployment

 

Whether we use a paid certificate or a free SSL certificate, the process is similar. You only need to deploy the obtained certificate file to the corresponding path of the corresponding environment, of course, there are also some details of the problem, the amount of information is relatively messy, the old left to use a practical site to test.

 

For example, if you see some cache time and some parameters that you don't quite understand, you didn't add them during the above deployment. Later, you will use an actual website to see the corresponding effect. If you are familiar with HTTPS, you can tell or contact the old left. The old Left wishes to ask a few questions.

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.