Results 1 to 10 of 10

Thread: please help me get CGI TO WORK on APACHE

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2001
    Posts
    746

    please help me get CGI TO WORK on APACHE

    i make some .py files with python and put them in my cgi-bin on my apache server but when i typed in there location on my internet explorer it just brought up a page saying Internel Server Error. so i searched the web for how to enable cgi on apache and tried a bunch of things and i still get the same error. can someone help?

  2. #2
    scoutt
    Guest
    Apache doesn't recognize the .py extension as cgi. you will have to make some adjustments and add the shebang line in your script.

    on this line you may have to add the py extension

    AddHandler cgi-script .cgi .pl .py // you may have to uncomment it. just delete #

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2001
    Posts
    746
    now it just says the page could not be found. do u know why?

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2001
    Posts
    746
    and when i go to the cgi-bin it says page isnt found instead of what it used to say which is somethin like forbidden

  5. #5
    scoutt
    Guest
    you have to make sure your directory in httpd.conf is the same as the one you are running the scripts in.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2001
    Posts
    746
    below is the section of my configuration files that pertains to cgi. is it setup right?

    also the file i have been editin is the file under configure apache server in the start menu/program files / apache server etc.


    ScriptAlias /cgi-bin/ /usr/local/apache/share/cgi-bin

    #
    "C:/Program Files/Apache Group/Apache/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    <Directory "C:/Program Files/Apache Group/Apache/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
    </Directory>

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2001
    Posts
    746
    i now changed it to this and when i try to go to my cgi bin like this 24.10.112.194/cgi-bin/ it just says page not found.

    ScriptAlias /cgi-bin/ /usr/local/apache/share/cgi-bin

    #
    #"C:/Program Files/Apache Group/Apache/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    <Directory "C:/Program Files/Apache Group/Apache/cgi-bin/">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
    </Directory>

  8. #8
    scoutt
    Guest
    are you running Linux? I think you are not so it should look like this
    Code:
    ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"
    	
        #
        # "C:/Program Files/Apache Group/Apache/cgi-bin" should be changed to whatever your ScriptAliased
        # CGI directory exists, if you have that configured.
        #
        <Directory "C:/Program Files/Apache Group/Apache/cgi-bin"> 
    	AllowOverride None
    	Options +ExecCGI
    	Order allow,deny
    	Allow from all
        </Directory>
    all cgi scripts will have to be run in this directory.

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2001
    Posts
    746
    Now a page pops up sayin Internal Server Error and some other stuff. id appreciate some further help.

  10. #10
    scoutt
    Guest
    does python need an interpreter?

    your address you type in to see your page is 127.0.0.1/cgi-bin/ or localhost/cgi-bin

    not 24.10.112.194/cgi-bin unless you are setup as a server for outside people to get in as well.

    it all depends on what you set it up as in your httpd.conf file. are you using the apache to run a server so everybody can see your page, or are you using it to test scripts you write?

    read this as I think you need it
    http://www.modpython.org/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width