LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   configuring apache for cgi scripts (https://www.linuxquestions.org/questions/linux-software-2/configuring-apache-for-cgi-scripts-95668/)

ash_r_c 09-22-2003 07:58 PM

configuring apache for cgi scripts
 
I am trying to run python scripts on apache. UN fortunately, each time i click on the submit, the script doesnt execute. Instead the text of the entire script is dumped on the screen ( to the browser). I dont know what setting i need to change in the httpd.conf file to get the scritps running. can anyone please help me with this?

bulliver 09-23-2003 04:03 PM

First off, make sure that your script is executable, and that regular users have permission to execute it. Make sure that the shebang line points to your python interpreter ie: #!/usr/bin/python

Now: You are looking for a section in httpd.conf that looks like this:
Code:

<Directory "/home/httpd/htdocs">

#
# 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 MultiViews

#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
    AllowOverride None

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all
</Directory>

You are going to want to add 'ExecCGI' to the 'Options line:

Code:

Options Indexes FollowSymLinks MultiViews ExecCGI
HSH


All times are GMT -5. The time now is 08:40 AM.