]> ruin.nu Git - ndwebbie.git/blob - apache-conf.conf
restructing to modules
[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 %t \"%r\" %>s %b \"%{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         Auth_PG_host localhost
104         Auth_PG_user ndawn
105         Auth_PG_pwd Ni7ueYae
106         Auth_PG_database ndawn
107         Auth_PG_hash_type MD5
108
109         Auth_PG_pwd_table users
110         Auth_PG_uid_field username
111         Auth_PG_pwd_field password
112
113         Auth_PG_grp_table usersingroup
114         Auth_PG_grp_group_field groupname
115         Auth_PG_grp_user_field username
116
117         #Auth_PG_log_table access_log
118         #Auth_PG_log_uname_field login
119         #Auth_PG_log_date_field date
120         #Auth_PG_log_uri_field request
121         #Auth_PG_log_addrs_field  ip_address
122
123         #
124         # Controls who can get stuff from this server.
125         #
126         Order Deny,Allow
127         Require valid-user
128
129     </Location>
130
131
132     # Disallow browsing of Subversion working copy administrative dirs.  
133     <locationmatch "/.svn/>  
134         Order allow,deny  
135         Deny from all  
136     </locationmatch> 
137     <Location .*/\.svn/.*>
138         Order allow,deny  
139         Deny from all  
140     </Location>
141
142         PerlSwitches -T -I/var/www/ndawn/code/
143         PerlRequire /var/www/ndawn/code/startup.pl
144         <Location ~ "^/\w*(.*\.(pl|php|pm))?$">
145                 SetHandler perl-script
146                 PerlResponseHandler ND
147         </Location>
148
149         <Location /perl-status>
150                 SetHandler perl-script
151                 PerlResponseHandler Apache2::Status
152                 Order deny,allow
153                 Deny from all
154                 Allow from 127.0.0.1
155                 Allow from 193.11.248.227
156         </Location>
157
158         
159     <IfModule peruser.c>
160         # this must match a Processor
161         ServerEnvironment apache apache
162         
163         # these are optional - defaults to the values specified in httpd.conf
164         MinSpareProcessors 4
165         MaxProcessors 20
166     </IfModule>
167 </VirtualHost>
168