You are here
Nev - Tue, 2014/09/16 - 17:47
I'm using the LAMP Amazon Machine Image (AMI) to learn python3, and I'm at the point where I need Apache configured to execute python3 scripts. At present python scripts in /var/www/cgi-bin just get displayed, but I want them to actually run. My book says to configure Apache to execute python - help!
Forum:
Tags:
TBH I would have expected them to just run from cgi-bin
But obviously not... I've never even tried though so this will be a little blind leading the blind...
With a quick bit of googling and it seems that when PHP is used as CGI it uses either mod_php or FastCGI whereas python will need:
Also you may need to edit/add something like this below to your site to make Apache run them:
And finally, AFAIK the script will need to be executable (although perhaps I'm worng...?)
During my research it seems to me that ideally this isn't a great way to run Python (slow and resource intensive). It seems that mod_wsgi is actually better for running Python under Apache, or better still if you want to use python for web stuff, a python web framework such as web2py or Django is a better bet...
Here's what worked
to access files I had to omit /var/www
Great work!
And thanks for posting back with such an extensive explanation. I'm sure that will help someone else! :)
Add new comment