]> ruin.nu Git - ndwebbie.git/blob - apache-conf.conf
Merge branch 'master' of ruin.nu:git/ndwebbie
[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 # Use name-based virtual hosting.
17 #
18 #NameVirtualHost guranga.org:80
19
20 #
21 # VirtualHost example:
22 # Almost any Apache directive may go into a VirtualHost container.
23 # The first VirtualHost section is used for requests without a known
24 # server name.
25 #
26 #<VirtualHost *:80>
27 #    ServerAdmin webmaster@dummy-host.example.com
28 #    DocumentRoot /www/docs/dummy-host.example.com
29 #    ServerName dummy-host.example.com
30 #    ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
31 #    CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
32 #</VirtualHost>
33
34
35 #
36 # The First Virtual Host is also your DEFAULT Virtual Host.
37 # This means any requests that do not match any other vhosts will 
38 # goto this virtual host.
39 #
40
41 <VirtualHost *:80>
42         ServerName nd.ruin.nu
43
44         RewriteEngine On
45         RewriteCond %{HTTPS} !=on
46         RewriteRule ^/(.*) https://%{SERVER_NAME}:1337%{REQUEST_URI} [R]
47 </VirtualHost>
48
49 <VirtualHost *:443>
50         ServerName nd.ruin.nu
51
52         ErrorLog /var/log/apache2/ndawn_error_log
53         <IfModule mod_log_config.c>
54                 #TransferLog logs/ndawn_access_log
55                 CustomLog /var/log/apache2/ndawn_access_log "%h %l %u [%{%F %H:%M:%S}t] \"%r\" %>s %b %T \"%{Referer}i\" \"%{User-Agent}i\""
56         </IfModule>
57
58         <IfModule mod_setenvif.c>
59                 SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown \
60                 downgrade-1.0 force-response-1.0
61         </IfModule>
62     #
63     # DocumentRoot: The directory out of which you will serve your
64     # documents. By default, all requests are taken from this directory, but
65     # symbolic links and aliases may be used to point to other locations.
66     #
67     DocumentRoot "/var/www/ndawn/htdocs"
68
69         DeflateFilterNote ratio
70         AddOutputFilterByType DEFLATE text/*
71         AddOutputFilterByType DEFLATE application/xhtml+xml
72         AddOutputFilterByType DEFLATE application/ms* application/vnd* application/postscript
73
74
75     #
76     # This should be changed to whatever you set DocumentRoot to.
77     #
78     <Directory "/var/www/ndawn/htdocs">
79
80         #
81         # Possible values for the Options directive are "None", "All",
82         # or any combination of:
83         #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
84         #
85         # Note that "MultiViews" must be named *explicitly* --- "Options All"
86         # doesn't give it to you.
87         #
88         # The Options directive is both complicated and important.  Please see
89         # http://httpd.apache.org/docs-2.0/mod/core.html#options
90         # for more information.
91         #
92         Options Indexes FollowSymLinks
93
94         #
95         # AllowOverride controls what directives may be placed in .htaccess files.
96         # It can be "All", "None", or any combination of the keywords:
97         #   Options FileInfo AuthConfig Limit
98         #
99         AllowOverride None
100     </Directory>
101         <Location />
102
103         AuthName "NewDawn authentication"
104         AuthType basic
105
106         PerlAuthenHandler NDWeb::AuthHandler
107
108         Order Deny,Allow
109         Require valid-user
110
111         </Location>
112
113
114     # Disallow browsing of Subversion working copy administrative dirs.  
115     <locationmatch "/.svn/>  
116         Order allow,deny  
117         Deny from all  
118     </locationmatch> 
119     <Location .*/\.svn/.*>
120         Order allow,deny  
121         Deny from all  
122     </Location>
123
124         PerlSwitches -T -I/var/www/ndawn/
125         PerlRequire /var/www/ndawn/startup.pl
126         <Location ~ "^/((\w+\.(pl|php|pm))|[^.]*)$">
127                 SetHandler perl-script
128                 PerlResponseHandler ND
129         </Location>
130
131         <Location /perl-status>
132                 SetHandler perl-script
133                 PerlResponseHandler Apache2::Status
134                 Order deny,allow
135                 Deny from all
136                 Allow from 127.0.0.1
137                 Allow from 193.11.248.227
138         </Location>
139
140         
141     <IfModule peruser.c>
142         # this must match a Processor
143         ServerEnvironment apache apache
144         
145         # these are optional - defaults to the values specified in httpd.conf
146         MinSpareProcessors 4
147         MaxProcessors 20
148     </IfModule>
149 </VirtualHost>
150
151 Listen 1337
152
153 <VirtualHost *:1337>
154         ServerName nd.ruin.nu
155
156         ErrorLog /var/log/apache2/ndawn_error_log
157         <IfModule mod_log_config.c>
158                 #TransferLog logs/ndawn_access_log
159                 CustomLog /var/log/apache2/ndawn_access_log "%h %l %u [%{%F %H:%M:%S}t] \"%r\" %>s %b %T \"%{Referer}i\" \"%{User-Agent}i\""
160         </IfModule>
161
162
163         SSLEngine on
164         SSLCertificateFile /etc/apache2/ssl/nd.crt
165         SSLCertificateKeyFile /etc/apache2/ssl/nd.key
166         #SSLCertificateChainFile /etc/apache2/ssl/ca-bundle.crt
167         #SSLCACertificateFile /etc/apache2/ssl/ca-bundle.crt
168
169         <IfModule setenvif_module>
170                 BrowserMatch ".*MSIE.*" \
171                         nokeepalive ssl-unclean-shutdown \
172                         downgrade-1.0 force-response-1.0
173         </IfModule>
174     #
175     # DocumentRoot: The directory out of which you will serve your
176     # documents. By default, all requests are taken from this directory, but
177     # symbolic links and aliases may be used to point to other locations.
178     #
179     DocumentRoot "/var/www/ndawn/htdocs"
180
181         DeflateFilterNote ratio
182         AddOutputFilterByType DEFLATE text/*
183         AddOutputFilterByType DEFLATE application/xhtml+xml
184         AddOutputFilterByType DEFLATE application/ms* application/vnd* application/postscript
185
186
187     #
188     # This should be changed to whatever you set DocumentRoot to.
189     #
190     <Directory "/var/www/ndawn/htdocs">
191
192         #
193         # Possible values for the Options directive are "None", "All",
194         # or any combination of:
195         #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
196         #
197         # Note that "MultiViews" must be named *explicitly* --- "Options All"
198         # doesn't give it to you.
199         #
200         # The Options directive is both complicated and important.  Please see
201         # http://httpd.apache.org/docs-2.0/mod/core.html#options
202         # for more information.
203         #
204         Options Indexes FollowSymLinks
205
206         #
207         # AllowOverride controls what directives may be placed in .htaccess files.
208         # It can be "All", "None", or any combination of the keywords:
209         #   Options FileInfo AuthConfig Limit
210         #
211         AllowOverride None
212     </Directory>
213         <Location />
214
215         AuthName "NewDawn authentication"
216         AuthType basic
217
218         PerlAuthenHandler NDWeb::AuthHandler
219
220         Order Deny,Allow
221         Require valid-user
222
223         </Location>
224
225
226     # Disallow browsing of Subversion working copy administrative dirs.  
227     <locationmatch "/.svn/>  
228         Order allow,deny  
229         Deny from all  
230     </locationmatch> 
231     <Location .*/\.svn/.*>
232         Order allow,deny  
233         Deny from all  
234     </Location>
235
236         PerlSwitches -T -I/var/www/ndawn/
237         PerlRequire /var/www/ndawn/startup.pl
238         <Location ~ "^/((\w+\.(pl|php|pm))|[^.]*)$">
239                 SetHandler perl-script
240                 PerlResponseHandler ND
241         </Location>
242
243         <Location /perl-status>
244                 SetHandler perl-script
245                 PerlResponseHandler Apache2::Status
246                 Order deny,allow
247                 Deny from all
248                 Allow from 127.0.0.1
249                 Allow from 193.11.248.227
250         </Location>
251
252         
253     <IfModule peruser.c>
254         # this must match a Processor
255         ServerEnvironment apache apache
256         
257         # these are optional - defaults to the values specified in httpd.conf
258         MinSpareProcessors 4
259         MaxProcessors 20
260     </IfModule>
261 </VirtualHost>