httpd_ssl.conf.j2 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. #
  2. # When we also provide SSL we have to listen to the
  3. # the HTTPS port in addition.
  4. #
  5. Listen 443 https
  6. ##
  7. ## SSL Global Context
  8. ##
  9. ## All SSL configuration in this context applies both to
  10. ## the main server and all SSL-enabled virtual hosts.
  11. ##
  12. # Pass Phrase Dialog:
  13. # Configure the pass phrase gathering process.
  14. # The filtering dialog program (`builtin' is a internal
  15. # terminal dialog) has to provide the pass phrase on stdout.
  16. SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
  17. # Inter-Process Session Cache:
  18. # Configure the SSL Session Cache: First the mechanism
  19. # to use and second the expiring timeout (in seconds).
  20. SSLSessionCache shmcb:/run/httpd/sslcache(512000)
  21. SSLSessionCacheTimeout 300
  22. # Pseudo Random Number Generator (PRNG):
  23. # Configure one or more sources to seed the PRNG of the
  24. # SSL library. The seed data should be of good random quality.
  25. # WARNING! On some platforms /dev/random blocks if not enough entropy
  26. # is available. This means you then cannot use the /dev/random device
  27. # because it would lead to very long connection times (as long as
  28. # it requires to make more entropy available). But usually those
  29. # platforms additionally provide a /dev/urandom device which doesn't
  30. # block. So, if available, use this one instead. Read the mod_ssl User
  31. # Manual for more details.
  32. SSLRandomSeed startup file:/dev/urandom 256
  33. SSLRandomSeed connect builtin
  34. #SSLRandomSeed startup file:/dev/random 512
  35. #SSLRandomSeed connect file:/dev/random 512
  36. #SSLRandomSeed connect file:/dev/urandom 512
  37. #
  38. # Use "SSLCryptoDevice" to enable any supported hardware
  39. # accelerators. Use "openssl engine -v" to list supported
  40. # engine names. NOTE: If you enable an accelerator and the
  41. # server does not start, consult the error logs and ensure
  42. # your accelerator is functioning properly.
  43. #
  44. SSLCryptoDevice builtin
  45. #SSLCryptoDevice ubsec
  46. ##
  47. ## SSL Virtual Host Context
  48. ##
  49. <VirtualHost _default_:443>
  50. # General setup for the virtual host, inherited from global configuration
  51. #DocumentRoot "/var/www/html"
  52. #ServerName www.example.com:443
  53. # Use separate log files for the SSL virtual host; note that LogLevel
  54. # is not inherited from httpd.conf.
  55. ErrorLog logs/ssl_error_log
  56. TransferLog logs/ssl_access_log
  57. LogLevel warn
  58. # SSL Engine Switch:
  59. # Enable/Disable SSL for this virtual host.
  60. SSLEngine on
  61. # SSL Protocol support:
  62. # List the enable protocol levels with which clients will be able to
  63. # connect. Disable SSLv2 access by default:
  64. SSLProtocol all -SSLv2 -SSLv3
  65. # SSL Cipher Suite:
  66. # List the ciphers that the client is permitted to negotiate.
  67. # See the mod_ssl documentation for a complete list.
  68. SSLCipherSuite HIGH:3DES:!aNULL:!MD5:!SEED:!IDEA
  69. # Speed-optimized SSL Cipher configuration:
  70. # If speed is your main concern (on busy HTTPS servers e.g.),
  71. # you might want to force clients to specific, performance
  72. # optimized ciphers. In this case, prepend those ciphers
  73. # to the SSLCipherSuite list, and enable SSLHonorCipherOrder.
  74. # Caveat: by giving precedence to RC4-SHA and AES128-SHA
  75. # (as in the example below), most connections will no longer
  76. # have perfect forward secrecy - if the server's key is
  77. # compromised, captures of past or future traffic must be
  78. # considered compromised, too.
  79. #SSLCipherSuite RC4-SHA:AES128-SHA:HIGH:MEDIUM:!aNULL:!MD5
  80. #SSLHonorCipherOrder on
  81. # Server Certificate:
  82. # Point SSLCertificateFile at a PEM encoded certificate. If
  83. # the certificate is encrypted, then you will be prompted for a
  84. # pass phrase. Note that a kill -HUP will prompt again. A new
  85. # certificate can be generated using the genkey(1) command.
  86. SSLCertificateFile /etc/pki/tls/certs/localhost.crt
  87. # Server Private Key:
  88. # If the key is not combined with the certificate, use this
  89. # directive to point at the key file. Keep in mind that if
  90. # you've both a RSA and a DSA private key you can configure
  91. # both in parallel (to also allow the use of DSA ciphers, etc.)
  92. SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
  93. # Server Certificate Chain:
  94. # Point SSLCertificateChainFile at a file containing the
  95. # concatenation of PEM encoded CA certificates which form the
  96. # certificate chain for the server certificate. Alternatively
  97. # the referenced file can be the same as SSLCertificateFile
  98. # when the CA certificates are directly appended to the server
  99. # certificate for convinience.
  100. #SSLCertificateChainFile /etc/pki/tls/certs/server-chain.crt
  101. # Certificate Authority (CA):
  102. # Set the CA certificate verification path where to find CA
  103. # certificates for client authentication or alternatively one
  104. # huge file containing all of them (file must be PEM encoded)
  105. #SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
  106. # Client Authentication (Type):
  107. # Client certificate verification type and depth. Types are
  108. # none, optional, require and optional_no_ca. Depth is a
  109. # number which specifies how deeply to verify the certificate
  110. # issuer chain before deciding the certificate is not valid.
  111. #SSLVerifyClient require
  112. #SSLVerifyDepth 10
  113. # Access Control:
  114. # With SSLRequire you can do per-directory access control based
  115. # on arbitrary complex boolean expressions containing server
  116. # variable checks and other lookup directives. The syntax is a
  117. # mixture between C and Perl. See the mod_ssl documentation
  118. # for more details.
  119. #<Location />
  120. #SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
  121. # and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
  122. # and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
  123. # and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
  124. # and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
  125. # or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
  126. #</Location>
  127. # SSL Engine Options:
  128. # Set various options for the SSL engine.
  129. # o FakeBasicAuth:
  130. # Translate the client X.509 into a Basic Authorisation. This means that
  131. # the standard Auth/DBMAuth methods can be used for access control. The
  132. # user name is the `one line' version of the client's X.509 certificate.
  133. # Note that no password is obtained from the user. Every entry in the user
  134. # file needs this password: `xxj31ZMTZzkVA'.
  135. # o ExportCertData:
  136. # This exports two additional environment variables: SSL_CLIENT_CERT and
  137. # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
  138. # server (always existing) and the client (only existing when client
  139. # authentication is used). This can be used to import the certificates
  140. # into CGI scripts.
  141. # o StdEnvVars:
  142. # This exports the standard SSL/TLS related `SSL_*' environment variables.
  143. # Per default this exportation is switched off for performance reasons,
  144. # because the extraction step is an expensive operation and is usually
  145. # useless for serving static content. So one usually enables the
  146. # exportation for CGI and SSI requests only.
  147. # o StrictRequire:
  148. # This denies access when "SSLRequireSSL" or "SSLRequire" applied even
  149. # under a "Satisfy any" situation, i.e. when it applies access is denied
  150. # and no other module can change it.
  151. # o OptRenegotiate:
  152. # This enables optimized SSL connection renegotiation handling when SSL
  153. # directives are used in per-directory context.
  154. #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
  155. <Files ~ "\.(cgi|shtml|phtml|php3?)$">
  156. SSLOptions +StdEnvVars
  157. </Files>
  158. <Directory "/var/www/cgi-bin">
  159. SSLOptions +StdEnvVars
  160. </Directory>
  161. # SSL Protocol Adjustments:
  162. # The safe and default but still SSL/TLS standard compliant shutdown
  163. # approach is that mod_ssl sends the close notify alert but doesn't wait for
  164. # the close notify alert from client. When you need a different shutdown
  165. # approach you can use one of the following variables:
  166. # o ssl-unclean-shutdown:
  167. # This forces an unclean shutdown when the connection is closed, i.e. no
  168. # SSL close notify alert is send or allowed to received. This violates
  169. # the SSL/TLS standard but is needed for some brain-dead browsers. Use
  170. # this when you receive I/O errors because of the standard approach where
  171. # mod_ssl sends the close notify alert.
  172. # o ssl-accurate-shutdown:
  173. # This forces an accurate shutdown when the connection is closed, i.e. a
  174. # SSL close notify alert is send and mod_ssl waits for the close notify
  175. # alert of the client. This is 100% SSL/TLS standard compliant, but in
  176. # practice often causes hanging connections with brain-dead browsers. Use
  177. # this only for browsers where you know that their SSL implementation
  178. # works correctly.
  179. # Notice: Most problems of broken clients are also related to the HTTP
  180. # keep-alive facility, so you usually additionally want to disable
  181. # keep-alive for those clients, too. Use variable "nokeepalive" for this.
  182. # Similarly, one has to force some clients to use HTTP/1.0 to workaround
  183. # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
  184. # "force-response-1.0" for this.
  185. BrowserMatch "MSIE [2-5]" \
  186. nokeepalive ssl-unclean-shutdown \
  187. downgrade-1.0 force-response-1.0
  188. # Per-Server Logging:
  189. # The home of a custom SSL log file. Use this when you want a
  190. # compact non-error SSL logfile on a virtual host basis.
  191. CustomLog logs/ssl_request_log \
  192. "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
  193. SuexecUserGroup apache apache
  194. <Proxy "unix:/var/opt/remi/php81/run/php-fpm/www.sock|fcgi://php-fpm">
  195. ProxySet disablereuse=off
  196. </Proxy>
  197. <FilesMatch \.php$>
  198. SetHandler proxy:fcgi://php-fpm
  199. </FilesMatch>
  200. </VirtualHost>