无法浏览 thttpd 的程序

zzxap 2010-05-10 04:43:19
1. 下载编译 thttpd,
tar –xzpvf thttpd-2.25b.tar.gz
./configure
make
make install
2. 启动: ./thttpd -d . -c "cgi-bin/**"
3. 做一个 CGI 程序放在 cgi-bin 目录, 如 demo.cgi
4. 浏览器输入地址测试: http://127.0.0.1/cgi-bin/index.html

index.html

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

demo.cgi

#include <stdio.h>
int main(){
//printf("Content-Type:text/plain;charset=us-ascii\n\n");
//printf("Hello World\n\n");
return 0;
}

浏览时显示:
403 Forbidden
The requested URL '/cgi-bin/index.html' resolves to a file that is not world-readable.
--------------------------------------------------------------------------------

thttpd/2.25b 29dec2003
...全文
188 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
pottichu 2010-05-11
  • 打赏
  • 举报
回复
cgi 程序能浏览吗?

另外,你用什么用户启动 thttpd 的?
zzxap 2010-05-11
  • 打赏
  • 举报
回复
hellow.cgi 要生成放在 cgi-bin目录才行
zzxap 2010-05-11
  • 打赏
  • 举报
回复
-u root
iisbsd 2010-05-10
  • 打赏
  • 举报
回复
检查index.html文件的权限和拥有者。

23,120

社区成员

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

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