3
(* directives testing *)
4
let d1 = "ServerRoot \"/etc/apache2\"\n"
5
test Httpd.directive get d1 =
6
{ "directive" = "ServerRoot"
7
{ "arg" = "\"/etc/apache2\"" }
10
let d2 = "ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/\n"
11
test Httpd.directive get d2 =
12
{ "directive" = "ScriptAlias"
13
{ "arg" = "/cgi-bin/" }
14
{ "arg" = "/usr/lib/cgi-bin/" }
17
let d3 = "LockFile /var/lock/apache2/accept.lock\n"
18
test Httpd.directive get d3 =
19
{ "directive" = "LockFile"
20
{ "arg" = "/var/lock/apache2/accept.lock" }
34
test Httpd.lns get c1 = { }{ "IfModule" }
36
test Httpd.lns put c1 after set "/IfModule/arg[1]" "foo";
37
set "/IfModule/arg[2]" "bar" = c1_put
40
<IfModule !mpm_winnt.c>
41
<IfModule !mpm_netware.c>
42
LockFile /var/lock/apache2/accept.lock
47
test Httpd.lns get c2 =
50
{ "arg" = "!mpm_winnt.c" }
52
{ "arg" = "!mpm_netware.c" }
53
{ "directive" = "LockFile"
54
{ "arg" = "/var/lock/apache2/accept.lock" }
59
(* arguments must be the first child of the section *)
60
test Httpd.lns put c2 after rm "/IfModule/arg";
61
insb "arg" "/IfModule/*[1]";
62
set "/IfModule/arg" "foo" =
65
<IfModule !mpm_netware.c>
66
LockFile /var/lock/apache2/accept.lock
72
<IfModule mpm_event_module>
83
test Httpd.lns get c3 =
86
{ "arg" = "mpm_event_module" }
87
{ "directive" = "StartServers"
90
{ "directive" = "MaxClients"
93
{ "directive" = "MinSpareThreads"
96
{ "directive" = "MaxSpareThreads"
99
{ "directive" = "ThreadLimit"
102
{ "directive" = "ThreadsPerChild"
105
{ "directive" = "MaxRequestsPerChild"
120
test Httpd.lns get c4 =
124
{ "arg" = "\"^\.ht\"" }
125
{ "directive" = "Order"
126
{ "arg" = "allow,deny" }
128
{ "directive" = "Deny"
132
{ "directive" = "Satisfy"
139
let c5 = "LogFormat \"%{User-agent}i\" agent\n"
140
test Httpd.lns get c5 =
141
{ "directive" = "LogFormat"
142
{ "arg" = "\"%{User-agent}i\"" }
146
let c7 = "LogFormat \"%v:%p %h %l %u %t \\"%r\\" %>s %O \\"%{Referer}i\\" \\"%{User-Agent}i\\"\" vhost_combined\n"
147
test Httpd.lns get c7 =
148
{ "directive" = "LogFormat"
149
{ "arg" = "\"%v:%p %h %l %u %t \\"%r\\" %>s %O \\"%{Referer}i\\" \\"%{User-Agent}i\\"\"" }
150
{ "arg" = "vhost_combined" }
153
let c8 = "IndexIgnore .??* *~ *# RCS CVS *,v *,t \n"
154
test Httpd.directive get c8 =
155
{ "directive" = "IndexIgnore"
165
(* FIXME: not yet supported:
166
* The backslash "\" may be used as the last character on a line to indicate
167
* that the directive continues onto the next line. There must be no other
168
* characters or white space between the backslash and the end of the line.
170
test Httpd.directive get "Options Indexes \
171
FollowSymLinks MultiViews\n" = *
173
{ "directive" = "Options"
174
{ "arg" = "Indexes" }
175
{ "arg" = "FollowSymLinks" }
176
{ "arg" = "MultiViews" }
180
let conf2 = "<VirtualHost *:80>
181
ServerAdmin webmaster@localhost
183
DocumentRoot /var/www
185
Options FollowSymLinks
188
<Directory /var/www/>
189
Options Indexes FollowSymLinks MultiViews
195
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
196
<Directory \"/usr/lib/cgi-bin\">
198
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
203
ErrorLog /var/log/apache2/error.log
205
# Possible values include: debug, info, notice, warn, error, crit,
209
CustomLog /var/log/apache2/access.log combined
213
Alias /doc/ \"/usr/share/doc/\"
214
<Directory \"/usr/share/doc/\">
215
Options Indexes MultiViews FollowSymLinks
219
Allow from 127.0.0.0/255.0.0.0 ::1/128
225
test Httpd.lns get conf2 =
228
{ "directive" = "ServerAdmin"
229
{ "arg" = "webmaster@localhost" }
232
{ "directive" = "DocumentRoot"
233
{ "arg" = "/var/www" }
237
{ "directive" = "Options"
238
{ "arg" = "FollowSymLinks" }
240
{ "directive" = "AllowOverride"
245
{ "arg" = "/var/www/" }
246
{ "directive" = "Options"
247
{ "arg" = "Indexes" }
248
{ "arg" = "FollowSymLinks" }
249
{ "arg" = "MultiViews" }
251
{ "directive" = "AllowOverride"
254
{ "directive" = "Order"
255
{ "arg" = "allow,deny" }
257
{ "directive" = "allow"
263
{ "directive" = "ScriptAlias"
264
{ "arg" = "/cgi-bin/" }
265
{ "arg" = "/usr/lib/cgi-bin/" }
268
{ "arg" = "\"/usr/lib/cgi-bin\"" }
269
{ "directive" = "AllowOverride"
272
{ "directive" = "Options"
273
{ "arg" = "+ExecCGI" }
274
{ "arg" = "-MultiViews" }
275
{ "arg" = "+SymLinksIfOwnerMatch" }
277
{ "directive" = "Order"
278
{ "arg" = "allow,deny" }
280
{ "directive" = "Allow"
286
{ "directive" = "ErrorLog"
287
{ "arg" = "/var/log/apache2/error.log" }
290
{ "#comment" = "Possible values include: debug, info, notice, warn, error, crit," }
291
{ "#comment" = "alert, emerg." }
292
{ "directive" = "LogLevel"
296
{ "directive" = "CustomLog"
297
{ "arg" = "/var/log/apache2/access.log" }
298
{ "arg" = "combined" }
301
{ "directive" = "SSLRequireSSL" }
303
{ "directive" = "Alias"
305
{ "arg" = "\"/usr/share/doc/\"" }
308
{ "arg" = "\"/usr/share/doc/\"" }
309
{ "directive" = "Options"
310
{ "arg" = "Indexes" }
311
{ "arg" = "MultiViews" }
312
{ "arg" = "FollowSymLinks" }
314
{ "directive" = "AllowOverride"
317
{ "directive" = "Order"
318
{ "arg" = "deny,allow" }
320
{ "directive" = "Deny"
324
{ "directive" = "Allow"
326
{ "arg" = "127.0.0.0/255.0.0.0" }
327
{ "arg" = "::1/128" }