Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 www.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?

share|improve this question

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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.