proxying a server in a subdirectory?
hi,
is it possible to "show up" a whole webserver in a subdirectory of another server with apache? e.g. server http://foo.com --> http://bar.com/foo thanks, toby |
for simple implementations, yes. check out mod_proxy and the proxypass and proxypassreverse directives.
|
I tried this:
on the server www.bar.com Code:
ProxyPass /foo http://www.foo.com what did i do wrong? thanks. |
can you show us the full config please? I assume you reloaded the apache config after this?
|
yes, i did, but no success....
--> apache 1.3.34 Code:
[...] |
the directory directive is a local unix path, i.e. a directory called "proxy" in your root partition. Generally mod_proxy directives go in ta virtualhost or default host definition.
|
oh i see.. so what if i used the "location" directive instead?
|
you wouldn't use any directive. just add it after your ServerName or ServerAlias directive for the host / virtualhost you want this to work under.
|
It now looks like this:
Code:
[...] The requested URL /proxy was not found on this server. I need to place the ProxyPass and ProxyPassReverse in the "IfModule"-directive, outside it gives me an error and I cannot load the module separately as it seems mod_proxy is compiled into the apache-binary in the debian package? |
Well think about it then... if it doesn't work if it's outside then clearly that MUST mean that mod proxy is not built / enabled in the first place, as all you're doing is a condidtional check on mod_proxy being available - i.e. it's *not* available therefore the commands are not run. Again, those directives should be in the virtualhost definitions or equivalent.
|
All times are GMT -5. The time now is 09:41 AM. |