在 lighttpd 上运行本机二进制 CGI
我正在尝试设置 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
文档: http://redmine.lighttpd.net/wiki/1/Docs:ModCGI< /a>
我使用 tcl 脚本作为 cgi 进行了测试,这是我的工作配置:
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:
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