41_mod_ssl.default-vhost.conf 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <IfDefine SSL>
  2. # We now wrap the entire default vhost in a seperate IfDefine to fix bug
  3. # 100624. If you are using this default vhost, add it to /etc/conf.d/apache2
  4. <IfDefine SSL_DEFAULT_VHOST>
  5. <IfModule mod_ssl.c>
  6. ##
  7. ## SSL Virtual Host Context
  8. ##
  9. <VirtualHost _default_:443>
  10. # General setup for the virtual host
  11. DocumentRoot "/var/www/localhost/htdocs"
  12. ServerName localhost:443
  13. ServerAdmin root@localhost
  14. ErrorLog logs/ssl_error_log
  15. <IfModule mod_log_config.c>
  16. TransferLog logs/ssl_access_log
  17. </IfModule>
  18. # SSL Engine Switch:
  19. # Enable/Disable SSL for this virtual host.
  20. SSLEngine on
  21. # SSL Cipher Suite:
  22. # List the ciphers that the client is permitted to negotiate.
  23. # See the mod_ssl documentation for a complete list.
  24. SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
  25. # Server Certificate:
  26. # Point SSLCertificateFile at a PEM encoded certificate. If
  27. # the certificate is encrypted, then you will be prompted for a
  28. # pass phrase. Note that a kill -HUP will prompt again. A test
  29. # certificate can be generated with `make certificate' under
  30. # built time. Keep in mind that if you've both a RSA and a DSA
  31. # certificate you can configure both in parallel (to also allow
  32. # the use of DSA ciphers, etc.)
  33. SSLCertificateFile conf/ssl/server.crt
  34. # Server Private Key:
  35. # If the key is not combined with the certificate, use this
  36. # directive to point at the key file. Keep in mind that if
  37. # you've both a RSA and a DSA private key you can configure
  38. # both in parallel (to also allow the use of DSA ciphers, etc.)
  39. SSLCertificateKeyFile conf/ssl/server.key
  40. # Server Certificate Chain:
  41. # Point SSLCertificateChainFile at a file containing the
  42. # concatenation of PEM encoded CA certificates which form the
  43. # certificate chain for the server certificate. Alternatively
  44. # the referenced file can be the same as SSLCertificateFile
  45. # when the CA certificates are directly appended to the server
  46. # certificate for convinience.
  47. #SSLCertificateChainFile conf/ssl/ca.crt
  48. # Certificate Authority (CA):
  49. # Set the CA certificate verification path where to find CA
  50. # certificates for client authentication or alternatively one
  51. # huge file containing all of them (file must be PEM encoded)
  52. # Note: Inside SSLCACertificatePath you need hash symlinks
  53. # to point to the certificate files. Use the provided
  54. # Makefile to update the hash symlinks after changes.
  55. #SSLCACertificatePath conf/ssl/ssl.crt
  56. #SSLCACertificateFile conf/ssl/ca-bundle.crt
  57. # Certificate Revocation Lists (CRL):
  58. # Set the CA revocation path where to find CA CRLs for client
  59. # authentication or alternatively one huge file containing all
  60. # of them (file must be PEM encoded)
  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 conf/ssl/ssl.crl
  65. #SSLCARevocationFile conf/ssl/ca-bundle.crl
  66. # Client Authentication (Type):
  67. # Client certificate verification type and depth. Types are
  68. # none, optional, require and optional_no_ca. Depth is a
  69. # number which specifies how deeply to verify the certificate
  70. # issuer chain before deciding the certificate is not valid.
  71. #SSLVerifyClient require
  72. #SSLVerifyDepth 10
  73. # Access Control:
  74. # With SSLRequire you can do per-directory access control based
  75. # on arbitrary complex boolean expressions containing server
  76. # variable checks and other lookup directives. The syntax is a
  77. # mixture between C and Perl. See the mod_ssl documentation
  78. # for more details.
  79. #<Location />
  80. #SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
  81. # and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
  82. # and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
  83. # and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
  84. # and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
  85. # or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
  86. #</Location>
  87. # SSL Engine Options:
  88. # Set various options for the SSL engine.
  89. # o FakeBasicAuth:
  90. # Translate the client X.509 into a Basic Authorisation. This means that
  91. # the standard Auth/DBMAuth methods can be used for access control. The
  92. # user name is the `one line' version of the client's X.509 certificate.
  93. # Note that no password is obtained from the user. Every entry in the user
  94. # file needs this password: `xxj31ZMTZzkVA'.
  95. # o ExportCertData:
  96. # This exports two additional environment variables: SSL_CLIENT_CERT and
  97. # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
  98. # server (always existing) and the client (only existing when client
  99. # authentication is used). This can be used to import the certificates
  100. # into CGI scripts.
  101. # o StdEnvVars:
  102. # This exports the standard SSL/TLS related `SSL_*' environment variables.
  103. # Per default this exportation is switched off for performance reasons,
  104. # because the extraction step is an expensive operation and is usually
  105. # useless for serving static content. So one usually enables the
  106. # exportation for CGI and SSI requests only.
  107. # o CompatEnvVars:
  108. # This exports obsolete environment variables for backward compatibility
  109. # to Apache-SSL 1.x, mod_ssl 2.0.x, Sioux 1.0 and Stronghold 2.x. Use this
  110. # to provide compatibility to existing CGI scripts.
  111. # o StrictRequire:
  112. # This denies access when "SSLRequireSSL" or "SSLRequire" applied even
  113. # under a "Satisfy any" situation, i.e. when it applies access is denied
  114. # and no other module can change it.
  115. # o OptRenegotiate:
  116. # This enables optimized SSL connection renegotiation handling when SSL
  117. # directives are used in per-directory context.
  118. #SSLOptions +FakeBasicAuth +ExportCertData +CompatEnvVars +StrictRequire
  119. <Files ~ "\.(cgi|shtml|phtml|php?)$">
  120. SSLOptions +StdEnvVars
  121. </Files>
  122. <Directory "/var/www/localhost/cgi-bin">
  123. SSLOptions +StdEnvVars
  124. </Directory>
  125. # SSL Protocol Adjustments:
  126. # The safe and default but still SSL/TLS standard compliant shutdown
  127. # approach is that mod_ssl sends the close notify alert but doesn't wait for
  128. # the close notify alert from client. When you need a different shutdown
  129. # approach you can use one of the following variables:
  130. # o ssl-unclean-shutdown:
  131. # This forces an unclean shutdown when the connection is closed, i.e. no
  132. # SSL close notify alert is send or allowed to received. This violates
  133. # the SSL/TLS standard but is needed for some brain-dead browsers. Use
  134. # this when you receive I/O errors because of the standard approach where
  135. # mod_ssl sends the close notify alert.
  136. # o ssl-accurate-shutdown:
  137. # This forces an accurate shutdown when the connection is closed, i.e. a
  138. # SSL close notify alert is send and mod_ssl waits for the close notify
  139. # alert of the client. This is 100% SSL/TLS standard compliant, but in
  140. # practice often causes hanging connections with brain-dead browsers. Use
  141. # this only for browsers where you know that their SSL implementation
  142. # works correctly.
  143. # Notice: Most problems of broken clients are also related to the HTTP
  144. # keep-alive facility, so you usually additionally want to disable
  145. # keep-alive for those clients, too. Use variable "nokeepalive" for this.
  146. # Similarly, one has to force some clients to use HTTP/1.0 to workaround
  147. # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
  148. # "force-response-1.0" for this.
  149. <IfModule mod_setenvif.c>
  150. SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown \
  151. downgrade-1.0 force-response-1.0
  152. </IfModule>
  153. # Per-Server Logging:
  154. # The home of a custom SSL log file. Use this when you want a
  155. # compact non-error SSL logfile on a virtual host basis.
  156. <IfModule mod_log_config.c>
  157. CustomLog logs/ssl_request_log \
  158. "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
  159. </IfModule>
  160. <IfModule mod_rewrite.c>
  161. RewriteEngine On
  162. RewriteOptions inherit
  163. </IfModule>
  164. </VirtualHost>
  165. </IfModule>
  166. </IfDefine>
  167. </IfDefine>