lighttpd服务器cgi程序500 - Internal Server Error错误

alan00000 2012-02-10 02:22:17
各位前辈,小弟前段时间移植的lighttpd服务器可以在浏览器正常显示html今天发现其无法正常运行cgi。
运行cgi时显示空白或者“500 - Internal Server Error”
cgi程序没有问题,在我移植的boa服务器上可以正常执行。请求大神帮助。
-----------------具体情况如下---------------------------
cgi程序存放路径:
/srv/www/cgi-bin/
cgi程序文件属性:
-rwxrwxrwx 1 lighttpd lighttpd 5248 Feb 8 07:38 hello
CGI源码如下:
#include<stdio.h>
int main(){
printf("Content-type: text/html\n\n");
printf("\n");
printf("CGI Output\n");
printf("\n");
printf("Hello, world.\n");
printf("\n");
printf("\n");
//exit(0);
return 0;
}



浏览器地址栏如下:
http://192.168.2.2/cgi-bin/hello

当浏览器显示一片空白时,错误日志文件显示:
2012-02-08 17:35:20: (mod_cgi.c.1304) cleaning up CGI: process died with signal 9
当浏览器显示“500 - Internal Server Error”时,错误日志文件显示:
2012-02-08 17:36:33: (mod_cgi.c.601) cgi died, pid: 88

下面是日志文件最新内容:
338 2012-02-08 17:33:23: (mod_cgi.c.601) cgi died, pid: 82
339 2012-02-08 17:34:25: (mod_cgi.c.1396) cgi died ?
340 2012-02-08 17:35:20: (mod_cgi.c.1304) cleaning up CGI: process died with signal 9
341 2012-02-08 17:35:49: (mod_cgi.c.1304) cleaning up CGI: process died with signal 9
342 2012-02-08 17:36:18: (mod_cgi.c.1304) cleaning up CGI: process died with signal 9
343 2012-02-08 17:36:33: (mod_cgi.c.601) cgi died, pid: 88

lighttpd.conf文件内容如下:
var.log_root    = "/var/log/lighttpd"
var.server_root = "/srv/www"
var.state_dir = "/var/run"
var.home_dir = "/usr/local/lighttpd-arm/sbin/lighttpd"
var.conf_dir = "/etc/lighttpd"
var.vhosts_dir = server_root + "/vhosts"
var.cache_dir = "/var/cache/lighttpd"
var.socket_dir = home_dir + "/sockets"
include "modules.conf"
server.port = 80
server.use-ipv6 = "disable"
server.username = "lighttpd"
server.groupname = "lighttpd"
server.document-root = server_root + "/htdocs"
server.pid-file = state_dir + "/lighttpd.pid"
server.errorlog = log_root + "/error.log"
include "conf.d/access_log.conf"
include "conf.d/debug.conf"
server.event-handler = "linux-sysepoll"
server.network-backend = "writev"
server.max-fds = 2048
server.stat-cache-engine = "simple"
server.max-connections = 1024
index-file.names += (
"index.xhtml", "index.html", "index.htm", "default.htm", "index.php"
url.access-deny = ( "~", ".inc" )
$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".scgi" ,".cgi" )
include "conf.d/mime.conf"
include "conf.d/dirlisting.conf"
server.follow-symlink = "enable"
server.upload-dirs = ( "/var/tmp" )


cgi.conf文件内容如下:
#######################################################################
##
## CGI modules
## ---------------
##
## http://www.lighttpd.net/documentation/cgi.html
##
server.modules += ( "mod_cgi" )

##
## Plain old CGI handling
##
## For PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini.
##
cgi.assign = ( ".pl" => "/usr/bin/perl",
".cgi" => "",
".rb" => "/usr/bin/ruby",
".erb" => "/usr/bin/eruby",
".py" => "/usr/bin/python" )

##
## to get the old cgi-bin behavior of apache
##
## Note: make sure that mod_alias is loaded if you uncomment the
## next line. (see modules.conf)
##
alias.url += ( "/cgi-bin" => server_root + "/cgi-bin" )
$HTTP["url"] =~ "^/cgi-bin" {
cgi.assign = ( "" => "" )
}

##
#######################################################################

lighttpd在arm开发板上的移植过程是:
http://blog.csdn.net/alan00000/article/details/7192607
...全文
1158 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
alan00000 2012-02-10
  • 打赏
  • 举报
回复
大部分时间网页显示的是一片空白,偶尔才显示“500 - Internal Server Error”

2,204

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 CGI
社区管理员
  • CGI社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧