Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.