|
-
Sep 9th, 2001, 02:29 PM
#1
Thread Starter
Fanatic Member
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?
-
Sep 9th, 2001, 05:17 PM
#2
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 #
-
Sep 9th, 2001, 06:04 PM
#3
Thread Starter
Fanatic Member
now it just says the page could not be found. do u know why?
-
Sep 9th, 2001, 06:07 PM
#4
Thread Starter
Fanatic Member
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
-
Sep 9th, 2001, 06:51 PM
#5
you have to make sure your directory in httpd.conf is the same as the one you are running the scripts in.
-
Sep 10th, 2001, 02:57 PM
#6
Thread Starter
Fanatic Member
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>
-
Sep 10th, 2001, 03:03 PM
#7
Thread Starter
Fanatic Member
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>
-
Sep 10th, 2001, 04:05 PM
#8
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.
-
Sep 10th, 2001, 07:36 PM
#9
Thread Starter
Fanatic Member
Now a page pops up sayin Internal Server Error and some other stuff. id appreciate some further help.
-
Sep 10th, 2001, 08:35 PM
#10
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|