]> ruin.nu Git - ndwebbie.git/blob - apache-conf.conf
Move favicon to static, so expire headers are set
[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         ServerAlias ndtest.ruin.nu
19
20         ErrorLog /var/log/apache2/ndawn_error_log
21         <IfModule mod_log_config.c>
22                 #TransferLog logs/ndawn_access_log
23                 CustomLog /var/log/apache2/ndawn_access_log "%h %l %u [%{%F %H:%M:%S}t] \"%r\" %>s %b %T \"%{Referer}i\" \"%{User-Agent}i\" PUB"
24         </IfModule>
25
26         Alias /static /var/www/ndawn/root/static
27         Alias /robots.txt /var/www/ndawn/root/robots.txt
28
29         FastCgiExternalServer /tmp/ndwebpub.fcgi -socket /tmp/ndweb.socket
30         Alias / /tmp/ndwebpub.fcgi/
31
32         <Location />
33                 Allow from all
34         </Location>
35
36         DeflateFilterNote ratio
37         <Location /static>
38                 SetHandler default-handler
39
40                 ExpiresActive On
41                 ExpiresDefault "access plus 1 week"
42                 #ExpiresByType text/css "access plus 1 week"
43                 #ExpiresByType application/javascript "access plus 1 week"
44                 #ExpiresByType image/png "access plus 1 week"
45
46                 AddOutputFilterByType DEFLATE text/html
47                 AddOutputFilterByType DEFLATE text/xml
48                 AddOutputFilterByType DEFLATE text/css
49                 AddOutputFilterByType DEFLATE application/javascript
50                 AddOutputFilterByType DEFLATE application/x-javascript
51                 AddOutputFilterByType DEFLATE application/xhtml+xml
52                 AddOutputFilterByType DEFLATE application/xml
53                 AddOutputFilterByType DEFLATE application/ms* application/vnd* application/postscript
54         </Location>
55 </VirtualHost>
56
57 Listen 1337
58
59 <VirtualHost *:1337>
60         ServerName nd.ruin.nu
61
62         SSLEngine on
63         SSLCertificateFile /etc/apache2/ssl/nd.crt
64         SSLCertificateKeyFile /etc/apache2/ssl/nd.key
65
66         RewriteEngine On
67         RewriteRule ^/(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R]
68
69 </VirtualHost>
70
71 NameVirtualHost *:443
72
73 <VirtualHost *:443>
74         ServerName nd.ruin.nu
75         ServerAlias ndtest.ruin.nu
76
77         ErrorLog /var/log/apache2/ndawn_error_log
78         <IfModule mod_log_config.c>
79                 #TransferLog logs/ndawn_access_log
80                 CustomLog /var/log/apache2/ndawn_access_log "%h %l %u [%{%F %H:%M:%S}t] \"%r\" %>s %b %T \"%{Referer}i\" \"%{User-Agent}i\" SSL"
81         </IfModule>
82
83         SSLEngine on
84         SSLCertificateFile /etc/apache2/ssl/server.crt
85         SSLCertificateKeyFile /etc/apache2/ssl/server.key
86
87
88         <IfModule setenvif_module>
89                 BrowserMatch ".*MSIE.*" \
90                         nokeepalive ssl-unclean-shutdown \
91                         downgrade-1.0 force-response-1.0
92         </IfModule>
93
94         Alias /static /var/www/ndawn/root/static
95         Alias /robots.txt /var/www/ndawn/root/robots.txt
96
97         FastCgiExternalServer /tmp/ndweb.fcgi -socket /tmp/ndweb.socket
98         Alias / /tmp/ndweb.fcgi/
99
100         <Location />
101                 Allow from all
102         </Location>
103
104         DeflateFilterNote ratio
105         <Location /static>
106                 SetHandler default-handler
107
108                 ExpiresActive On
109                 ExpiresDefault "access plus 1 week"
110                 #ExpiresByType text/css "access plus 1 week"
111                 #ExpiresByType application/javascript "access plus 1 week"
112                 #ExpiresByType image/png "access plus 1 week"
113                 Header append Cache-Control "public"
114
115                 AddOutputFilterByType DEFLATE text/html
116                 AddOutputFilterByType DEFLATE text/xml
117                 AddOutputFilterByType DEFLATE text/css
118                 AddOutputFilterByType DEFLATE application/javascript
119                 AddOutputFilterByType DEFLATE application/x-javascript
120                 AddOutputFilterByType DEFLATE application/xhtml+xml
121                 AddOutputFilterByType DEFLATE application/xml
122                 AddOutputFilterByType DEFLATE application/ms* application/vnd* application/postscript
123         </Location>
124 </VirtualHost>