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 Combining lookahead and lookbeh...
The attributes of the <TR> tag are used to ...
When doing web development, you may encounter the...
Library Operations Query 1.SHOW DATABASE; ----Que...
1. Brief introduction of the event An event is a ...
How to use if in Linux to determine whether a dir...
Recently, when using IIS as a server, the apk fil...
Preface BINARY and VARBINARY are somewhat similar...
This article uses an example to describe the inte...
Table of contents 1. Define object methods 2. Def...
introduce HTML provides the contextual structure ...
This article example shares the specific code of ...
I see many novice students doing front-end develop...
1. Introduction to MMM: MMM stands for Multi-Mast...
Table of contents question extend Solving the pro...