以下是优化Apache SSL性能的关键配置:
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 # 仅保留TLS 1.3/1.2
SSLSessionCache shmcb:/path/to/ssl_scache(512000) # 缓存大小(单位:字节)
SSLSessionCacheTimeout 300 # 缓存超时时间(秒)
SSLUseStapling on
SSLStaplingCache "shmcb:/var/run/ocsp-stapling-cache(128000)" # 缓存大小
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
SSLCipherSuite HIGH:!aNULL:!MD5 # 禁用弱密码套件
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5 # 适当缩短超时时间
# 部分场景需安装特定模块或硬件驱动,具体需参考服务器文档
<IfModule mpm_prefork_module>
ServerLimit 256
ThreadsPerChild 256
</IfModule> # 示例配置,需根据实际负载调整
注意事项: