由 marengen 在 07-07-2004 16:21 发表:
如何配置才能使Apache支持CGI/WebDAV?
如何配置才能使Apache支持CGI/WebDAV?
我的系统用的是reahat9 ,Apache用的是系统自带的Apache/2.0.40 (Red Hat Linux)
其中/cgi-bin/目录的权限为:755
下面是我的apache里关于CGI/WebDAV的一点配置文件:
----------------------------------------
ScriptAlias: This controls which directories contain server scripts.
ScriptAliases are essentially the same as Aliases, except that
documents in the realname directory are treated as applications and
run by the server when requested rather than as documents sent to the client.
The same rules about trailing "/" apply to ScriptAlias directives as to
Alias.
ScriptAlias /cgi-bin/ "/var/www/html/cgi-bin/"
To use CGI scripts outside of ScriptAliased directories:
(You will also need to add "ExecCGI" to the "Options" directive.)
AddHandler cgi-script .cgi .pl
1<directory "="" cgi-bin"="" html="" var="" www="">
2
3AllowOverride None
4
5Options ExecCGI -Indexes
6
7Order allow,deny
8
9Allow from all
10
11</directory>
Allow server status reports, with the URL of http://servername/server-status
Change the ".your-domain.com" to match your domain to enable.
1<location server-status="">
2
3SetHandler server-status
4
5Order deny,allow
6
7Deny from all
8
9Allow from 192.168.1.110
10
11
12
13AuthType Basic
14
15AuthName "Admin"
16
17AuthUserFile /var/www/passwd/marengen
18
19AuthGroupFile /var/www/passwd/admingrp
20
21require group admin
22
23Satisfy any
24
25</location>
1<directory "="" html"="" var="" www="">
2
3Options Indexes Includes FollowSymLinks
4
5
6
7AllowOverride None
8
9Allow from all
10
11
12
13Dav On
14
15AuthType Basic
16
17AuthName "Admin"
18
19AuthUserFile /var/www/passwd/marengen
20
21AuthGroupFile /var/www/passwd/admingrp
22
23
24
25
26
27<limitexcept get="" options="">
28
29
30
31require group admin
32
33
34
35</limitexcept>
36
37
38
39\----------------------------------------
40
41问题是:现在我一访问/cgi-bin/目录,就会出来Forbidden提示:
42
43
44
45http://192.168.1.110/cgi-bin/
46
47
48
49Forbidden
50
51
52
53You don't have permission to access /cgi-bin/ on this server.
54
55
56
57Apache/2.0.40 Server at XiaoMa Port 80
58
59
60
61\----------------------------------------
62
63一访问这目录下面的文件,就会有出错提示:
64
65
66
67http://192.168.1.110/cgi-bin/hello.cgi
68
69
70
71Internal Server Error
72
73
74
75
76
77The server encountered an internal error or misconfiguration and was unable to complete your request.
78
79
80
81
82
83Please contact the server administrator, marengen@msn.com and inform them of the time the error occurred, and anything you might have done that may h</directory>