11 May 2011, 04:38 | #1 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
|
[Solved] Help with setting up thttpd and CGI
Dear all!
I want to use my Amiga 1200 + Blizzard 1240T as a Web server. I found thttpd to be a nice and lightweigt Web server. Now, I would like to enhance my site with some CGI scripts but I cannot get thttpd to serve them Here is my config, thttpd.conf: host=192.168.0.48 port=80 dir=/T/Web user=nobody cgipat=**.cgi logfile=/T/thttpd.log pidfile=/T/thttpd.pid and here is how I run thttpd: thttpd -C thttpd.conf -D and in "T:Web/" I have a directory "cgi-bin", which contains the command redirect (valid Amiga executable provided along with thttpd) that I renamed redirect.cgi. When I browse the URL http://192.168.0.48/cgi-bin/redirect.cgi, my Web browser offers me to download the file redirect.cgi: it is not executed by the Amiga from thttpd... Am I nuts or what? If I omit the directive "cgipat", then thttpd complains that it cannot find redirect.cgi, as it should be. So it seems to me that thttpd finds the directory, finds the file but for some reason does not want to execute it... Thanks in advance! Yann |
26 November 2011, 05:36 | #2 | ||
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
|
Dear all!
Out of desperation , I decided to compile THTTPd by myself to understand what was going on... and I found some answers! Quote:
Quote:
I'll keep you posted! Cheers! Tygre |
||
04 January 2012, 20:10 | #3 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
|
Dear all!
I spent sometime on THTTPd and finally found reasons to my problems and some solutions:
Now, my Wiki should just work as desired! I will post more explanations later... Cheers! Tygre |
21 June 2012, 23:37 | #4 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
|
Hi all!
Here are some more explanations about the (several) problems that I met. First of all, only THTTPd v2.21bP22 has been "officially" adapted to call PHP (v4.2.3). This version of THTTPd is therefore the best to start with for serving Web pages from an Amiga. However, the version available on Aminet had been recompiled "as is" and the size of the blocks of data allowed to be exchanged between THTTPd and PHP was just too small: 4,000 bytes. To change this number, SAPI_POST_BLOCK_SIZE, PHP (and thus THTTPd) must be recompiled. Second of all, cross-compiling such programs on Windows/Cygwin is a pain for two main reasons: GCC generate sometimes buggy code, as in the case of variadic parameters, which makes it difficult to pinpoint and solve memory problems. Recompiling/porting such programs to the Amiga requires using the IXEmul library, which cannot offer all the support needed to seamlessly recompile UNIX programs for the Amiga, such as fork(). Third, classic Amiga are getting old despite still being young and some memory problems can creep up not from the software side but from the hardware side, due to heat, capacitors... These problems are very, very hard to pinpoint but nothing that a couple of fans and a open case and, eventually, some new capacitors cannot fix... All in all, after some hours of compiling, debugging, modifying, reverting changes, and crying for help , I was able to recompile a working version of THTTPd v2.21bP22 + PHP v4.2.3 while changing the SAPI_POST_BLOCK_SIZE to 65,536 bytes to allow THTTPd and PHP to happily work together. I tried to document all this effort on a Wiki that is running on top of the very THTTPd that I recompiled. Any question or suggestion are welcome and thank you all for your help! Cheers! Tygre PS. Could a kind moderator mark the title of this thread as "solved"? |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SmartFileSystem? [Solved] | IRQBreaker | support.FS-UAE | 2 | 28 October 2012 19:19 |
About CGI:IRC, IRC trolls and EAB accounts (again) | eLowar | project.IRC | 9 | 22 September 2007 10:44 |
CGi-IRC problem | Ian | project.IRC | 15 | 25 November 2003 23:07 |
Question about the CGI IRC | Shatterhand | project.IRC | 4 | 17 December 2002 20:13 |
|
|