Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1172938
  • 博文数量: 128
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 4870
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-19 14:28
文章分类

全部博文(128)

文章存档

2010年(2)

2009年(22)

2008年(104)

我的朋友

分类: LINUX

2009-03-28 14:48:27

关于rhel5中apache中的cgi程序权限问题

 
今天在做实验时,写了个cgi脚本,内容如下:
#!/bin/bash
echo "content-type: text/plain"
echo
 
whoami
date
echo "Test scripts"
然后在IE中运行,总是报500内部错误,检查了下日志信息,先是报:
Premature end of script headers: test.sh错误信息,在脚本中加入:
echo "content-type: text/plain"
echo
问题解决了,可是还是提示权限不对,看了看apache的进程是以apache用户身份运行的:
[root@server1 httpd]# ps aux |grep httpd
root      2199  0.0  4.8  24840  9712 ?        Ss   14:24   0:00 /usr/sbin/httpd
apache    2201  0.0  2.7  24840  5496 ?        S    14:24   0:00 /usr/sbin/httpd
apache    2202  0.0  2.7  24840  5500 ?        S    14:24   0:00 /usr/sbin/httpd
apache    2203  0.0  2.7  24840  5496 ?        S    14:24   0:00 /usr/sbin/httpd
apache    2204  0.0  2.8  24840  5568 ?        S    14:24   0:00 /usr/sbin/httpd
apache    2205  0.0  2.7  24840  5488 ?        S    14:24   0:00 /usr/sbin/httpd
apache    2206  0.0  2.8  24840  5568 ?        S    14:24   0:00 /usr/sbin/httpd
apache    2207  0.0  2.7  24840  5488 ?        S    14:24   0:00 /usr/sbin/httpd
apache    2208  0.0  2.7  24840  5468 ?        S    14:24   0:00 /usr/sbin/httpd
然后把cgi脚本的组改为apache后,在ie里运行一切正常!
阅读(2324) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~