Advertisement
MinasFilm

default-ssl

Dec 19th, 2013
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <IfModule mod_ssl.c>
  2. <VirtualHost _default_:443>
  3.     ServerAdmin webmaster@localhost
  4.  
  5.     DocumentRoot /home/maestro/Документы/Programs/web/base
  6.     <Directory /home/maestro/Документы/Programs/web/base/>
  7.         Options -Indexes +FollowSymLinks MultiViews
  8.         AllowOverride all
  9.         Order allow,deny
  10.         deny from all
  11.     </Directory>
  12.  
  13.     ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  14.     <Directory "/usr/lib/cgi-bin">
  15.         AllowOverride All
  16.         Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  17.         Order allow,deny
  18.         Allow from all
  19.     </Directory>
  20.  
  21.     ErrorLog ${APACHE_LOG_DIR}/error.log
  22.  
  23.     # Possible values include: debug, info, notice, warn, error, crit,
  24.     # alert, emerg.
  25.     LogLevel warn
  26.  
  27.     CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
  28.  
  29.     Alias /doc/ "/usr/share/doc/"
  30.     <Directory "/usr/share/doc/">
  31.         Options Indexes MultiViews FollowSymLinks
  32.         AllowOverride None
  33.         Order deny,allow
  34.         Deny from all
  35.         Allow from 127.0.0.0/255.0.0.0 ::1/128
  36.     </Directory>
  37.  
  38.     #   SSL Engine Switch:
  39.     #   Enable/Disable SSL for this virtual host.
  40.     SSLEngine on
  41.  
  42.     #   A self-signed (snakeoil) certificate can be created by installing
  43.     #   the ssl-cert package. See
  44.     #   /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
  45.     #   If both key and certificate are stored in the same file, only the
  46.     #   SSLCertificateFile directive is needed.
  47.     SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
  48.     SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
  49.  
  50.     #   Server Certificate Chain:
  51.     #   Point SSLCertificateChainFile at a file containing the
  52.     #   concatenation of PEM encoded CA certificates which form the
  53.     #   certificate chain for the server certificate. Alternatively
  54.     #   the referenced file can be the same as SSLCertificateFile
  55.     #   when the CA certificates are directly appended to the server
  56.     #   certificate for convinience.
  57.     #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
  58.  
  59.     #   Certificate Authority (CA):
  60.     #   Set the CA certificate verification path where to find CA
  61.     #   certificates for client authentication or alternatively one
  62.     #   huge file containing all of them (file must be PEM encoded)
  63.     #   Note: Inside SSLCACertificatePath you need hash symlinks
  64.     #         to point to the certificate files. Use the provided
  65.     #         Makefile to update the hash symlinks after changes.
  66.     #SSLCACertificatePath /etc/ssl/certs/
  67.     #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
  68.  
  69.     #   Certificate Revocation Lists (CRL):
  70.     #   Set the CA revocation path where to find CA CRLs for client
  71.     #   authentication or alternatively one huge file containing all
  72.     #   of them (file must be PEM encoded)
  73.     #   Note: Inside SSLCARevocationPath you need hash symlinks
  74.     #         to point to the certificate files. Use the provided
  75.     #         Makefile to update the hash symlinks after changes.
  76.     #SSLCARevocationPath /etc/apache2/ssl.crl/
  77.     #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
  78.  
  79.     #   Client Authentication (Type):
  80.     #   Client certificate verification type and depth.  Types are
  81.     #   none, optional, require and optional_no_ca.  Depth is a
  82.     #   number which specifies how deeply to verify the certificate
  83.     #   issuer chain before deciding the certificate is not valid.
  84.     #SSLVerifyClient require
  85.     #SSLVerifyDepth  10
  86.  
  87.     #   Access Control:
  88.     #   With SSLRequire you can do per-directory access control based
  89.     #   on arbitrary complex boolean expressions containing server
  90.     #   variable checks and other lookup directives.  The syntax is a
  91.     #   mixture between C and Perl.  See the mod_ssl documentation
  92.     #   for more details.
  93.     #<Location />
  94.     #SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
  95.     #            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
  96.     #            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
  97.     #            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
  98.     #            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \
  99.     #           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
  100.     #</Location>
  101.  
  102.     #   SSL Engine Options:
  103.     #   Set various options for the SSL engine.
  104.     #   o FakeBasicAuth:
  105.     #     Translate the client X.509 into a Basic Authorisation.  This means that
  106.     #     the standard Auth/DBMAuth methods can be used for access control.  The
  107.     #     user name is the `one line' version of the client's X.509 certificate.
  108.     #     Note that no password is obtained from the user. Every entry in the user
  109.     #     file needs this password: `xxj31ZMTZzkVA'.
  110.     #   o ExportCertData:
  111.     #     This exports two additional environment variables: SSL_CLIENT_CERT and
  112.     #     SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
  113.     #     server (always existing) and the client (only existing when client
  114.     #     authentication is used). This can be used to import the certificates
  115.     #     into CGI scripts.
  116.     #   o StdEnvVars:
  117.     #     This exports the standard SSL/TLS related `SSL_*' environment variables.
  118.     #     Per default this exportation is switched off for performance reasons,
  119.     #     because the extraction step is an expensive operation and is usually
  120.     #     useless for serving static content. So one usually enables the
  121.     #     exportation for CGI and SSI requests only.
  122.     #   o StrictRequire:
  123.     #     This denies access when "SSLRequireSSL" or "SSLRequire" applied even
  124.     #     under a "Satisfy any" situation, i.e. when it applies access is denied
  125.     #     and no other module can change it.
  126.     #   o OptRenegotiate:
  127.     #     This enables optimized SSL connection renegotiation handling when SSL
  128.     #     directives are used in per-directory context.
  129.     #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
  130.     <FilesMatch "\.(cgi|shtml|phtml|php)$">
  131.         SSLOptions +StdEnvVars
  132.     </FilesMatch>
  133.     <Directory /usr/lib/cgi-bin>
  134.         SSLOptions +StdEnvVars
  135.     </Directory>
  136.  
  137.     #   SSL Protocol Adjustments:
  138.     #   The safe and default but still SSL/TLS standard compliant shutdown
  139.     #   approach is that mod_ssl sends the close notify alert but doesn't wait for
  140.     #   the close notify alert from client. When you need a different shutdown
  141.     #   approach you can use one of the following variables:
  142.     #   o ssl-unclean-shutdown:
  143.     #     This forces an unclean shutdown when the connection is closed, i.e. no
  144.     #     SSL close notify alert is send or allowed to received.  This violates
  145.     #     the SSL/TLS standard but is needed for some brain-dead browsers. Use
  146.     #     this when you receive I/O errors because of the standard approach where
  147.     #     mod_ssl sends the close notify alert.
  148.     #   o ssl-accurate-shutdown:
  149.     #     This forces an accurate shutdown when the connection is closed, i.e. a
  150.     #     SSL close notify alert is send and mod_ssl waits for the close notify
  151.     #     alert of the client. This is 100% SSL/TLS standard compliant, but in
  152.     #     practice often causes hanging connections with brain-dead browsers. Use
  153.     #     this only for browsers where you know that their SSL implementation
  154.     #     works correctly.
  155.     #   Notice: Most problems of broken clients are also related to the HTTP
  156.     #   keep-alive facility, so you usually additionally want to disable
  157.     #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
  158.     #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
  159.     #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
  160.     #   "force-response-1.0" for this.
  161.     BrowserMatch "MSIE [2-6]" \
  162.         nokeepalive ssl-unclean-shutdown \
  163.         downgrade-1.0 force-response-1.0
  164.     # MSIE 7 and newer should be able to use keepalive
  165.     BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
  166.  
  167. </VirtualHost>
  168. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement