The sslstaplingcache cannot occur within virtualhost section error triggers as it cannot define the sslstaplingcache inside VirtualHost directive. This generally happens during an apache restart.
As a part of our Server Management Services, we help our Customers to fix webserver related errors regularly.
Let us today discuss the possible causes and fixes for this error.
What is sslstaplingcache cannot occur within virtualhost section ?
OCSP Stapling enhances the OCSP protocol as it makes the Webhosting site more proactive in improving the client’s browsing experience. Once implemented the certificate holder queries the OCSP server themselves and caches the response.
This response “staples” with the TLS/SSL Handshake via the Certificate Status Request extension response. As a result the CA’s servers are not burdened with requests and browsers no longer need to disclose users’ browsing habits to any third party. Often, users may notice an error message as shown below:
[2017-07-09 14:01:10] ERR [panel] Apache config (14996232340.03005700) generation failed: Template_Exception: AH00526: Syntax error on line 57 of /etc/apache2/plesk.conf.d/webmails/xxx.com_webmail.conf:
SSLStaplingCache cannot occur within section
This error occurs when trying to restart apache as sslstaplingcache cannot be defined inside VirtualHost directive.
How to fix sslstaplingcache cannot occur within virtualhost section ?
Defining the sslstaplingcache in apache ssl configuration file outside VirtualHost directive can fix this error. We can specify the OCSP cached response location in the file /etc/apache2/sites-available/example.com-ssl.conf
For instance, a sample configuration as given below:
<IfModule mod_ssl.c>
SSLStaplingCache shmcb:/var/run/ocsp(128000)
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName example.com
DocumentRoot /var/www
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/example.com/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/example.com/apache.key
SSLCACertificateFile /etc/ssl/ca-certs.pem
SSLUseStapling on
</VirtualHost>
</IfModule>
[Need any further assistance in fixing Webserver errors? – We’re available 24*7]
Conclusion
In short, the sslstaplingcache error occurs when trying to restart apache as sslstaplingcache cannot be defined inside VirtualHost directive. Today, we saw how our Support Engineers fix this error.
0 Comments