D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Tuesday teaser: httpd



Quoting MATTHEW BROWNING <M.Browning@xxxxxxxxxxxxxx>:

> Now, let's consider the simplest script imaginable, such as:
> 
> #!/bin/sh
> echo "Content-type: text/html"
> echo
> echo "<html>"
> echo "hello world"
> echo "</html>
> #ends
> 
> Does anyone have any anecdotal suggestions, perhaps based upon 
> experience, as to why that won't print 'hello world' in my browser?

What error are you getting? Server Error 500?  Have a look at the end of the 
Apache error.log file for clues, and also access.log  Does your httpd setup 
serve a static html file ok?

Also I've never tried a cgi script using bash before, but in Perl I write.

print "Content-type: text/html\n\n"

The extra \n's are important. 

Pete Hatton
---------------------------------
E-mail:  pete@xxxxxxxxxxxxx
Webpage: http://www.monolight.org
---------------------------------

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.


Lynx friendly