Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 574057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:47:27+00:00 2026-05-13T13:47:27+00:00

I understand that I should use mod_wsgi to run Python, and I have been

  • 0

I understand that I should use mod_wsgi to run Python, and I have been trying to get that set up, but I’m confused about it:

This is a sample configuration I found for web.py:

LoadModule wsgi_module modules/mod_wsgi.so

WSGIScriptAlias /appname /var/www/webpy-app/code.py/

Alias /appname/static /var/www/webpy-app/static/
AddType text/html .py

<Directory /var/www/webpy-app/>
    Order deny,allow
    Allow from all
</Directory>

So… I understand I have to configure my web server to point to the python application? Isn’t there a way to use it like PHP, where, when you request a .py file, Python interprets it? How can I get my web server to the very basic state, where I can upload a file containing print "Hello World", request it, and have it say “Hello World”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:47:28+00:00Added an answer on May 13, 2026 at 1:47 pm

    I think you can use mod_cgi with apache and put in the URL of an accessible python file, with the first line of the script

    #!/usr/bin/python
    

    however this is a VERY inefficient way of accessing the python code because apache has to reload python every time the page is accessed. Ok for a one-off maintenance script only you call every now and then, but not suitable for active content accessed by users.

    Edit: I didn’t realise you were on Windows. Something similar should be possible. Try googling python apache cgi.

    Edit: If you have apache working in cgi mode, you don’t need to restart it every time. If the script is present and executable at the URL path given it will run. If it isn’t then you’ll get a 404 page not found error

    Edit: I did a very quick Google search for ‘python cgi’ and found these slides from ten years ago by Python’s creator. They document an obsolete version of the languange but the slides from 41 onwards may be useful to you. Like I say, people have moved away from scripting web applications using this method but if your requirements are simple it will still work. http://legacy.python.org/doc/essays/ppt/sd99east/index.htm

    Edit: The best approach depends on what you are trying to do. Using a framework that handles the serving for you may be useful. I can recommend Web2py as very capable, secure framework that would allow you to write scripts and add them dynamically. It has a windows version that includes a simple web server, or you can configure apache as well. As everything is included you could be up and running within minutes if you read the introductory information. If you’ve not used web frameworks before and aren’t familiar with lanugage such as “model view controller” then don’t be put off. http://www.web2py.com/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 295k
  • Answers 295k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Not really, but Dropbox in concert with GIT, maybe. For… May 13, 2026 at 6:48 pm
  • Editorial Team
    Editorial Team added an answer It depends what constructor you used. The TextWriterTraceListener(String) constructor creates… May 13, 2026 at 6:48 pm
  • Editorial Team
    Editorial Team added an answer You can always write your own mission-specific extension to Hash… May 13, 2026 at 6:48 pm

Related Questions

My website is written in Python and currently runs under mod_python with Apache. Lately
I have found some info on the subject ( like this link) , but
I understand that 2.5 is automatically a double, and to make it a float,
I recently told a friend that I was starting to learn Catalyst (Perl) and
EDIT 1 I apologize but after reading the 2 suggested articles I still don't

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.