: Configuring an Apache server to run Python I currently have a website set up on an Apache server running on Redhat Linux, and am trying to configure it to be able to run Python scripts. Essentially,
I currently have a website set up on an Apache server running on Redhat Linux, and am trying to configure it to be able to run Python scripts. Essentially, I want to allow Python to be executable, so that doing something like mysite.com/pyscript.py will run the script rather than display its contents.
I really don't have any Apache experiance, and haven't been able to find any good tutorials on how to figure this out, how do I do this?
More posts by @Fox8124981
2 Comments
Sorted by latest first Latest Oldest Best
If your server is setup for python and it is only displaying your python script then most likely you do not have the file permission on it set to executable. You have it set to read only.
I suggest reading the official Python docs that explain how to run Python on a web server.
In short, they recommend WSGI. For Apache, there's a "quick" installation guide on the mod_wsgi Google project page. If you're using a Python framework such as Django, a guide to using mod_wsgi with Django is available.
Finally, if setting up and maintaining your own server feels like too much work, you might consider hosting your Python web app with a platform-as-a-service (PAAS) offering such as appfog, Google App Engine, Heroku, dotCloud or Gondor. I host a small Python app with Google App Engine and another on appfog and have been pleased with both services.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.