• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • FREE workshop: Preparing contractors for Autumn : Weds 29th Sep at 7.15pm. More details here.

cgi on Cobalt RaQ

  • Filter
  • Time
  • Show
Clear All
new posts

    cgi on Cobalt RaQ

    Can any of you web experts help with a beginner's cgi problem. I cannot even get past first base and execute even the simplest script on a Cobalt RaQ server? e.g.:-

    print "<HTML></HTML>\n";

    I get:
    CGIWrap encountered an error while attempting to execute this script:
    Error Message: Permission denied
    Error Number: 13

    The site setup says cgi execution is enabled.
    It has been uploaded in ASCII as site admin.
    Permissions of file and directory set to read/write/execute.
    The script runs ok in site debug (using the /cgiwrapDir/cgiwrapd/ thing).
    Tried in various different directories, cgi-bin etc. although that's not supposed to matter with Cobalt RaQ.
    Have tried putting /perl--.
    Have tried stripping out CRs (char 13) in hex editor.

    Absolutely bugger all works. Any suggestions gratefully received.

    sorry x, don't know the stuff....serves you right for using an outdated, outclassed technology
    but thoughts...what account is executing the script? are permissions set on the server as well at dir level? what server is it?


      I am not familiar with the raq - but most common problem with people writing cgi code is the lack of a http header. My guess is that in debug mode it puts a false header on to allow you to see all your headers ?

      HTML is the format of the output document, but the delivery mechanism is http, which provides a header which allows among other things errors, redirects etc.

      Typical format (Its about 4 years since I last did this - so forgive me if I am in error ) would be a response code 200 being OK (5xx are redirects, 4xx are errors, 2xx is it worked, plus others), protocol version and message then a mime content type, then a blank line followed by your output.

      So :

      200 HTTP/1.1 OK
      Content-type: text/html

      your current program output is everything from the (HTML) to the (/html) inclusive - using () because I dont thing ezboard allows html type tags in messages.
      for cgi it needs to also provide the header

      If you try doing a telnet to a web server on port 80 and type get index.html (return) you will see the header as well as the output.
      http has lots of other headers defined but I think that this is the absolute mimimum

      modify your code to do

      print "200 HTTP/1.1 OK\nContent-type: text/html\n\n"

      (actually might need \n\r - cant remember...)

      The header is interpreted by the web browser and allows it to decide how to process the following data stream. You might need a Content-length: header as well - but I think that is optional these days most browsers should just take what they get


        Ta guys - will give it a try.

        I'm using outdated technology??? it all seemed spiffingly new fangled to me, didn't even have to feed the paper tape in first.


          It's a perfectly simple error message, the permission denied most likely refers to the web server not being able to read or execute the cgi script. I'd suggest you get a shell prompt up and look at the permission and set it to 555 or something similar. This is UNIX-like, and this "outdated and outclassed" technology actually has some security which has I understand has been removed from more modern technology in the interest of improved ease of use.


            "This is UNIX-like, and this "outdated and outclassed" technology actually has some security which has I understand has been removed from more modern technology in the interest of improved ease of use. "
            ah, i see!


              HTML Comments are not allowed


                RE:cgi on Cobalt RaQ

                Sorry about the previouse. Bugger, this technology

                Try swapping your script extensions

                PL > CGI or
                CGI > PL


                  Re: RE:cgi on Cobalt RaQ

                  curious, why would the file extension make any difference? Surely, this, as I pointed out already, is UNIX and the interpreter loaded is really going to depend on the shell magic ? And, I see that the cgi has the exec magic.

                  Are you thinking of windoze and some weird file association thing from the registry?


                    Come on xogoth - we are all on tenterhooks !

                    Is it working yet - what was the problem ?