cancel
Showing results for 
Search instead for 
Did you mean: 

problems with reading html on cgi server

N/A

problems with reading html on cgi server

Dear all, for a few years I've happily been using the following little script, given to me by Force9, to allow people to read a guestbook html file which is situated on the cgi server:
#!/bin/bash
echo Content-type: text/html
echo
cat guestbook.htm

But since the perl upgrade lots of people are complaining that when they click the link to this file, which is called read.cgi, they get an Internal Server Error page instead. Rather oddly, some other people are still able to view the correct page.
I'm not a programmer- can anyone suggest what might be wrong? The guestbook.htm file has to be on the cgi server so that people can write to it using another cgi script.
Paul Doyle
7 REPLIES
N/A

problems with reading html on cgi server

Could possibly be due to a change in the paths. I used to use /files/local/home/didit/ for all of my scripts, with the upgrade it has become /files/home/didit. I could access the script okay, but people from outside of F9 had a problem.

Regards

Mark
N/A

problems with reading html on cgi server

Thanks Mark.
Does this mean I need to change the line #!bin/bash to something else? There isn't a lot else that can be changed!
Cheers
Paul
N/A

problems with reading html on cgi server

My shebang line is #!/usr/bin/perl which appears to be totally different to yours for some reason. The path you need to specify will be in the .pl file itself and it is where the script will look to publish whatever information is provided in your form.

Regards

Mark
N/A

problems with reading html on cgi server

isn't he using bash rather than perl though? Is that applicable?
N/A

problems with reading html on cgi server

Yes -- "bash" is a "shell": Bourne Again Shell. His CGI program is a shell script.

Edit: Corrected the spelling of "Bourne" (was Borne).
N/A

problems with reading html on cgi server

OK, I've overcome this hurdle by moving the htm files outside of the cgi-bin, and linking to them directly, and not using the short bash scripts.
Now the main problem- the guestbook cgi script isn't working. The file guest.cgi runs from the guestbook form htm file called guest.htm. When the form is filled in and submitted the "thankyou" screen appears (at least that part of the cgi script seems to work) but nothing gets added to the main guestbook htm file (now outside the cgi-bin directory, in a directory called news) and the mailserv part also isn't working. I've checked permissions on the files- the cgi script has read and execute, the htm files have read and write. Any idea why the form posting isn't adding to the guestbook.htm file?
Here are the locations- cgi.wildlifeweb.co.uk/news/guestbook.htm, cgi.wildlifeweb.co.uk/news/guest.htm and cgi.wildlifeweb.co.uk/cgi-bin/birdnews/guest.cgi.
N/A

problems with reading html on cgi server

I managed to sign your book and got a response to say I had signed it and what I wrote, but it hasn't placed it within the page as you reported. Html files normally are set to 666 (in my limited experience). Are you sure you have the file path correct in the script now that you have moved them outside of the cgi-bin? Should probably be /files/home/wildlifeweb/news/guestbook.htm, make sure you haven't put the URL in instead.

Mark