[Klone-users] help with klone cgi
Mark Richards
mark.richards at massmicro.com
Sun Sep 13 10:57:32 EDT 2009
Stefano Barbato , On 9/12/2009 05:30:
>
> That's probably because the cgi does not send back the proper
> Content-type header field (should be text/html for web pages).
> Browsers spawn the save dialog for any content-type they cannot
> display inline and for each unknown content-type.
>
> Could you send us the verbatim response of the cgi (including the
> response header)?
Stefano.
Thanks for your answers so far. And great to hear from you!
Here's the headers and a little more :) below...
There seem to be two problems, but I am trying to stay with one at a time :)
*** Issue 1: my script_alias seems to be ignored.
http://192.168.1.29:8087/
(index.kl1):
GET / HTTP/1.1
Host: 192.168.1.29:8087å,z(
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3)
Gecko/20090824 Firefox/3.5.3å,z(
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8å,z(
Accept-Language: en-us,en;q=0.5å,z(
Accept-Encoding: gzip,deflateå,z(
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7å,z(
Keep-Alive: 300å,z(
Connection: keep-aliveå,z(
Cookie: klone_sid=5c85e0b8605a2f4469dd27b3712faf2bå,z(
HTTP/1.0 200 OK
Server: klone/2.1.0å,z(
Date: Sat, 12 Sep 2009 19:11:35 GMTå,z(
Content-Type: text/htmlå,z(
Cache-Control: no-cache, must-revalidateå,z(
Expires: Mon, 1 Jan 1990 05:00:00 GMTå,z(
Pragma: no-cacheå,z(
and the cgi:
Test 1** Test fails when web address points to cgi:
http://192.168.1.29:8087/cgi/admin/flash.cgi
* note below: as script_alias is set to /cgi /axis-cgi I assume the
target directory is referenced as /www/...
but just to be certain I also put axis_cgi in www/../ (one directory
below www). Get same result:
Not Found
URL: /cgi/admin/flash.cgi
with:
app_http
{
type http
dir_root /www
#dir_alias /cgi/ /axis-cgi/
#dir_alias /admin-bin/ /www/admin-bin/
#dir_alias /axis-release/ /www/axis-release/
addr.type IPv4
addr.port 8087
}
cgi
{
script_alias /cgi /axis-cgi
# .pl and .cgi files will be executed as is
pl.handler exec
cgi.handler exec
}
and:
[root at dev1 klone]# ls webapp/www/axis-cgi/admin/ -ltr
total 280
-rwxrwxrwx 1 root root 278782 Sep 7 15:43 flash.cgi
*** Issue 2:
When directly pointing to the CGI (It's included in the webapp/www
directory), the cgi responds but instead of launching at the server's
commandline it sends the cgi back and therefore presents a save/open dialog.
REQUEST:
GET /axis-cgi/admin/flash.cgi HTTP/1.1
192.168.1.29:8087???
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3)
Gecko/20090824 Firefox/3.5.3???
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8???
en-us,en;q=0.5???
gzip,deflate???
ISO-8859-1,utf-8;q=0.7,*;q=0.7???
300???
keep-alive???
klone_sid=5c85e0b8605a2f4469dd27b3712faf2b???
RESPONSE:
HTTP/1.0 200 OK
klone/2.1.0???
Sat, 12 Sep 2009 19:33:05 GMT???
application/octet-stream???
Mon, 07 Sep 2009 19:43:31 GMT???
278782???
??? is because firefox handles japanese character encoding.
This got me to considering... I did not set the http headers.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
After doing so I get the same response from the CGI.
--
And why not heap on two more (therefore can legitimately say "he has
issues"):
***Issue 3: Although I have been around klone for some time (yet not
active for at least a year until now) I can't seem to figure out if it's
possible to have an external kloned.conf and still use an internal
(kloned-compiled) web page and other stuff (webapps/www...). If
possible, how does one reference "encapsulated" versus "external"
files? I was looking at this as a possible easy way to test the stuff
above.
*** issue 4:I looked at how klone does mime. Apparently mime_types is
built into mime_map.c.
Might be nice to have ability to override with an external file -
perhaps also referenced via kloned.conf?
I can write this change if you thinks it's worthwhile.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://koanlogic.com/pipermail/klone-users/attachments/20090913/449505ea/attachment.htm
More information about the klone-users
mailing list