[Chugalug] OT maybe, python and apache

Eric Wolf ebwolf at gmail.com
Tue Nov 13 16:27:32 UTC 2012

Is the execute permission set so the apache user can run the script?
On Nov 13, 2012 9:22 AM, "Garrett Gaston" <garrett85 at hotmail.com> wrote:

>  I'M trying to get the below python cgi output to load in my web browser
> but the browser is just displaying the code it's self instead of the
> output. My apache program is working because I just tried the phpinfo
> function and it worked just fine. I'M getting this code from a book and
> it's actually showing "#!/usr/bin/env python" but I decided to use what I
> got with the *which* command "which python3" -> */usr/bin/python3*
> I have one copy of the file in /var/www and another in /var/www/cgi-bin.
> I've also used grep and vi to find and edit every file in /etc/apache2 that
> contains "ExecCGI' and I've removed that # in front of it hoping to turn on
> apache's cgi function. Could someone please tell me what I've done wrong
> here? Thanks.
> <file is simple1.cgi>
> #!/usr/bin/python3
> print('Content-type: text/plain')
> # prints an empty line, to end the headers
> print('Testing Python CGI')
> _______________________________________________
> Chugalug mailing list
> Chugalug at chugalug.org
> http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://chugalug.org/pipermail/chugalug/attachments/20121113/6a3c97db/attachment.html>

More information about the Chugalug mailing list