[Chugalug] OT maybe, python and apache

Garrett Gaston garrett85 at hotmail.com
Tue Nov 13 16:56:08 UTC 2012


Both files have rx on both user and others, I think the permissions are 755. I created two files, one under /var/www/file.cgi and another under /var/www/cgi-bin/file.cgi. I had read where the file might need to be named with a .cgi extension or that it might need to be placed in a sup directory called cgi-bin. So I created two files both with .cgi extensions but one file is one more level down in cgi-bin directory right under /var/www/.

Date: Tue, 13 Nov 2012 09:27:32 -0700
From: ebwolf at gmail.com
To: chugalug at chugalug.org
Subject: Re: [Chugalug] OT maybe, python and apache

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




_______________________________________________
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/40393ea4/attachment.html>


More information about the Chugalug mailing list