setting up apache/cgi stuff...osx

Discussion in 'Mac Help/Tips' started by jvaska, Sep 29, 2002.

  1. jvaska macrumors 6502

    Feb 18, 2002
    i've been following this article to a tee...and i get all the same results...

    ++++++++++++++ just skim through this part +

    If CGI access is turned on already, we should be able to reach and see a happy result, right? If you went to that URL, however, you were probably greeted by a not so joyous response: "FORBIDDEN". Apache screams, "You don't have permission to access /cgi-bin/test-cgi.

    Huh? Why didn't this work? Now is a perfect time to prove how useful the Apache web server logs can be. If you recall the results of our httpd -V command above, Apache's access file is located in /var/log/httpd/access_log. Let's look at the very last lines of that file, easily reached with this command:

    tail /var/log/httpd/access_log

    You'll see that the last line looks similar to: - - [19/Nov/2001:21:59:46-0500]
    "GET /cgi-bin/test-cgi HTTP/1.1" 403 292

    Quickly, this line shows where the access request came from (, the time the file was requested, the protocol used (HTTP/1.1), the response code (403), and the size of the response (292 bytes). This is all fine and dandy, but doesn't tell us what went wrong. For this, we'll dip into our error log (also pinpointed by the httpd -V command):

    tail /var/log/httpd/error_log

    And we see:

    [Mon Nov 19 21:59:46 2001] [error] [client]
    file permissions deny server execution:

    Bingo! This tells us exactly what went wrong -- the file permissions were incorrect. For Apache to run a CGI script, the script in question needs to have "execute" permissions. To give the test-cgi file the correct permissions, we run:

    cd /Library/WebServer/CGI-Executables
    chmod 755 test-cgi

    ++++++++++++++++++++++++++ end ++

    yes, but...when i chmod "test-cgi" in my terminal window i get...

    "chmod: test-cgi: Operation not permitted"

    i think my permissions are messed up or something...anybody have any advice about this? also...when i tried opening up these files directly with dreamweaver mx it said these files were locked but that i could view them only...

    how do i resolve this?

    thanks in advance...jv
  2. alex_ant macrumors 68020


    Feb 5, 2002
    All up in your bidness
    I think your problem is that you (whatever user account you are) doesn't have permission to change the permissions on test-cgi. In the Terminal, try "ls -l /Library/WebServer/CGI-Executables" and find out who the owner & group of the file are, and change them if necessary (with chown & chgrp). You will probably have to su to root (or use sudo, by appending the word "sudo" to whatever command you type) to do this. THEN do the "chmod 755".
  3. jvaska thread starter macrumors 6502

    Feb 18, 2002
    wow...i fixed it!


    the next problem i am trying to find this httpd.conf file. i've found it doesn't have the information i'm supposed to edit in order to turn on SSI and some other things...

    (edit)...i managed to figure this out...i did the easy...and installed my handy copy of bbedit and setup the unix tools...geezus does it make life easy...problem solved...

    now...the ONLY thing that doesn't work...and i've followed all the instruction to a T - are the SSI's. but...i guess i don't care really...since i'm doing all of this so i can get more involved with php...

    now...setting us mysql...i think this will be the hard part...

    (edit)...mysql was a works...for record...if anybody reads this forum trying to setup apache/cgi/php/mysql stuff...this is the place to go now ->

    thanks for the good help...jv

Share This Page