~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to start-loggerhead.py

  • Committer: Michael Hudson
  • Date: 2008-06-23 01:40:28 UTC
  • mto: This revision was merged to the branch mainline in revision 169.
  • Revision ID: michael.hudson@canonical.com-20080623014028-1ia0mbz6k32o1j60
more loggerhead.conf compatible vhosting

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
import logging
4
4
import logging.handlers
 
5
from optparse import OptionParser
5
6
import os
6
7
import sys
7
 
from optparse import OptionParser
 
8
import urlparse
8
9
 
9
10
from configobj import ConfigObj
10
11
 
121
122
    app = make_filter(app, None)
122
123
 
123
124
    if webpath:
124
 
        from paste.deploy.config import PrefixMiddleware
125
 
        app = PrefixMiddleware(translate_forwarded_server=True, prefix=webpath)
 
125
        scheme, netloc, path, blah, blah, blah = urlparse.urlparse(webpath)
 
126
        def app(environ, start_response, orig=app):
 
127
            environ['SCRIPT_NAME'] = path
 
128
            environ['HTTP_HOST'] = netloc
 
129
            return orig(environ, start_response)
126
130
 
127
131
    try:
128
132
        httpserver.serve(