Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
配置lighttpd以处理CGI C可执行文件_Cgi_Lighttpd - Fatal编程技术网

配置lighttpd以处理CGI C可执行文件

配置lighttpd以处理CGI C可执行文件,cgi,lighttpd,Cgi,Lighttpd,有人知道如何配置lighttpd来处理普通的CGI可执行文件吗,在本例中是用C编写的?我已经编译了一个测试程序(test.cgi),并将它放在$HOME/public_html/cgi-bin中。我还使用lighty enable mod CGI启用了CGI模块,并重新启动了web服务器。但是,当请求时,程序不会运行,而是作为静态文件处理。顺便说一下,这是我的测试程序: #include <stdio.h> int main(void) { printf("Content-t

有人知道如何配置lighttpd来处理普通的CGI可执行文件吗,在本例中是用C编写的?我已经编译了一个测试程序(test.cgi),并将它放在$HOME/public_html/cgi-bin中。我还使用
lighty enable mod CGI
启用了CGI模块,并重新启动了web服务器。但是,当请求时,程序不会运行,而是作为静态文件处理。顺便说一下,这是我的测试程序:

#include <stdio.h>

int main(void)
{
   printf("Content-type: text/plain\n\n");
   puts("test...");
   return 0;
}
#包括
内部主(空)
{
printf(“内容类型:text/plain\n\n”);
放置(“测试…”);
返回0;
}

默认CGI配置如下所示:

$HTTP["url"] =~ "^/cgi-bin/" {
    cgi.assign = ( "" => "" )
}
i、 e.只执行文档根目录下cgi bin目录中的二进制文件。要启用每用户cgi目录,请添加

$HTTP["url"] =~ "^(/~[^/]+)?/cgi-bin/" {
    cgi.assign = ("" => "")
}

到lighttpd配置文件。

我已经将第二组行添加到我的lighttpd配置中,但它仍然像是静态的一样服务于cgi文件(即尝试下载),只是为了澄清一下,我的cgi文件在/var/www/folder中这可能会起作用:
chcon-R-t httpd\u sys\u script\u exec\t cgi bin