]> 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         ServerAlias webbie.ndawn.com
44
45         RewriteEngine On
46         RewriteCond %{HTTPS} !=on
47         RewriteRule ^/(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R]
48 </VirtualHost>
49
50 <VirtualHost *:443>
51
52         ServerName nd.ruin.nu
53         ServerAlias webbie.ndawn.com
54
55         ErrorLog /var/log/apache2/ndawn_error_log
56         <IfModule mod_log_config.c>
57                 #TransferLog logs/ndawn_access_log
58                 CustomLog /var/log/apache2/ndawn_access_log "%h %l %u [%{%F %H:%M:%S}t] \"%r\" %>s %b %T \"%{Referer}i\" \"%{User-Agent}i\""
59         </IfModule>
60
61         <IfModule mod_setenvif.c>
62                 SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown \
63                 downgrade-1.0 force-response-1.0
64         </IfModule>
65     #
66     # DocumentRoot: The directory out of which you will serve your
67     # documents. By default, all requests are taken from this directory, but
68     # symbolic links and aliases may be used to point to other locations.
69     #
70     DocumentRoot "/var/www/ndawn/htdocs"
71
72         DeflateFilterNote ratio
73         AddOutputFilterByType DEFLATE text/*
74         AddOutputFilterByType DEFLATE application/xhtml+xml
75         AddOutputFilterByType DEFLATE application/ms* application/vnd* application/postscript
76
77
78     #
79     # This should be changed to whatever you set DocumentRoot to.
80     #
81     <Directory "/var/www/ndawn/htdocs">
82
83         #
84         # Possible values for the Options directive are "None", "All",
85         # or any combination of:
86         #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
87         #
88         # Note that "MultiViews" must be named *explicitly* --- "Options All"
89         # doesn't give it to you.
90         #
91         # The Options directive is both complicated and important.  Please see
92         # http://httpd.apache.org/docs-2.0/mod/core.html#options
93         # for more information.
94         #
95         Options Indexes FollowSymLinks
96
97         #
98         # AllowOverride controls what directives may be placed in .htaccess files.
99         # It can be "All", "None", or any combination of the keywords:
100         #   Options FileInfo AuthConfig Limit
101         #
102         AllowOverride None
103     </Directory>
104         <Location />
105
106         AuthName "NewDawn authentication"
107         AuthType basic
108
109         PerlAuthenHandler NDWeb::AuthHandler
110
111         Order Deny,Allow
112         Require valid-user
113
114         </Location>
115
116
117     # Disallow browsing of Subversion working copy administrative dirs.  
118     <locationmatch "/.svn/>  
119         Order allow,deny  
120         Deny from all  
121     </locationmatch> 
122     <Location .*/\.svn/.*>
123         Order allow,deny  
124         Deny from all  
125     </Location>
126
127         PerlSwitches -T -I/var/www/ndawn/
128         PerlRequire /var/www/ndawn/startup.pl
129         <Location ~ "^/((\w+\.(pl|php|pm))|[^.]*)$">
130                 SetHandler perl-script
131                 PerlResponseHandler ND
132         </Location>
133
134         <Location /perl-status>
135                 SetHandler perl-script
136                 PerlResponseHandler Apache2::Status
137                 Order deny,allow
138                 Deny from all
139                 Allow from 127.0.0.1
140                 Allow from 193.11.248.227
141         </Location>
142
143         
144     <IfModule peruser.c>
145         # this must match a Processor
146         ServerEnvironment apache apache
147         
148         # these are optional - defaults to the values specified in httpd.conf
149         MinSpareProcessors 4
150         MaxProcessors 20
151     </IfModule>
152 </VirtualHost>
153