Sorry, but, that is not correct.
If you have done a reasonable job of setting up your apache server, it will NOT serve a text file directly from your cgi-bin. You can write a cgi application to read and output a text file, but the server will not do it (unless you do something to tell the server to do it).
In general, there are two locations from which apache will generate output in response to a HTTP request. The first is the 'html' or 'htdocs' directory and its sub-directories. From the 'html' directory, apache will certainly server text. The second location is the cgi-bin directory and its sub-directories. For security reasons, apache will only return output from this as the result of running a well-behaved CGI app. Case in point: CGI apps written in Perl are just text files. If apache allowed the general public to see the text of a Perl/CGI it would make that CGI a prime target for hacking.
That having been said (typed), you can certainly corrupt this separation of html and cgi directories and sometimes with good reason. I WOULD NEVER DO THIS ON A SERVER THE PUBLIC COULD SEE. You can put a link from your html directory to the front of your cgi directory.
html path
/var/
cgi-bin path
/var/
link from html to cgi-bin
ln -s /var/
/var/
If you created that link, you'd be able to hit:
and see the cgi-bin directory structure. THIS REPRESENTS A HUGE SECURITY RISK! YOU WILL BE SHOWING ANY ONE WHO CAN HIT THAT SERVER EXACTLY WHAT YOUR CGI CODE LOOKS LIKE....NOT A GOOD IDEA. One good reason for doing this is, on a development platform, you can keep your html and cgi code in the same sub directory of your cgi path..... a little convinience.
Please see the apache documenation on it security measures and please take a look at
'hope this helps
If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.