CGI-bin returns source not HTTP document?

CGI-bin returns source not HTTP document?

Post by Peter Salciu » Thu, 10 Jun 1999 04:00:00



Hello people:

Another annoying beginner. I am trying to teach myself more about CGI
scripting for server side forms. Since my commercial ISP doesn't allow
access to a cgi-bin dir, I am trying to use the Apache server that came
with my RH LINUX. So far all I get back are the unprocessed source
documents. Anybody out there have the magical KNOW that will allow me to
process server side forms in/on the privacy of my own box?

Thanks in advance,

Peter Salcius

 
 
 

CGI-bin returns source not HTTP document?

Post by Jon Ske » Thu, 10 Jun 1999 04:00:00



> Another annoying beginner. I am trying to teach myself more about CGI
> scripting for server side forms. Since my commercial ISP doesn't allow
> access to a cgi-bin dir, I am trying to use the Apache server that came
> with my RH LINUX. So far all I get back are the unprocessed source
> documents. Anybody out there have the magical KNOW that will allow me to
> process server side forms in/on the privacy of my own box?

You need to check at least three things:

1) The scripts you're trying to run have execute permission for the
appropriate user (whichever user apache is running as)

2) They scripts have appropriate extensions, such as .cgi or .pl

3) The Apache config scripts (access.conf and srm.conf are the
appropriate ones, I think) are set up to allow cgi access from the
appropriate directory and the handlers are present (eg the line
AddHandler cgi-script .cgi is present and uncommented in srm.conf)

The .conf files are fairly readable - have a play around with them,
restarting the server each time you change them, and best of luck!

--

http://www.pobox.com/~skeet/

 
 
 

CGI-bin returns source not HTTP document?

Post by Jeremy L. Buchman » Fri, 11 Jun 1999 04:00:00


:> Another annoying beginner. I am trying to teach myself more about CGI
:> scripting for server side forms. Since my commercial ISP doesn't allow
:> access to a cgi-bin dir, I am trying to use the Apache server that came
:> with my RH LINUX. So far all I get back are the unprocessed source
:> documents. Anybody out there have the magical KNOW that will allow me to
:> process server side forms in/on the privacy of my own box?

: You need to check at least three things:

: 1) The scripts you're trying to run have execute permission for the
: appropriate user (whichever user apache is running as)

Usually this is done by 'chmod a+x scriptname' which gives everyone
execute permissions.  

: 2) They scripts have appropriate extensions, such as .cgi or .pl

I've never found this to be necessary, myself.  None of my scripts (that
all work fine) have extensions...I just call them 'getCount' or something
like that...but extensions do make directory listings easier to read.
This works fine in the latest apache and the web server that comes with
Digital UNIX.

: 3) The Apache config scripts (access.conf and srm.conf are the
: appropriate ones, I think) are set up to allow cgi access from the
: appropriate directory and the handlers are present (eg the line
: AddHandler cgi-script .cgi is present and uncommented in srm.conf)

: The .conf files are fairly readable - have a play around with them,
: restarting the server each time you change them, and best of luck!

I don't know what version came with RH, but the newest version I grabbed
off the net had all of it's config stuff in httpd.conf...kinda nice since
messing with three config files (the old way) really sucked.  Anyway, what
you're looking for is something like this:

# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.  
#
    Options Indexes FollowSymLinks ExecCGI
                                   ^^^^^^^
That's the keyword.  There's also plenty more config stuff in there you
need to read/change, but like the previous poster said, it's fairly easy
to follow.

One last note: CGI itself is pretty easy...it's the scripting languages
that'll throw you.  Most of the info on the web makes it sounds really
hard.

-------------------------------------------------------------------
Jeremy Buchmann       "Those who trade freedom for safety deserve

-------------------------------------------------------------------

 
 
 

1. cgi-bin/view-source?cgi-bin/view-source

This line is out of my Web server log file:

ultra.mpls.k12.mn.us - - [09/Apr/2000:01:44:55 -0500] "GET /cgi-bin/view-source?cgi-bin/view-source HTTP/1.0" 404 213

This line is the only one from this IP address in the log file.
Does anybody know what this is intended to do? I didn't find any hints on a program
view-source. Is it kind of phf or aglimpse?

Thanks,
Andre

Andre van Straaten
http://www.vanstraatensoft.com
______________________________________________

2. Still problems with WU-FTP 2.4.2

3. /cgi-bin/phf /cgi-bin/test-cgi /cgi-bin/handler

4. Please help a newbie with filter

5. Apache virtual host - cgi-bin always refer back to main document root !?

6. dump(1): how to calculate the tape density?

7. Help, cgi-bin script "random" will only return last url in random list.

8. [no subject]

9. How could let CGI run not only at cgi-bin?

10. http://host/~user/cgi-bin/test.cgi <-- i see a txt file

11. apache: cgi script not in cgi-bin

12. Best cgi-bin config 4 https?

13. how to read http://localhost/cgi-bin/test-cgi??