[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-WebCGI] Viewing a file inside a cgi-bin?



--- Riccardo Perotti <perotti@pobox.com> wrote: > Hi
all:

I would not recommend placing the file where anyone
can red or write to it. You are asking for trouble. =)

If you are using an Apache server, try the following:

Set your CGI-BIN to 'execute' only. Have the
guestbook.cgi script save its data as a
'write/execute' text file in a sub-directory of the
CGI-BIN.

Then use an SSI to include the text data in an HTML
file, which can be placed anywhere.

That way, the text data can be read by anyone, but
only as part of an HTML page, and can only be written
to via your guestbook.cgi.

This stops anyone tampering with the text file.

Hope that helps. I am sure someone can come up with a
simpler solution though.

ATB

Richard

> 
> I have a newbie problem:
> 
> I wrote a guestbook script that writes to my
> "guestbook.htm" file. I put
> this file inside the cgi-bin so it could be written
> to, but now, obviously,
> nobody can view it and they get a 500 internal
> server error.
> 
> What is the right way to do this? Should I put the
> .htm file outside the
> cgi-bin and set  write permissions on it?
> 
> Thanks,
> 
> Riccardo Perotti
> --
> mailto:perotti@pobox.com
> 
> 
> 
> ==== Want to unsubscribe from this list?
> ==== Send mail with body "unsubscribe" to
macperl-webcgi-request@macperl.org


__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org