I use mod_wsgi 2.5 under Apache 2.
My WSGI applications is in /home/username/public_wsgi/wsgi/myapp.wsgi
where public_wsgi is directory where i have production.ini file.
My myapp.wsgi file looks like follows:

-------------- myapp.wsgi --------------
WORKING_ENV = "/home/username/public_wsgi"
APP_CONFIG = "/home/username/production.ini"

import sys
sys.path.append(WORKING_ENV)

from paste.deploy import loadapp
application = loadapp("config:" + APP_CONFIG)
-------------- myapp.wsgi --------------

All looks working right when Pylons app runing under / address like
something.server.com/ but my app is hosted in server.com/something.
Apache configuration of WSGI:

-------------- WSGI apache config.py --------------
WSGIScriptAlias /panel /home/username/public_wsgi/wsgi/myapp.wsgi
WSGIDaemonProcess username user=username group=username processes=7
threads=17 display-name=wsgi:appname python-eggs=/username/public_wsgi/
data/eggs-cache
WSGIProcessGroup username
<Directory /home/username/public_wsgi/wsgi>
  Order deny,allow
  Allow from all
</Directory>
-------------- WSGI apache config.py --------------

DocumentRoot for this serwer is set to /some/path/to/www and i don't
want change this. But after I host Pylons app under server.com/
something i get following errors in apache logs

File does not exist: /some/path/to/www/stylesheets, referer:
http://server.com/something/controllername/actionname
File does not exist: /some/path/to/www/images, referer:
http://server.com/something/controllername/actionname

My routing.py file:

-------------- routing.py --------------
"""Routes configuration

The more specific and detailed routes should be defined first so they
may take precedent over the more generic routes. For more information
refer to the routes manual at http://routes.groovie.org/docs/
"""
from pylons import config
from routes import Mapper

def make_map():
    """Create, configure and return the routes Mapper"""
    map = Mapper(directory=config['pylons.paths']['controllers'],
                 always_scan=config['debug'])
    map.minimization = False

    # The ErrorController route (handles 404/500 error pages); it
should
    # likely stay at the top, ensuring it can always be resolved
    map.connect('/error/{action}', controller='error')
    map.connect('/error/{action}/{id}', controller='error')

    # CUSTOM ROUTES HERE

    map.connect('/', controller='account', action='index')
    map.connect('/{controller}/{action}')
    map.connect('/{controller}/{action}/{id}')

    return map
-------------- routing.py --------------

What i should change to get working images/stylsheets links which
should bet getting from /home/username/public_wsgi/projectname/public
not DocumentRoot

Greetings from Poland
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to