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