Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread Chris Angelico
On Tue, Sep 22, 2015 at 7:36 AM, wrote: > Thank you very much. Can I write .py pages like in PHP or should I > use a framework like Django, Web2py or TurboGears? I recommend using WSGI and a framework that uses it (my personal preference is Flask, but the above will also work). Here are a couple

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
On Monday, September 21, 2015 at 10:29:48 PM UTC+2, alister wrote: > On Mon, 21 Sep 2015 12:51:09 -0700, tropical.dude.net wrote: > > > On Monday, September 21, 2015 at 9:47:33 PM UTC+2, tropical...@gmail.com > > wrote: > >> On Monday, September 21, 2015 at 9:41:29 PM UTC+2, John Gordon wrote: > >

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread alister
On Mon, 21 Sep 2015 12:51:09 -0700, tropical.dude.net wrote: > On Monday, September 21, 2015 at 9:47:33 PM UTC+2, tropical...@gmail.com > wrote: >> On Monday, September 21, 2015 at 9:41:29 PM UTC+2, John Gordon wrote: >> > In <44e870a7-9567-40ba-8a65-d6b52a8c5...@googlegroups.com> >> > tropical.du

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
On Monday, September 21, 2015 at 9:47:33 PM UTC+2, tropical...@gmail.com wrote: > On Monday, September 21, 2015 at 9:41:29 PM UTC+2, John Gordon wrote: > > In <44e870a7-9567-40ba-8a65-d6b52a8c5...@googlegroups.com> > > tropical.dude@gmail.com writes: > > > > > print("Content-Type: text/html;c

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
On Monday, September 21, 2015 at 9:41:29 PM UTC+2, John Gordon wrote: > In <44e870a7-9567-40ba-8a65-d6b52a8c5...@googlegroups.com> > tropical.dude@gmail.com writes: > > > print("Content-Type: text/html;charset=utf-8") > > print("Hello World!") > > As I recall, you must have a blank line betw

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
On Monday, September 21, 2015 at 9:30:11 PM UTC+2, Albert Visser wrote: > On Mon, 21 Sep 2015 20:41:13 +0200, wrote: > > > Hello everybody, > > > (...) > > > > I created index.py: > > #!/usr/bin/env python > > # -*- coding: UTF-8 -*-# enable debugging > > import cgitb > > > > cgitb.enable() > > p

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread John Gordon
In <44e870a7-9567-40ba-8a65-d6b52a8c5...@googlegroups.com> tropical.dude@gmail.com writes: > print("Content-Type: text/html;charset=utf-8") > print("Hello World!") As I recall, you must have a blank line between the headers and the content. But that may or may not be your problem, as you ha

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
On Monday, September 21, 2015 at 9:20:22 PM UTC+2, sohca...@gmail.com wrote: > On Monday, September 21, 2015 at 11:41:54 AM UTC-7, tropical...@gmail.com > wrote: > > Hello everybody, > > > > I installed the LAMP stack on in Ubuntu, but I am having > > problems configuring Apache to run python CGI

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread Albert Visser
On Mon, 21 Sep 2015 20:41:13 +0200, wrote: Hello everybody, (...) I created index.py: #!/usr/bin/env python # -*- coding: UTF-8 -*-# enable debugging import cgitb cgitb.enable() print("Content-Type: text/html;charset=utf-8") print("Hello World!") But it is still not working. Can anybody

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread sohcahtoa82
On Monday, September 21, 2015 at 11:41:54 AM UTC-7, tropical...@gmail.com wrote: > Hello everybody, > > I installed the LAMP stack on in Ubuntu, but I am having > problems configuring Apache to run python CGI scripts. > > I ran: > sudo a2enmod cgi > > I added to apache2.conf > > Options

Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
Hello everybody, I installed the LAMP stack on in Ubuntu, but I am having problems configuring Apache to run python CGI scripts. I ran: sudo a2enmod cgi I added to apache2.conf Options +ExecCGI AddHandler cgi-script .py I created index.py: #!/usr/bin/env python # -*- coding: U