Installation nightmare (local dev with win/apache/mod_wsgi/python)

Asked by John Harris on 2012-10-03

I am trying to develop some web services on my local machine. I have apache installed (via xampp) and mod_wsgi. I am using Python 2.7.3 with virtualenv. I do not have much experience setting stuff up for the web so am feeling my way through this process. I have changed httpd.conf to load mod_wsgi, and to support python files by adding .py to the options line. At the moment I have installed everything and have a dir structure:

Python: C:\Python27
Apache: C:\xampp\apache
Virtualenv: C:\users\JH\python_environments\main_env
Test service: C\xampp\htdocs\ladon\myservice

The test service contains and
activate_this = 'C:\Users\JH\python_environments\main_env\Scripts\' # To account for the virtualenv
execfile(activate_this, dict(__file__=activate_this) # To account for the virtualenv

from ladon.server.wsgi import LadonWSGIApplication
from os.path import abspath,dirname

application = LadonWSGIApplication(
  catalog_name='My Ladon webservice catalog',
  catalog_desc='This is the root of my cool webservice catalog')
from ladon.ladonizer import ladonize

class Calculator(object):
  This service does the math, and serves as example for new potential Ladon users.
  def add(self,a,b):
    Add two integers together and return the result

    @param a: 1st integer
    @param b: 2nd integer
    @rtype: The result of the addition
    return a+b

I have also added the following to my httpd.conf (the error log lines didn't work so I commented them out):
<VirtualHost *:80>

        ServerName localhost
        ServerAdmin <email address hidden>

        WSGIScriptAlias /myservice/ /ladon/myservice/

        LogLevel warn

        #ErrorLog ${APACHE_LOG_DIR}/mysite.com_error.log
        #CustomLog ${APACHE_LOG_DIR}/mysite.com_access.log combined


When I visit http://localhost in my web browser it goes to the xampp page (great). When I visit http://localhost/myservice/ it gives me a 403 Forbidden page. The apache error log says:

"[Wed Oct 03 13:12:34 2012] [error] [client ::1] client denied by server configuration: C:/ladon"

Why is it trying to access C:/ladon?? Where is that even configured?

Anymore details or a more complete installation walkthrough would be greatly appreciated, as it looks like a great module, I just can't get it to work!!!


Question information

English Edit question
ladon Edit question
No assignee Edit question
Last query:
Last reply:
oyzzo (oyzzoforfree) said : #1

hi John Harris,

This line is wrong:
WSGIScriptAlias /myservice/ /ladon/myservice/

if your file is at C:\xampp\htdocs\ladon\myservice\

this line should look like this:

WSGIScriptAlias /myservice C:\xampp\htdocs\ladon\myservice\

I have no idea on windows, but i know here you have to put the absolute path to the file on your system so maybe it doesn't work but it's something similar.

On linux it's also needed python-docutils, check it too.

Hope you get it to work, i had a hard time figuring out everything the first time like you, but it's worth the effort, now i'm more than happy with it.

Good luck!


Can you help with this problem?

Provide an answer of your own, or ask John Harris for more information if necessary.

To post a message you must log in.