在 lighttpd 上运行本机二进制 CGI

发布于 2024-09-26 19:11:40 字数 528 浏览 0 评论 0原文

我正在尝试设置 lighttpd 来运行二进制 CGI 应用程序(不是 PHP 脚本或 smth,而是从 C++ 源编译的二进制文件)。我实际上已经

server.modules = (
...
"mod_cgi"
...
)

取消注释,在 htdocs/app 中有 myApp.exe,然后

cgi.assign = ( "myApp.exe" => "myApp.exe" )

,通过访问 http:// 使所有内容正常工作localhost:8080/app/myApp.exe?p=a&...,我必须在lighttpd根文件夹(服务器的exe所在的位置)中放置一个空的myApp.exe。这实际上很奇怪而且很糟糕,而且并不是所有的 CGI 都能这样工作。将这些操作应用到另一个 CGI 应用程序(在正确调整的 Apache 上完美运行)没有成功。

我做错了什么?

I'm trying to set up lighttpd to run binary CGI app (not PHP script or smth, but a binary file, compiled from C++ source). I actually have

server.modules = (
...
"mod_cgi"
...
)

uncommented, have myApp.exe in htdocs/app, and also

cgi.assign = ( "myApp.exe" => "myApp.exe" )

Then, to make all the stuff work by accessing, say, http://localhost:8080/app/myApp.exe?p=a&..., I had to put an empty myApp.exe in lighttpd root folder (where the server's exe is). It's actually strange and sucks, and also not all CGIs can work that way. Applying these actions to another CGI app (that works perfectly on properly tuned Apache) gave no success.

What am I doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

匿名。 2024-10-03 19:11:40

文档: http://redmine.lighttpd.net/wiki/1/Docs:ModCGI< /a>
我使用 tcl 脚本作为 cgi 进行了测试,这是我的工作配置:

cgi.assign =  ( "" => "/usr/bin/tclsh" )
index-file.names = ("lighttd_test.tcl")

cgi.assign 允许您指定要由特定应用程序处理的文件扩展名。这个例子的意思是:任何文件类型都可以通过/usr/bin/tclsh打开。由于我的索引文件是一个 tcl 脚本,因此我获取了通过脚本的 STDOUT 放入的内容。
如果您想运行二进制可执行文件,可以在此处指定它。
也许这个链接为您提供了一些有关二进制cgi的更多信息: http://redmine.lighttpd.net/issues/ 1256

The docs: http://redmine.lighttpd.net/wiki/1/Docs:ModCGI
I've made a test with a tcl script as cgi and this was my working config:

cgi.assign =  ( "" => "/usr/bin/tclsh" )
index-file.names = ("lighttd_test.tcl")

The cgi.assign allows you to specify file extensions to be handled by specific applications. This example means: Any filetype will be opened through /usr/bin/tclsh. Since my index-file is a tcl script, I get the content which I put through the script's STDOUT.
In case you want to run a binary executable this is the place to specify it.
Maybe this link provides some more info about binary cgi for you: http://redmine.lighttpd.net/issues/1256

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文