http://docs.turbogears.org/1.0/BehindApache
http://www.cherrypy.org/wiki/BehindApache
i'd really prefer to have it be somewhere other than root, though.
there's a section about that in the cherrypy doc using 'build_url', but
how i should adapt that to work with my turbogears app is not exactly
obvious to me.
does anyone have any ideas or pointers to documentation that i may have
missed?
thanks,
--dg
I just went through all that and would be happy to help but I don't
quite understand what your asking. If you post your apache config and
path layout I can probably give you some pointers. Also, which OS and
apache are you using? I got everything going nicely on Ubuntu with
Apache 2.0 ( mod_rewrite, mod_proxy, and cgi enabled ).
Iain
If you can, definitely go for a virtual host. It is much easier to set up and
also makes it easier to have absolute paths to images, etc. in your CSS files.
Setting up a virtual host is really easy, the only problem is that sometimes
you have no direct control over the nameserver and you might need to ask
somebody to set up a host alias for your webserver. I don't use Apache, but if
you have trouble with the config for a virtual host, just post it here and we
can help.
Chris
I'm not exactly sure what you are asking about here. Is your problem
that attempts to refer to a url within the application do not work
correctly? If so a reference to "/login" sends the user to
http://server/login instead of http://server/application/login
If that is your problem the turbogears.url function is your solution.
It takes a relative path (and an optional keyword list of GET
parameters) and returns a full path adjusted for your app. This is
configured through the 'server.webpath' variable. More information on
turbogears.url here: http://docs.turbogears.org/1.0/GettingStarted/URLs
More info on server.webpath here:
http://docs.turbogears.org/1.0/Configuration
If that is not your problem, I think we might need more info to find a
solution.
-Adam
i'm using identity for authentication. so when i connect to
http://server/application initially, it sends me to
http://server/application/login. this is fine. after i fill in my
login info and press the login button, cherrypy throws a 'NotFound:
404', and i get sent to http://server/. i'm using the default login
code (but i think it was autogenerated from 0.9a something, so maybe i
need to see what's changed?)
at the moment, i just have this stuff tossed into a file in
sites-enabled (debian stable, apache2):
ProxyRequests on
RewriteEngine on
ProxyPass /application http://localhost:8082/
ProxyPassReverse /application http://localhost:8082/
RewriteRule ^(.*) http://localhost:8082$1 [P]
i have the base_url_filter stuff turned on in app.cfg, and i have
server.webpath="/application" in dev.cfg (maybe it should be somewhere
else?)
if i change /application above to /, then it runs at the root and
everything works correctly.
server.webpath="/application/" is the correct thing.
it puts an extra / in the url, but seems to work fine other than that.
We're deploying an application within a "directory" of our client's
server. We have the following inside the Apache configuration for
their virtualhost, though it can (in theory) work well enough within
a .htaccess file, if you allow mod-rewrite:
RewriteEngine On
AddDefaultCharset utf-8
RewriteRule ^/static/(.*) /path/to/application/static/$1 [L]
RewriteRule ^/booking/static/(.*) /path/to/application/static/$1 [L]
RewriteRule ^/booking/(.*) http://localhost:8080/booking/$1 [P,L]
Our prod.cfg looks like this:
[global]
# ...
server.webpath = "/booking"
[/]
base_url_filter.on = True
#baseUrlFilter.baseUrl="http://www.domain.tld/booking/"
base_url_filter.use_x_forwarded_host = True
Once we realized that the redirection had to go through a similarly
named subdirectory on the TurboGears side (localhost:8080/booking/$1
instead of localhost:8080/$1) all of the nit-picky issues we had with
relative redirection went away, and this config works quite well,
also allowing the static content to be served by Apache.
Matthew Bevan, Systems Administrator
Top Floor Computer Systems Ltd.