You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Krist van Besien <kr...@gmail.com> on 2008/02/29 15:12:02 UTC
Re: [users@httpd] Strange Apache behavior while using website as proxy server (without installing mod_proxy)
On Fri, Feb 29, 2008 at 2:52 PM, Ravi <ra...@gmail.com> wrote:
>
> I have a strange problem and I cannot find any documentation around it.
> I have two virtual host defined as follows:
>
> NameVirtualHost *
>
> <VirtualHost *>
> ServerName www.mydomain.com
> DocumentRoot C:/mydomain/www
> </VirtualHost>
>
>
> <VirtualHost *>
> ServerName proxy.mydomain.com
> DocumentRoot C:/mydomain/proxy
> </VirtualHost>
>
>
> Now I configured www.mydomain.com as http proxy server in my browser and
> go to a random website website http://www.randomsite.com/index.html
>
> 1. Browser sends proxy request to www.mydomain.com and apache loads
> http://www.mydomain.com/index.html. I found no explanation of this
> behavior. I could not find any documentation on how it handles proxy
> requests if mod_proxy is not installed.
>
> 2. Secondly if I configure proxy.mydomain.com as proxy server, apache is
> still loading the website from http://www.mydomain.com/index.html
> instead of http://proxy.mydomain.com/index.html. Any idea how to fix this?
The webserver is doing exactly what you told it to do. You told it to
serve pages from C:/mydomain/www for any request coming in, and this
is what it does.
To know more about virtual hosts read the documentation.
In order to use apache as a proxy a lot more configuration is needed.
It is obvious from what you have shown us so far that you haven't even
started configuring your apache as a proxy, so why would it behave as
one?
Start by reading the documentation here:
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
If you want to use apache as a proxy and as a webserver at the same
time you will probably need to dedicate a separate port to the proxy.
Krist
--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org