]> ruin.nu Git - ndwebbie.git/blob - apache-conf.conf
Converted the apache config, including switch to mod_fastcgi
[ndwebbie.git] / apache-conf.conf
1 ### Section 3: Virtual Hosts
2 #
3 # VirtualHost: If you want to maintain multiple domains/hostnames on your
4 # machine you can setup VirtualHost containers for them. Most configurations
5 # use only name-based virtual hosts so the server doesn't need to worry about
6 # IP addresses. This is indicated by the asterisks in the directives below.
7 #
8 # Please see the documentation at 
9 # <URL:http://httpd.apache.org/docs-2.0/vhosts/>
10 # for further details before you try to setup virtual hosts.
11 #
12 # You may use the command line option '-S' to verify your virtual host
13 # configuration.
14
15
16 <VirtualHost *:80>
17         ServerName nd.ruin.nu
18
19         RewriteEngine On
20         RewriteCond %{HTTPS} !=on
21         RewriteRule ^/(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R]
22
23 </VirtualHost>
24
25 Listen 1337
26
27 <VirtualHost *:1337>
28         ServerName nd.ruin.nu
29
30         SSLEngine on
31         SSLCertificateFile /etc/apache2/ssl/nd.crt
32         SSLCertificateKeyFile /etc/apache2/ssl/nd.key
33
34         RewriteEngine On
35         RewriteRule ^/(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R]
36
37 </VirtualHost>
38
39 NameVirtualHost *:443
40
41 <VirtualHost *:443>
42         ServerName nd.ruin.nu
43
44         ErrorLog /var/log/apache2/ndawn_error_log
45         <IfModule mod_log_config.c>
46                 #TransferLog logs/ndawn_access_log
47                 CustomLog /var/log/apache2/ndawn_access_log "%h %l %u [%{%F %H:%M:%S}t] \"%r\" %>s %b %T \"%{Referer}i\" \"%{User-Agent}i\""
48         </IfModule>
49
50         <IfModule setenvif_module>
51                 BrowserMatch ".*MSIE.*" \
52                         nokeepalive ssl-unclean-shutdown \
53                         downgrade-1.0 force-response-1.0
54         </IfModule>
55
56         Alias /static /var/www/ndawn/root/static
57         Alias /favicon.ico /var/www/ndawn/root/favicon.ico
58
59         FastCgiExternalServer /tmp/ndweb.fcgi -socket /tmp/ndweb.socket
60         Alias / /tmp/ndweb.fcgi/
61
62         <Location />
63                 Allow from all
64         </Location>
65
66         DeflateFilterNote ratio
67         <Location /static>
68                 SetHandler default-handler
69
70                 ExpiresActive On
71                 ExpiresDefault "access plus 1 week"
72                 #ExpiresByType text/css "access plus 1 week"
73                 #ExpiresByType application/javascript "access plus 1 week"
74                 #ExpiresByType image/png "access plus 1 week"
75
76                 AddOutputFilterByType DEFLATE text/html
77                 AddOutputFilterByType DEFLATE text/xml
78                 AddOutputFilterByType DEFLATE text/css
79                 AddOutputFilterByType DEFLATE application/javascript
80                 AddOutputFilterByType DEFLATE application/x-javascript
81                 AddOutputFilterByType DEFLATE application/xhtml+xml
82                 AddOutputFilterByType DEFLATE application/xml
83                 AddOutputFilterByType DEFLATE application/ms* application/vnd* application/postscript
84         </Location>
85 </VirtualHost>