各位前辈,小弟前段时间移植的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"