[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [TEKNIK] CGI headers i Apache 1.3.9



On Mon, Apr 24, 2000 at 18:01:58 +0200, Martin Skøtt wrote:

> Til et lille hjemme/skole projekt skal jeg afvikle et par Python
> programmer som CGI på en Apache 1.3.9 (den RPM som er med i Red Hat
> 6.1). Jeg får flg. fejl når jeg prøver at køre mit script
> (cgi-bin/html.py):
> malformed header from script. Bad header=<HTML>:
> /home/httpd/cgi-bin/html.py
> 
> <HTML> er den første linie output fra mit test script. Hvad er det
...

Det er de headere du ikke kan se.
Prøv f.eks. på en maskine hvor der er en webserver kørende
at kalde med telnet:

>>telnet www.sslug.dk 80
GET /dummy HTTP/1.0


og afslut med 2 x <enter>

Du vil f.eks. se:
..................klip.................
HTTP/1.1 404 Not Found
Date: Mon, 24 Apr 2000 18:30:31 GMT
Server: Apache/1.3.3 (Unix) Debian/GNU PHP/3.0.5
Connection: close
Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>404 Not Found</TITLE>
</HEAD><BODY>
<H1>Not Found</H1>
The requested URL /dummy was not found on this server.<P>
</BODY></HTML>
..................klip.................

De headere der måske tænkes på er de første før den tomme linie.
Se RFC'ere, f.eks. RFC2068 (kan findes på sunsite.auc.dk)

Anvender du HTTP 0.9 er der ingen headere, men apache vil måske brokke sig.

Jeg vil mene at HTTP/1.0 og Content-type er nødvendige, dog 
apache  isætter selv nogle på HTTP linien mv., så kun Content type 
behøves, eller i det mindste en blanklinie for at signalere slutning
på HTTP headere.

Men check med telnet hvad du får og sammenling med RFC eller nogle andre sider.

Jeg har ofte i shell-cgi script som noget af det første der sendes:
# Header produzieren
echo 'Content-type: text/html'
echo ''


En god bog var tidligere "webmaster in a nutshell" fra O'Reilly.
(hvis den stadig kan fås)


-- 
mvh Frank Damgaard  | http://home3.inet.tele.dk/frda/



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 21:38 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *