In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you "how to open https and http2 for the site", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to open https and http2 for the site" this article.
It is relatively simple to enable https for a site. Take Linux + nginx of this site as an example
Three commands will do.
Download the script wget https://dl.eff.org/certbot-autochmod axix certbot-auto and automatically associate it to nginx$sudo. / certbot-auto-- nginx``sh # # check whether the certificate has expired
$sudo. / certbot-auto renew-- dry-run
# # automatically renew ```sh$sudo. / certbot-auto renew if it expires
If the following error code is prompted
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range (128) is because there are Chinese characters in the configuration file of nginx, so you can change Chinese into English
Or you can find it yourself.
Grep-r-P'[^\ x00 -\ x7f]'/ etc/nginx / etc/letsencrypt
All right, now open the nginx configuration and take a look.
Listen 443 ssl http2;ssl on;ssl_certificate / etc/letsencrypt/live/chuchur.com/fullchain.pem;ssl_certificate_key / etc/letsencrypt/live/chuchur.com/privkey.pem;include / etc/letsencrypt/options-ssl-nginx.conf;ssl_dhparam / etc/letsencrypt/ssl-dhparams.pem;if ($scheme! = "https") {return 301 https://$host$request_uri;} # managed by Certbot
Note that the nginx version is too low to open. First, upgrade the nginx version. Take centos as an example.
Modify the nginx warehouse address of / etc/yum.repos.d/nginx.repo
[nginx] name=nginx repobaseurl= http://nginx.org/packages/mainline/centos/$releasever/$basearch/gpgcheck=0enabled=1
If you don't already have nginx installed, execute yum install nginx directly, and if you already have, you can upgrade through yum clean all & & yum update nginx.
It is recommended that you first stop nginx and violently stop killall nginx, then uninstall yum remove nginx before reinstalling yum install nginx
Ubuntu / Debian upgrade HTTP/2
First, modify the address of the apt warehouse source / etc/apt/source.list by adding the following two lines of warehouse.
Deb http://nginx.org/packages/mainline/debian/ codename nginxdeb-src http://nginx.org/packages/mainline/debian/ codename nginx
Next, execute
Apt-get clean & & apt-get install nginx
All right, now it's successful. Https is on. The http2 behind 443 ssl, that is, http2.
Finally restart nginx
Nginx-s reload
Refresh the page and find that there is a lock in front of the URL, which means that https has been opened successfully.
How to verify that http2 is turned on? you open the URL you want to verify, and when the loading is complete, enter a new tab and enter chrome://net-internals/#http2.
If you find the ip corresponding to your URL in the list, it appears to have been enabled successfully.
Google browser, of course.
The above is all the content of the article "how to start https and http2 for the site". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.