配置lighttpd以处理CGI C可执行文件
有谁知道如何配置lighttpd来处理普通的CGI可执行文件(在本例中是用C编写的)?我编译了一个测试程序(test.cgi)并将其放在$HOME/public_html/cgi-bin中。我还使用 lighty-enable-mod cgi
启用了 CGI 模块并重新启动了 Web 服务器。尽管如此,在请求 http://localhost/~august/cgi-bin/test.cgi 程序不会运行,而是被视为静态文件。顺便说一下,这是我的测试程序:
#include <stdio.h>
int main(void)
{
printf("Content-type: text/plain\n\n");
puts("test...");
return 0;
}
Does anyone know how to configure lighttpd to handle plain CGI executables, in this case written in C? I have compiled a test program (test.cgi) and put it in $HOME/public_html/cgi-bin. I have also enabled the CGI module with lighty-enable-mod cgi
and restarted the web server. Still, when requesting http://localhost/~august/cgi-bin/test.cgi the program is not run but is instead treated as a static file. Here is my test program by the way:
#include <stdio.h>
int main(void)
{
printf("Content-type: text/plain\n\n");
puts("test...");
return 0;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认的CGI配置如下所示:
即仅执行文档根目录下的cgi-bin目录中的二进制文件。要启用每用户 cgi 目录,请添加
到lighttpd 配置文件中。
The default CGI configuration looks like this:
i.e. only binaries in the cgi-bin directory under the document root will be executed. To enable per-user cgi directories, add
to the lighttpd configuration file.