![]() |
|
|||||||
| Register | >> Amiga FAQ/Wiki << | Rules & Help | Members List / Moderators List | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Registered User
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 157
|
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
__________________
Tygre -- "I have seen things you people would not believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time like tears in the rain. Time to die." Roy Batty - Blade Runner |
|
|
|
|
|
#2 | ||
|
Registered User
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 157
|
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
__________________
Tygre -- "I have seen things you people would not believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time like tears in the rain. Time to die." Roy Batty - Blade Runner |
||
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 157
|
Dear all!
I spent sometime on THTTPd and finally found reasons to my problems and some solutions:
, I managed to recompile both THTTPd v2.21 and 2.25, to change the limit of POST'ed data in THTTPd v2.21 (SAPI_POST_BLOCK_SIZE), and to "fork" CGI processes in THTTPd v2.25 (IXEmul and ix_vfork()). Now, my Wiki should just work as desired! I will post more explanations later...Cheers! Tygre
__________________
Tygre -- "I have seen things you people would not believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time like tears in the rain. Time to die." Roy Batty - Blade Runner |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 157
|
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"? ![]()
__________________
Tygre -- "I have seen things you people would not believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time like tears in the rain. Time to die." Roy Batty - Blade Runner |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 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 |