[Chugalug] OT maybe, python and apache
Garrett Gaston
garrett85 at hotmail.com
Tue Nov 13 16:51:28 UTC 2012
Dan, on the script you just sent me back:
ScriptAlias /cgi-bin/ /home/danlyke/websites/flutterby.net/cgi-bin/
<Directory "/home/danlyke/websites/flutterby.net/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
What file did you find this in? Looking through my /etc/apache2 directory I found several files with ScriptAlias, <Directory ..., and ExecCGI.
I ended up making copies (file.orig) of every file that contained ExecCGI & <Directory...> and editing the original by adding /home/var/www to
the <Directory... > field.
I see you have "ScriptAlias /cgi-bin" What exactly is that for? It appears to me to be a directory right under / but then you give another path
to cgi-bin far below your home directory. One last thing. You'll notice that I have the file name simple1.cgi, are you saying that it should
by .py?
> Date: Tue, 13 Nov 2012 08:33:24 -0800
> From: danlyke at flutterby.com
> To: chugalug at chugalug.org
> Subject: Re: [Chugalug] OT maybe, python and apache
>
> On Tue, 13 Nov 2012 10:21:38 -0600
> Garrett Gaston <garrett85 at hotmail.com> wrote:
> > 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.
>
> Two problems, one of which I know what the answer to is. Let's start
> with the unknown one first: Your Apache isn't running your app as a
> CGI. I do something like:
>
> ScriptAlias /cgi-bin/ /home/danlyke/websites/flutterby.net/cgi-bin/
> <Directory "/home/danlyke/websites/flutterby.net/cgi-bin">
> AllowOverride None
> Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
> Order allow,deny
> Allow from all
> </Directory>
>
>
> To make http://localhost/cgi-bin/test.py run
> from /home/danlyke/websites/flutterby.net/cgi-bin/
>
> The second is easy:
>
> > #!/usr/bin/python3
> > print('Content-type: text/plain')
>
> You need a blank line between the headers and the content, so add a
> line here that says:
>
> print('')
> > # prints an empty line, to end the headers
> > print('Testing Python CGI')
>
> Dan
> _______________________________________________
> 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/b1806be5/attachment.html>
More information about the Chugalug
mailing list