Home > Common Problem > http request to https request

http request to https request

Release: 2019-07-22 10:04:06
Original
17069 people have browsed it

http request to https request

1. First, log in to the Alibaba Cloud official website, find the Cloud Shield Certificate Service, select the required SSL certificate according to your needs and purchase it.

http request to https request

#2. After purchasing, it will pass the review in about a few minutes, and you can enter the SSL certificate management console to check the certificate status.

http request to https request

#3. Click Download and select the type of certificate to download according to your server environment. I am using Apache, so I downloaded the second one.

http request to https request

#4. After downloading, unzip the file and upload it to the apache installation directory, and create a new ssl folder under /ect/apache2 (the folder name can be customized, which will be updated later) Use the path to this folder (remember to replace it yourself) and upload all the decompressed files into it.

http request to https request

5. Apache has its own ssl module by default. If not, please install it yourself~ Under /etc/apache2/mods-available, open the ssl.load file, Remove the # sign before the sentence LoadModulessl_module/usr/lib/apache2/modules/mod_ssl.so.

http request to https request

In the same directory, open the ssl.conf file and modify the following content:

# 添加 SSL 协议支持协议,去掉不安全的协议
SSLProtocol all -SSLv2 -SSLv3
# 修改加密套件如下
SSLCipherSuite HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM
SSLHonorCipherOrder on
Copy after login

6. Open default under /etc/apache2/sites-available -ssl.conf file, modify the following content (replace the file path with your previously customized path):

SSLCertificateFile /etc/apache2/ssl/1533868915008.pem
SSLCertificateKeyFile /etc/apache2/ssl/1533868915008.key
SSLCertificateChainFile /etc/apache2/ssl/public.pem
Copy after login

http request to https request

#7. Automatically check whether the configuration file is correct: apachectl configtest , if there is an error, check the detailed command: apachectl configtest, and then restart Apache: service apache2 restart.

Now, add https in front of your domain name to access it

Finally, implement HTTP to automatically jump to HTTPS
Open 000 under /etc/apache2/sites-available -default.conf, add the following configuration:

# 自动将80端口的访问,重定向到https的域名
    Redirect permanent / https://xxx.com
Copy after login

Restart Apache: service apache2 restart.

The above is the detailed content of http request to https request. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template