Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm very new in web servers and stuff but I have certain knowledge in Python, is it possible to use it as cgi, such as php? I know that python has a cgi module.

ps: I'm using apache2 in a debian server.

share|improve this question

closed as off topic by Indrek, Canadian Luke, Nifle, 8088, Olli Aug 28 '12 at 9:53

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

Sure, there are many ways of serving python applications via apache2.

you can use python via mod_python :

...
<Directory /var/www/localhost/htdocs> 
   AddHandler mod_python .py
   PythonHandler mod_python.publisher 
   PythonDebug On 
</Directory>
...

or if your app is written in any of python frameworks (flask,bottle,django), you can just configure frameworks webserver and point apache2 to it's socket/port and act as a proxy.

share|improve this answer
    
where do I put this lines? –  Gonzo Aug 28 '12 at 1:56
    
this is just an example of configuration of apache2 vhost. You should go at least through one tutorial with apache2 mod python as well as writing cgi scripts for apache with python. Simplest way to start serving python sites is to use framework like Bottle which has it's own www server and use apache2 not as a python cgi server but as a proxy. –  wojciechz Aug 28 '12 at 10:21

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