赞助连接

赞助连接

阅 读 文 章

(问题)apache配置CGI显示403禁止访问

[来源:网上转载 (http://bbs.chinaunix.net) | 作者:网友(网络转载) | 时间:2008-05-09 | 浏览:人次 ]

我已经把cgi这个目录的权限改成777还是不行.
哪位高手帮我看看是什么问题下面是error_log的内容.
[Sun May 04 05:26:10 2008] [notice] FastCGI: process manager initialized (pid 6901)
[Sun May 04 05:26:10 2008] [notice] Apache/2.2.4 (Unix) mod_fastcgi/2.4.6 configured -- resuming normal operations
[Sun May 04 05:26:30 2008] [error] [client 192.168.4.1] (2)No such file or directory: exec of '/usr/local/apache/cgi/index.cgi' fail
ed
[Sun May 04 05:26:30 2008] [error] [client 192.168.4.1] Premature end of script headers: index.cgi
页面显示-------------------------------------------------------------------
网站拒绝显示此网页
HTTP 403  
   最可能的原因是:
此网站要求您登录。

   您可以尝试以下 *** 作:
     返回到上一页。

     更多信息

此错误(HTTP 403 禁止)表示此程序可以连接到该网站,但是没有查看该网页的权限。


把cgi的读写权限赋予apache运行账户


已经是啦.
我建了一个vmail用户和组创建方法;
groupadd vmail
useradd -g vmail -s /bin/false -M vmail

然后在httpd.conf文件里把
User vmail
Group vmail
改成上面的.
到cgi这个目录也改了.
chgrp vmail /usr/local/apache/cgi
chown vmail /usr/local/apache/cgi
chmod +777 /usr/local/apache/cgi
我是这样做的.
可以就是出现上面的问题.
我把httpd.conf都贴出来吧.
#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here>

要把上面各级目录的权限也要改:

chmod +777 /usr/
chmod +777 /usr/local/
chmod +777 /usr/local/apache
chmod +777 /usr/local/apache/cgi -R

Good Luck!


=-=
那有那麼複雜 ...

1. 目錄 需有 Options ExecCGI
2. CGI 程式需具可執行狀態
3. 需 AddHandler cgi-script .cgi
4. CGI 程式需自行產生 Content-Type 相關訊息
5. command mode 上先確認 CGI 程式不會有執行上的錯誤


TAG标签 : 禁止 访问 显示 配置 问题 vmail chmod May Sun /usr/local/apac

最新评论 共有0位网友发表了评论

发表评论

评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名:(注册)
密码:
验证码:
匿名发表
网站地图友情连接交流论坛网站投稿广告服务联系我们留言本站长统计
Some rights reserved: www.chmhome.com, 鄂ICP备07010232号 E-mail:chinakafei@live.com,QQ:552766
中国咖啡技术网(Chmhome):国外编程技术书籍,中文编程手册,经典编程文章,交流技术,技术软件下载,计算机论文,毕业论文.