001-default-ssl.conf 8.3 KB

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