Advertisement
Guest User

/etc/apache2/vhosts.d/00_default_ssl_vhost.conf

a guest
Jan 11th, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.78 KB | None | 0 0
  1. cat /etc/apache2/vhosts.d/00_default_ssl_vhost.conf
  2. <IfDefine SSL>
  3. <IfDefine SSL_DEFAULT_VHOST>
  4. <IfModule ssl_module>
  5. # see bug #178966 why this is in here
  6.  
  7. # When we also provide SSL we have to listen to the HTTPS port
  8. # Note: Configurations that use IPv6 but not IPv4-mapped addresses need two
  9. # Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"
  10. Listen 443
  11.  
  12. <VirtualHost _default_:443>
  13. ServerName gentoohost
  14. Include /etc/apache2/vhosts.d/default_vhost.include
  15. ErrorLog /var/log/apache2/ssl_error_log
  16.  
  17. <IfModule log_config_module>
  18. TransferLog /var/log/apache2/ssl_access_log
  19. </IfModule>
  20.  
  21. ## SSL Engine Switch:
  22. # Enable/Disable SSL for this virtual host.
  23. SSLEngine on
  24.  
  25. ## SSLProtocol:
  26. # Don't use SSLv2 anymore as it's considered to be broken security-wise.
  27. # Also disable SSLv3 as most modern browsers are capable of TLS.
  28. SSLProtocol ALL -SSLv2 -SSLv3
  29.  
  30. ## SSL Cipher Suite:
  31. # List the ciphers that the client is permitted to negotiate.
  32. # See the mod_ssl documentation for a complete list.
  33. # This list of ciphers is recommended by mozilla and was stripped off
  34. # its RC4 ciphers. (bug #506924)
  35. SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128:AES256:HIGH:!RC4:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK
  36.  
  37. ## SSLHonorCipherOrder:
  38. # Prefer the server's cipher preference order as the client may have a
  39. # weak default order.
  40. SSLHonorCipherOrder On
  41.  
  42. ## Server Certificate:
  43. # Point SSLCertificateFile at a PEM encoded certificate. If the certificate
  44. # is encrypted, then you will be prompted for a pass phrase. Note that a
  45. # kill -HUP will prompt again. Keep in mind that if you have both an RSA
  46. # and a DSA certificate you can configure both in parallel (to also allow
  47. # the use of DSA ciphers, etc.)
  48. SSLCertificateFile /etc/ssl/apache2/server.crt
  49.  
  50. ## Server Private Key:
  51. # If the key is not combined with the certificate, use this directive to
  52. # point at the key file. Keep in mind that if you've both a RSA and a DSA
  53. # private key you can configure both in parallel (to also allow the use of
  54. # DSA ciphers, etc.)
  55. SSLCertificateKeyFile /etc/ssl/apache2/server.key
  56.  
  57. ## Server Certificate Chain:
  58. # Point SSLCertificateChainFile at a file containing the concatenation of
  59. # PEM encoded CA certificates which form the certificate chain for the
  60. # server certificate. Alternatively the referenced file can be the same as
  61. # SSLCertificateFile when the CA certificates are directly appended to the
  62. # server certificate for convinience.
  63. #SSLCertificateChainFile /etc/ssl/apache2/ca.crt
  64.  
  65. ## Certificate Authority (CA):
  66. # Set the CA certificate verification path where to find CA certificates
  67. # for client authentication or alternatively one huge file containing all
  68. # of them (file must be PEM encoded).
  69. # Note: Inside SSLCACertificatePath you need hash symlinks to point to the
  70. # certificate files. Use the provided Makefile to update the hash symlinks
  71. # after changes.
  72. #SSLCACertificatePath /etc/ssl/apache2/ssl.crt
  73. #SSLCACertificateFile /etc/ssl/apache2/ca-bundle.crt
  74.  
  75. ## Certificate Revocation Lists (CRL):
  76. # Set the CA revocation path where to find CA CRLs for client authentication
  77. # or alternatively one huge file containing all of them (file must be PEM
  78. # encoded).
  79. # Note: Inside SSLCARevocationPath you need hash symlinks to point to the
  80. # certificate files. Use the provided Makefile to update the hash symlinks
  81. # after changes.
  82. #SSLCARevocationPath /etc/ssl/apache2/ssl.crl
  83. #SSLCARevocationFile /etc/ssl/apache2/ca-bundle.crl
  84.  
  85. ## Client Authentication (Type):
  86. # Client certificate verification type and depth. Types are none, optional,
  87. # require and optional_no_ca. Depth is a number which specifies how deeply
  88. # to verify the certificate issuer chain before deciding the certificate is
  89. # not valid.
  90. #SSLVerifyClient require
  91. #SSLVerifyDepth 10
  92.  
  93. ## Access Control:
  94. # With SSLRequire you can do per-directory access control based on arbitrary
  95. # complex boolean expressions containing server variable checks and other
  96. # lookup directives. The syntax is a mixture between C and Perl. See the
  97. # mod_ssl documentation for more details.
  98. #<Location />
  99. # #SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
  100. # and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
  101. # and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
  102. # and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
  103. # and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
  104. # or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
  105. #</Location>
  106.  
  107. ## SSL Engine Options:
  108. # Set various options for the SSL engine.
  109.  
  110. ## FakeBasicAuth:
  111. # Translate the client X.509 into a Basic Authorisation. This means that the
  112. # standard Auth/DBMAuth methods can be used for access control. The user
  113. # name is the `one line' version of the client's X.509 certificate.
  114. # Note that no password is obtained from the user. Every entry in the user
  115. # file needs this password: `xxj31ZMTZzkVA'.
  116.  
  117. ## ExportCertData:
  118. # This exports two additional environment variables: SSL_CLIENT_CERT and
  119. # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the server
  120. # (always existing) and the client (only existing when client
  121. # authentication is used). This can be used to import the certificates into
  122. # CGI scripts.
  123.  
  124. ## StdEnvVars:
  125. # This exports the standard SSL/TLS related `SSL_*' environment variables.
  126. # Per default this exportation is switched off for performance reasons,
  127. # because the extraction step is an expensive operation and is usually
  128. # useless for serving static content. So one usually enables the exportation
  129. # for CGI and SSI requests only.
  130.  
  131. ## StrictRequire:
  132. # This denies access when "SSLRequireSSL" or "SSLRequire" applied even under
  133. # a "Satisfy any" situation, i.e. when it applies access is denied and no
  134. # other module can change it.
  135.  
  136. ## OptRenegotiate:
  137. # This enables optimized SSL connection renegotiation handling when SSL
  138. # directives are used in per-directory context.
  139. #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
  140. <FilesMatch "\.(cgi|shtml|phtml|php)$">
  141. SSLOptions +StdEnvVars
  142. </FilesMatch>
  143.  
  144. <Directory "/var/www/localhost/cgi-bin">
  145. SSLOptions +StdEnvVars
  146. </Directory>
  147.  
  148. ## SSL Protocol Adjustments:
  149. # The safe and default but still SSL/TLS standard compliant shutdown
  150. # approach is that mod_ssl sends the close notify alert but doesn't wait
  151. # for the close notify alert from client. When you need a different
  152. # shutdown approach you can use one of the following variables:
  153.  
  154. ## ssl-unclean-shutdown:
  155. # This forces an unclean shutdown when the connection is closed, i.e. no
  156. # SSL close notify alert is send or allowed to received. This violates the
  157. # SSL/TLS standard but is needed for some brain-dead browsers. Use this when
  158. # you receive I/O errors because of the standard approach where mod_ssl
  159. # sends the close notify alert.
  160.  
  161. ## ssl-accurate-shutdown:
  162. # This forces an accurate shutdown when the connection is closed, i.e. a
  163. # SSL close notify alert is send and mod_ssl waits for the close notify
  164. # alert of the client. This is 100% SSL/TLS standard compliant, but in
  165. # practice often causes hanging connections with brain-dead browsers. Use
  166. # this only for browsers where you know that their SSL implementation works
  167. # correctly.
  168. # Notice: Most problems of broken clients are also related to the HTTP
  169. # keep-alive facility, so you usually additionally want to disable
  170. # keep-alive for those clients, too. Use variable "nokeepalive" for this.
  171. # Similarly, one has to force some clients to use HTTP/1.0 to workaround
  172. # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
  173. # "force-response-1.0" for this.
  174. <IfModule setenvif_module>
  175. BrowserMatch ".*MSIE.*" \
  176. nokeepalive ssl-unclean-shutdown \
  177. downgrade-1.0 force-response-1.0
  178. </IfModule>
  179.  
  180. ## Per-Server Logging:
  181. # The home of a custom SSL log file. Use this when you want a compact
  182. # non-error SSL logfile on a virtual host basis.
  183. <IfModule log_config_module>
  184. CustomLog /var/log/apache2/ssl_request_log \
  185. "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
  186. </IfModule>
  187. </VirtualHost>
  188. </IfModule>
  189. </IfDefine>
  190. </IfDefine>
  191.  
  192. # vim: ts=4 filetype=apache
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement