[問題] 請問一個CGI & thttp 的問題
先說明我的作業系統是 ubuntu,
架設Server是使用thttpd(因為之後要移植到arm板子上, 板子也是用thttpd)
我的thttpd.conf設定檔內容如下(一些註解在此先拿掉了):
#============= thttpd.conf ==============
dir=/home/httpd/html
user=root
logfile=/var/log/thttpd.log
pidfile=/var/run/thttpd.pid
port=80
cgipat=/cgi-bin/*
最近在練習用C語言寫簡單的CGI, 程式碼如下:
//================= HelloWorld.c =================
#include <stdio.h>
int main(void)
{
printf("Content-type: text/html\n\n");
printf("Hello___World");
return 0;
}
接著再使用 gcc HelloWorld.c -o HelloWorld.cgi
編譯完成後放到/home/httpd/html/cgi-bin/ 底下
並且在Browser輸入 http://localhost/cgi-bin/HelloWorld.cgi
結果都無法順利看到印出 "Hello___World"的網頁
反而每一次都變成下載"HelloWorld.cgi"這個檔案 Orz
請問有人有遇過相同經驗嗎? 是thttpd.conf設定有問題? 還是需要再加裝甚麼套件嗎??
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.195.197.27
※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1427994405.A.6AF.html
推
04/03 01:12, , 1F
04/03 01:12, 1F
→
04/03 11:05, , 2F
04/03 11:05, 2F
→
04/03 11:06, , 3F
04/03 11:06, 3F