]> ruin.nu Git - ndwebbie.git/blob - apache-conf.conf
graphs
[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 logs/ndawn_error_log
56         <IfModule mod_log_config.c>
57                 #TransferLog logs/ndawn_access_log
58                 CustomLog logs/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     #
73     # This should be changed to whatever you set DocumentRoot to.
74     #
75     <Directory "/var/www/ndawn/htdocs">
76
77         #
78         # Possible values for the Options directive are "None", "All",
79         # or any combination of:
80         #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
81         #
82         # Note that "MultiViews" must be named *explicitly* --- "Options All"
83         # doesn't give it to you.
84         #
85         # The Options directive is both complicated and important.  Please see
86         # http://httpd.apache.org/docs-2.0/mod/core.html#options
87         # for more information.
88         #
89         Options Indexes FollowSymLinks
90
91         #
92         # AllowOverride controls what directives may be placed in .htaccess files.
93         # It can be "All", "None", or any combination of the keywords:
94         #   Options FileInfo AuthConfig Limit
95         #
96         AllowOverride None
97     </Directory>
98         <Location />
99
100         AuthName "NewDawn authentication"
101         AuthType basic
102
103         PerlAuthenHandler ND::Web::AuthHandler
104
105         Order Deny,Allow
106         Require valid-user
107
108         </Location>
109
110
111     # Disallow browsing of Subversion working copy administrative dirs.  
112     <locationmatch "/.svn/>  
113         Order allow,deny  
114         Deny from all  
115     </locationmatch> 
116     <Location .*/\.svn/.*>
117         Order allow,deny  
118         Deny from all  
119     </Location>
120
121         PerlSwitches -T -I/var/www/ndawn/code/
122         PerlRequire /var/www/ndawn/code/startup.pl
123         <Location ~ "^/((\w+\.(pl|php|pm))|[^.]*)$">
124                 SetHandler perl-script
125                 PerlResponseHandler ND
126         </Location>
127
128         <Location /perl-status>
129                 SetHandler perl-script
130                 PerlResponseHandler Apache2::Status
131                 Order deny,allow
132                 Deny from all
133                 Allow from 127.0.0.1
134                 Allow from 193.11.248.227
135         </Location>
136
137         
138     <IfModule peruser.c>
139         # this must match a Processor
140         ServerEnvironment apache apache
141         
142         # these are optional - defaults to the values specified in httpd.conf
143         MinSpareProcessors 4
144         MaxProcessors 20
145     </IfModule>
146 </VirtualHost>
147