In the past few days, the website has been accessed very slowly when it is opened for the first time, but the page opens normally afterwards. After research, it was found that the problem was the HTTPS certificate verification timeout, and the verification URL of the certificate provider could not be accessed. I don't know if it was a line problem or a firewall. I asked several experts how to solve the problem of HTTPS certificate verification timeout. The solutions given were to either change the certificate provider or enable OCSP. How can a poor person like me afford the HTTPS certificate from a big company? I can only adopt the second solution and start OCSP. If a website has deployed a free Let's Encrypt certificate, the first time you open the website using https, it will appear very slow and often take four or five seconds to open normally. This is due to special reasons: the ocsp.int-x3.letsencrypt.org server IP cannot be resolved normally. In order to improve the website access experience, you can enable OCSP Stapling to solve the problem of slow access when visiting the website for the first time. This article's environment: Pagoda Panel CentOS 7 / Windows 2012 R2 Apache / Nginx 1. Enable OCSP Stapling for overseas servers1. Configure the system's Apache or Nginx information Apache enables OCSP:① Find the Apache installation directory and edit the httpd-ssl.conf file in the directory. The directory in CentOS system is: /www/server/apache/conf/extra/httpd-ssl.conf, and the directory in Windows system is: C:/BtSoft/apache/conf/extra/httpd-ssl.conf. Remove the comments of the following two lines in the file:
If the above two lines are not in the file, add them manually. ②Edit the httpd.conf file. The directory in CentOS is: /www/server/apache/conf/httpd.conf, and the directory in Windows is: C:/BtSoft/apache/conf/httpd.conf. Uncomment the following line in the file:
If the above line does not exist in the file, add it manually. ③Configure the Apache information of the website. In the configuration file of the website, add the following information:
The above information can be added above this line <VirtualHost *:443>. At this point, OCSP Stapling has been enabled on Apache. Just restart Apache. Nginx enables OCSP:Directly in the website's Nginx configuration file, add the following information:
Save and restart Nginx. 2. Enable OCSP Stapling for inland serversThe steps are the same as in the first paragraph. After enabling OCSP Stapling, you also need to edit the hosts file and specify the IP address of the ocsp.int-x3.letsencrypt.org server. The IP addresses of the ocsp.int-x3.letsencrypt.org servers are as follows:
Edit the hosts file. The path in Windows is: C:\windows\system32\drivers\etc\hosts, and the path in Linux is: /etc/hosts. Add the following information:
Just restart Apache or Nginx. 3. Verify whether OCSP Stapling is enabled successfully1. Use the following command in SSH:
If the site returns OCSP response: no response sent, it means the activation failed. If the site has successfully enabled OCSP Stapling, a prompt will be returned with "successful". 2. Open the following URL and enter your website to detect: https://www.getssl.cn/ocsp If your website appears to be slow when you first open it, and it is also https, you may want to check if there is a problem with the certificate. Please follow 123WORDPRESS.COM to learn more about the problem of slow website opening speed You may also be interested in:
|
<<: Velocity.js implements page scrolling switching effect
Table of contents Overview Same Origin Policy (SO...
Table of contents 1 A brief introduction to syste...
01. Command Overview md5sum - Calculate and verif...
CSS CodeCopy content to clipboard .bottomTable{ b...
mysql full backup 1. Enable binary log and separa...
Use of v-on:clock in Vue I'm currently learni...
It's the end of the year and there are fewer ...
Preface To help ensure that your web pages have a ...
1. Refer to the official website to install docke...
This article example shares the specific code of ...
Table of contents 1. Introduction to podman 2. Ad...
1. Under 800*600, if the width of the web page is...
Custom Image FAQ How to view the data disk? You c...
This article shares the specific code for JavaScr...
Table of contents 1. Security issues with Docker ...