001-default-ssl.conf 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <VirtualHost _default_:443>
  2. # General setup for the virtual host
  3. #ServerName www.example.com:443
  4. ServerAdmin webmaster@localhost
  5. DocumentRoot "/srv/www/apache"
  6. <Directory "/srv/www/apache">
  7. Options Indexes FollowSymLinks
  8. AllowOverride None
  9. Require all granted
  10. </Directory>
  11. ErrorLog ${APACHE_LOG_DIR}/001-default-ssl.error.log
  12. CustomLog ${APACHE_LOG_DIR}/001-default-ssl.access.log combined
  13. <IfModule http2_module>
  14. Protocols h2 http/1.1
  15. </IfModule>
  16. # SSL Engine Switch:
  17. # Enable/Disable SSL for this virtual host.
  18. SSLEngine on
  19. # Server Certificate:
  20. # Point SSLCertificateFile at a PEM encoded certificate. If
  21. # the certificate is encrypted, then you will be prompted for a
  22. # pass phrase. Note that a kill -HUP will prompt again. Keep
  23. # in mind that if you have both an RSA and a DSA certificate you
  24. # can configure both in parallel (to also allow the use of DSA
  25. # ciphers, etc.)
  26. # Some ECC cipher suites (http://www.ietf.org/rfc/rfc4492.txt)
  27. # require an ECC certificate which can also be configured in
  28. # parallel.
  29. SSLCertificateFile "/etc/apache/server.crt"
  30. #SSLCertificateFile "/etc/apache/server-dsa.crt"
  31. #SSLCertificateFile "/etc/apache/server-ecc.crt"
  32. # Server Private Key:
  33. # If the key is not combined with the certificate, use this
  34. # directive to point at the key file. Keep in mind that if
  35. # you've both a RSA and a DSA private key you can configure
  36. # both in parallel (to also allow the use of DSA ciphers, etc.)
  37. # ECC keys, when in use, can also be configured in parallel
  38. SSLCertificateKeyFile "/etc/apache/server.key"
  39. #SSLCertificateKeyFile "/etc/apache/server-dsa.key"
  40. #SSLCertificateKeyFile "/etc/apache/server-ecc.key"
  41. # Server Certificate Chain:
  42. # Point SSLCertificateChainFile at a file containing the
  43. # concatenation of PEM encoded CA certificates which form the
  44. # certificate chain for the server certificate. Alternatively
  45. # the referenced file can be the same as SSLCertificateFile
  46. # when the CA certificates are directly appended to the server
  47. # certificate for convenience.
  48. #SSLCertificateChainFile "/etc/apache/server-ca.crt"
  49. # Certificate Authority (CA):
  50. # Set the CA certificate verification path where to find CA
  51. # certificates for client authentication or alternatively one
  52. # huge file containing all of them (file must be PEM encoded)
  53. # Note: Inside SSLCACertificatePath you need hash symlinks
  54. # to point to the certificate files. Use the provided
  55. # Makefile to update the hash symlinks after changes.
  56. #SSLCACertificatePath "/etc/apache/ssl.crt"
  57. #SSLCACertificateFile "/etc/apache/ssl.crt/ca-bundle.crt"
  58. # Certificate Revocation Lists (CRL):
  59. # Set the CA revocation path where to find CA CRLs for client
  60. # authentication or alternatively one huge file containing all
  61. # of them (file must be PEM encoded).
  62. # The CRL checking mode needs to be configured explicitly
  63. # through SSLCARevocationCheck (defaults to "none" otherwise).
  64. # Note: Inside SSLCARevocationPath you need hash symlinks
  65. # to point to the certificate files. Use the provided
  66. # Makefile to update the hash symlinks after changes.
  67. #SSLCARevocationPath "/etc/apache/ssl.crl"
  68. #SSLCARevocationFile "/etc/apache/ssl.crl/ca-bundle.crl"
  69. #SSLCARevocationCheck chain
  70. # Client Authentication (Type):
  71. # Client certificate verification type and depth. Types are
  72. # none, optional, require and optional_no_ca. Depth is a
  73. # number which specifies how deeply to verify the certificate
  74. # issuer chain before deciding the certificate is not valid.
  75. #SSLVerifyClient require
  76. #SSLVerifyDepth 10
  77. # TLS-SRP mutual authentication:
  78. # Enable TLS-SRP and set the path to the OpenSSL SRP verifier
  79. # file (containing login information for SRP user accounts).
  80. # Requires OpenSSL 1.0.1 or newer. See the mod_ssl FAQ for
  81. # detailed instructions on creating this file. Example:
  82. # "openssl srp -srpvfile /etc/apache/passwd.srpv -add username"
  83. #SSLSRPVerifierFile "/etc/apache/passwd.srpv"
  84. # Access Control:
  85. # With SSLRequire you can do per-directory access control based
  86. # on arbitrary complex boolean expressions containing server
  87. # variable checks and other lookup directives. The syntax is a
  88. # mixture between C and Perl. See the mod_ssl documentation
  89. # for more details.
  90. #<Location />
  91. #SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
  92. # and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
  93. # and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
  94. # and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
  95. # and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
  96. # or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
  97. #</Location>
  98. # SSL Engine Options:
  99. # Set various options for the SSL engine.
  100. # o FakeBasicAuth:
  101. # Translate the client X.509 into a Basic Authorisation. This means that
  102. # the standard Auth/DBMAuth methods can be used for access control. The
  103. # user name is the `one line' version of the client's X.509 certificate.
  104. # Note that no password is obtained from the user. Every entry in the user
  105. # file needs this password: `xxj31ZMTZzkVA'.
  106. # o ExportCertData:
  107. # This exports two additional environment variables: SSL_CLIENT_CERT and
  108. # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
  109. # server (always existing) and the client (only existing when client
  110. # authentication is used). This can be used to import the certificates
  111. # into CGI scripts.
  112. # o StdEnvVars:
  113. # This exports the standard SSL/TLS related `SSL_*' environment variables.
  114. # Per default this exportation is switched off for performance reasons,
  115. # because the extraction step is an expensive operation and is usually
  116. # useless for serving static content. So one usually enables the
  117. # exportation for CGI and SSI requests only.
  118. # o StrictRequire:
  119. # This denies access when "SSLRequireSSL" or "SSLRequire" applied even
  120. # under a "Satisfy any" situation, i.e. when it applies access is denied
  121. # and no other module can change it.
  122. # o OptRenegotiate:
  123. # This enables optimized SSL connection renegotiation handling when SSL
  124. # directives are used in per-directory context.
  125. #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
  126. <FilesMatch "\.(cgi|shtml|phtml|php)$">
  127. SSLOptions +StdEnvVars
  128. </FilesMatch>
  129. <Directory "/srv/www/apache/cgi-bin">
  130. SSLOptions +StdEnvVars
  131. </Directory>
  132. # SSL Protocol Adjustments:
  133. # The safe and default but still SSL/TLS standard compliant shutdown
  134. # approach is that mod_ssl sends the close notify alert but doesn't wait for
  135. # the close notify alert from client. When you need a different shutdown
  136. # approach you can use one of the following variables:
  137. # o ssl-unclean-shutdown:
  138. # This forces an unclean shutdown when the connection is closed, i.e. no
  139. # SSL close notify alert is sent or allowed to be received. This violates
  140. # the SSL/TLS standard but is needed for some brain-dead browsers. Use
  141. # this when you receive I/O errors because of the standard approach where
  142. # mod_ssl sends the close notify alert.
  143. # o ssl-accurate-shutdown:
  144. # This forces an accurate shutdown when the connection is closed, i.e. a
  145. # SSL close notify alert is send and mod_ssl waits for the close notify
  146. # alert of the client. This is 100% SSL/TLS standard compliant, but in
  147. # practice often causes hanging connections with brain-dead browsers. Use
  148. # this only for browsers where you know that their SSL implementation
  149. # works correctly.
  150. # Notice: Most problems of broken clients are also related to the HTTP
  151. # keep-alive facility, so you usually additionally want to disable
  152. # keep-alive for those clients, too. Use variable "nokeepalive" for this.
  153. # Similarly, one has to force some clients to use HTTP/1.0 to workaround
  154. # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
  155. # "force-response-1.0" for this.
  156. BrowserMatch "MSIE [2-5]" \
  157. nokeepalive ssl-unclean-shutdown \
  158. downgrade-1.0 force-response-1.0
  159. # Per-Server Logging:
  160. # The home of a custom SSL log file. Use this when you want a
  161. # compact non-error SSL logfile on a virtual host basis.
  162. CustomLog "/var/log/httpd/ssl_request_log" \
  163. "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
  164. </VirtualHost>
  165. # vim: syntax=apache ts=4 sw=4 sts=4 sr noet