Options ExecCGI is off in this directory: /Tool/www/samba

本文介绍了解决Apache环境下Samba用户自行修改密码时遇到的403 Forbidden错误的过程。通过调整Apache配置文件中的Options指令,并启用ExecCGI选项,最终成功解决了问题。

利用apache搭建的Samba server 利用changepassword组件用户自行更改密码环境:

访问:http://192.168.25.57/samba/changepassword.cgi      报403错误

1
2
3
4
5
[root@Linux9 samba] # curl -I 192.168.25.57/samba/changepassword.cgi
HTTP /1 .1 403 Forbidden
Date: Tue, 05 Jan 2016 08:49:56 GMT
Server: Apache /2 .4.17 (Unix) PHP /5 .5.9
Content-Type: text /html ; charset=iso-8859-1

查看apache安装程序目录错误日志:

1
2
cat  /usr/local/apache2/logs/error_log
[Tue Jan 05 18:29:02.313632 2016] [cgid:error] [pid 29240:tid 3075713936] [client 192.168.30.228:59435] AH01262: Options ExecCGI is off  in  this directory:  /Tool/www/samba/changepassword .cgi

提示找不到

1
off  in  this directory:  /Tool/www/samba/changepassword .cgi   #找不到该配置文件

编辑apache主配置文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
213    DocumentRoot  "/usr/local/apache2/htdocs"
214 <Directory  "/Tool/www/samba" >                          #改成changepassword安装目录
                    
215      #
216      # Possible values for the Options directive are "None", "All",
217      # or any combination of:
218      #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
219      #
220      # Note that "MultiViews" must be named *explicitly* --- "Options All"
221      # doesn't give it to you.
222      #
223      # The Options directive is both complicated and important.  Please see
224      # http://httpd.apache.org/docs/2.4/mod/core.html#options
225      # for more information.
226      # Options Indexes FollowSymLinks ExecCGI

执行/usr/local/apache2/bin/apachectl restrt       #重启apache

         /usr/local/apache2/bin/apachectl -t           #语法检查

刷新浏览器正常访问.

本文转自 boy461205160 51CTO博客,原文链接:http://blog.51cto.com/461205160/1731849


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值