We have our cms system sitting on a subdomain name (e.g. cms.waikato) other than our primary domain name (www.waikato) which is hosted off our existing primary webserver. Many of our sites have addresses under the primary domain (e.g. www.../site) and in looking to use the cms to support their ongoing development we have looked into how we would host material on the cms system and make it available via the www.waikato domain, in particular using a ProxyPass directive to transparently proxy content through our existing primary webserver.
One small problem. Getting the navigation on the resulting pages to use www.waikato addresses instead of cms.waikato addresses.
I have setup a ProxyPass directive from one of our test domains pointing at our cms system:
I've then added that test domain to the system root URLS in our Matrix install, and set the URL on the site that responds to the /test2/ location on that install to use that domain such that I see when I access the URLs for that site:
[quote]
URLs
cms.domain.../test2 HTTP TICK
test.domain.../test2 HTTP TICK
[/quote]
Accessing http://test.domain.../test2/ I can see the page I expect - but when I hover over any of the navigation on that page (within the /test2/ location&site) the addresses I see all start with http://cms.domain.../ which is not what we want.
Can anyone provide me with clues on how to progress this?
Thanks David, I've tried that and I'm now getting a 404 page as a result. I have our primary webserver using the ProxyPass to point requests on to the cms server where I have things setup in Matrix - do I also need to make changes to the apache configuration on the cms server?
Weird that you're getting a 404 if Matrix knows how to serve the URL.
Normally I turn on ProxyPreserveHost so that the "Host:" header is passed through from the mod_proxy instance to the Matrix instance untouched.
What I would do normally (given this isn't yet something we have played with much)…
Pick a name for the cms server and the mod_proxy host, in your case I understand the mod_proxy host to be www.waikato and the CMS to be on cms.waikato.
Set a host entry of www.waikato on a desktop machine that can connect directly to cms.waikato and ensure that Matrix does actually know how to serve those URLs (I'm hoping this doesn't work, otherwise it's something more sinister).
If we're getting sensible looking pages connecting directly to the server via a hosts file edit I would then do the mod_proxy changes you have done.
If it's still not working I usually put a phpinfo() call somewhere that I can get to it through mod_proxy and look at the header information (usually one of them is glaringly wrong).
In short, find a way to connect directly to the cms server and ask it for www.waikato urls, if they don't work that's what you need to fix first.
[quote]
Set a host entry of www.waikato on a desktop machine that can connect directly to cms.waikato and ensure that Matrix does actually know how to serve those URLs (I'm hoping this doesn't work, otherwise it's something more sinister).
[/quote]
Ah. Having done that, I get the default site on cms.waikato returning a response - not Matrix, so it looks like something in the apache config is awry…?
[quote]
Ah. Having done that, I get the default site on cms.waikato returning a response - not Matrix, so it looks like something in the apache config is awry…?
[/quote]
Without seeing the full config I'm just stabbing in the dark, but I'd guess you probably have a ServerAlias in your vhost that isn't matching the www.waikato url.
[quote]
Without seeing the full config I'm just stabbing in the dark, but I'd guess you probably have a ServerAlias in your vhost that isn't matching the www.waikato url.
[/quote]
Thanks again for your help David, I've reviewed the ServerAliases, correcting them as required, and done a proper restart which seems to have made the server pickup the updated configuration properly (I'd tried previously to do a graceful using apachectl directly (we have Debian installed and I'm not used to the init.d/apache2 limits).
Things now seem to be better behaved. The only things I've noticed still not working are:
Images -the paths generated are of the format __data/assets/image/0003/201/Duck.png, so I assume I need a ProxyPass or similar on www.waikato to redirect to there since the path is not within the test2 path?
Google Map asset - not sure, but suspect something like the above?
[quote]
Thanks again for your help David, I've reviewed the ServerAliases, correcting them as required, and done a proper restart which seems to have made the server pickup the updated configuration properly (I'd tried previously to do a graceful using apachectl directly (we have Debian installed and I'm not used to the init.d/apache2 limits).
Things now seem to be better behaved. The only things I've noticed still not working are:
Images -the paths generated are of the format __data/assets/image/0003/201/Duck.png, so I assume I need a ProxyPass or similar on www.waikato to redirect to there since the path is not within the test2 path?
Google Map asset - not sure, but suspect something like the above?
[/quote]
Yep if you're not doing it from the root directory (which rereading your first post in this thread I think you're not) you need to ProxyPass things like __data and possibly __lib.
The other way to do it involves having another set of aliases on the cms server to Make Matrix put references to __data in the alternate subtree when it gets a request in that tree, e.g.:
# we duplicate all aliases, changing the one to index.php will change where Matrix sends requests
# the other 3 are required to ensure that the URLs Matrix generates are actually valid
Alias /matrix/__fudge /var/www/matrix/fudge
Alias /matrix/__data /var/www/matrix/data/public
Alias /matrix/__lib /var/www/matrix/core/lib
Alias /matrix/ /var/www/matrix/core/web/index.php/
# normal aliases used by people directly connection to the cms server
Alias /__fudge /var/www/matrix/fudge
Alias /__data /var/www/matrix/data/public
Alias /__lib /var/www/matrix/core/lib
Alias / /var/www/matrix/core/web/index.php/
Note: above I'm serving all requests on the mod_proxy instance via http://example.com/matrix/
[quote]
Yep if you're not doing it from the root directory (which rereading your first post in this thread I think you're not) you need to ProxyPass things like __data and possibly __lib.
[/quote]
What lives in __lib ? (Alternatively, is there a manual that will tell me what files go in __data, __lib and __fudge? Searching on my local cache of manuals didn't yield any results.)
Don't know if there is a manual, but here is a bit of info:
__lib => JS/PHP/images that are used in the admin interface but don't contain any system identifiable information (or do their own permission checking). Stored there for speed.
__fudge => Mostly for the WYSIWYG editor to store popup PHP/JS files and the images for the popups and toolbar.
__data => Used to serve public versions of files through Apache so there is no PHP slow-down.