【问题标题】:How to configure lighttpd webserver to run CGI scripts written in C on Ubuntu 14.4?如何配置 lighttpd 网络服务器以在 Ubuntu 14.4 上运行用 C 编写的 CGI 脚本?
【发布时间】:2016-01-06 21:32:35
【问题描述】:

我之前看过一个类似的问题,但没有成功。 如果有人之前尝试过或知道如何操作,请按照以下步骤操作。

我找到了一些线程,但没有任何东西对我有用,例如这个: Configuring lighttpd to handle CGI C executables

这正是我所做的:
1-我在 VM 上安装了 Ubuntu 14.4 的新副本。
2- 我按照此 URL 中的步骤安装 lighttpd 网络服务器和 PHP(仅安装​​部分): https://www.scandio.de/2012/11/setting-up-a-lightweight-webserver-with-lighttpd-php5-and-sqlite3/

3- 完成安装部分后,我在http://www.acmesystems.it/foxg20_cgi 执行了这些步骤

但我在更改 /etc/lighttpd/lighttpd.conf 文件时尝试了多次甚至许多可能性和试验,但没有增益 ...

如果有人有想法,请分享 谢谢:)

【问题讨论】:

    标签: ubuntu cgi lighttpd


    【解决方案1】:

    配置 lighttpd 以运行用 C 编写的 CGI 与配置 lighttpd 以运行用任何解释性语言编写的 CGI 相同。

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

    https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModCGI

    您的 C 代码可能没有使用 CGI/1.1 协议响应,发送响应标头后跟一个空行,然后是响应正文。

    【讨论】:

      猜你喜欢
      • 2019-08-06
      • 1970-01-01
      • 1970-01-01
      • 2013-08-26
      • 2011-01-31
      • 1970-01-01
      • 2016-12-08
      • 1970-01-01
      相关资源
      最近更新 更多