thttpd CGI

Raul_Shao 2007-07-23 12:32:30
本人已经架设了thttpd的服务器,但是在表单中调用cgi程序的时候怎么不行啊?老是出错,初学者,请指教!

//index.html

<FORM ACTION="cgi.cgi">
<INPUT TYPE="SUBMIT" VALUE="OK">
</FORM>

//cgi.cxx,空白页;
#include <stdio.h>
int main()
{
return 0;
}

// makefile;
cgi.cgi: cgi.cxx
g++ -o cgi.cgi cgi.cxx

在点击OK按钮的时候出现如下错误:
500 Internal Error
There was an unusual problem serving the requested URL '/cgi.cgi?'.

请大虾指教
...全文
1567 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wky_ru 2011-10-14
  • 打赏
  • 举报
回复
楼主……我现在出现同样的问题 不知道该怎样解决呢 一定要静态编译吗
againyuan 2008-07-10
  • 打赏
  • 举报
回复
请问楼主是怎么样解决的?
我也有同样的问题
Raul_Shao 2007-07-27
  • 打赏
  • 举报
回复
我现在可以了,下载下来的安装文件下面有个cgi-src文件夹,里面有例子,例如phf。
我模仿了一下这个程序就成功了,我发现主要的原因是他的makefile编译选项里面有个static。
我去掉static之后编译也能成功,但是编译出来的程序可以单独运行,但是在网页调用cgi的时候就失败了。

这样,问题就来了,如果全部用static编译的话,编译出来的cgi会很大,特别是我要调用几个很大的库,他们也要被静态的编译进去。对于空间是一个问题。


不知道有没有人知道,thttpd的cgi是不是一定要静态编译。如果不是的话,应该怎么搞才能让网页调用我编译的cgi?
Raul_Shao 2007-07-27
  • 打赏
  • 举报
回复
# This section overrides defaults
dir=/usr/local/dma/util/thttpd/data
chroot
#user=httpd# default = nobody
logfile=/usr/local/dma/util/thttpd/log/thttpd.log
pidfile=/usr/local/dma/util/thttpd/run/thttpd.pid
# This section _documents_ defaults in effect
# port=80
# nosymlink# default = !chroot
# novhost
cgipat=/cgi-bin/*
# nothrottles
# host=0.0.0.0
# charset=iso-8859-1
Wang_SG 2007-07-24
  • 打赏
  • 举报
回复
thttpd 的配置文件配的怎么样?

dir=/usr/local/www/data
root
cgipat=**.cgi
logfile=/usr/local/www/logs/thttpd_log
pidfile=/var/run/thttpd.pid

23,125

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧