当前位置: 技术问答>linux和unix
无法浏览 thttpd 的程序
来源: 互联网 发布时间:2016-08-26
本文导语: 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...
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
demo.cgi
#include
int main(){
//printf("Content-Type:text/plain;charset=us-asciinn");
//printf("Hello Worldnn");
return 0;
}
浏览时显示:
403 Forbidden
The requested URL '/cgi-bin/index.html' resolves to a file that is not world-readable.
--------------------------------------------------------------------------------
thttpd/2.25b 29dec2003
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
demo.cgi
#include
int main(){
//printf("Content-Type:text/plain;charset=us-asciinn");
//printf("Hello Worldnn");
return 0;
}
浏览时显示:
403 Forbidden
The requested URL '/cgi-bin/index.html' resolves to a file that is not world-readable.
--------------------------------------------------------------------------------
thttpd/2.25b 29dec2003
|
检查index.html文件的权限和拥有者。
|
cgi 程序能浏览吗?
另外,你用什么用户启动 thttpd 的?
另外,你用什么用户启动 thttpd 的?