[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

URL redirection problem in a reverse proxy apache2



Hi,
 I have a webserver apache2 .


I want to have a few websites
[url]http://site1.myserver.com[/url]
[url]http://myserver.com[/url]
and [url]http://myserver.com/site2[/url]

 I did set up a reverse proxy environment for doing this.
[code]
Dom0 LAN IP ----> 192.168.1.1 Gateway (where reverse proxy is set)
DomU1 LAN IP ----> 192.168.1.13 ( here myserver.com
                                   and site1.myserver.com
                                    both are hosted.)

Domu2  LAN IP ----> 192.168.1.17  myserver.com/site2 is here.[/code]




	Configuration on Dom0 of sites site1.myserver.com and myserver.com
 Virtual Host Configurations on Dom0
in /etc/apache2/sites-enabled/myserver.com (on gateway)
[code]
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName myserver.com

        ProxyRequests off
        <Proxy *>
        Order deny,allow
        Allow from all
        </Proxy>
        ProxyPass / http://192.168.1.13/
        ProxyPassReverse / http://192.168.1.13/
        ProxyPass /site2 http://192.168.1.17/
        ProxyPassReverse /site2 http://192.168.1.17/


</VirtualHost>
[/code]

then /etc/apache2/sites-enabled/site1.myserver.com  (on gateway)
has
[code]
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName site1.myserver.com

        ProxyRequests off
        <Proxy *>
        Order deny,allow
        Allow from all
        </Proxy>
        ProxyPass / http://192.168.1.13/
        ProxyPassReverse / http://192.168.1.13/


</VirtualHost>
[/code]



and following asci chart

[code]
	On Dom0
	sites-enabled
	  |
	  |--------------->myserver.com      (ProxyPass / to
http://192.168.1.13/)
	  |
	  |--------------->site1.myserver.com (ProxyPass / to http://192.168.1.13/)
[/code]

and for myserver.com/site2
on Dom0 in same file I have following
[code]
ProxyPass /site2 192.168.1.17
ProxyPassReverse /site2 192.168.1.17
[/code]



	On DomU (site1) 192.168.1.13 where site1.myserver.com and
myserver.com are actually present.
[code]
	sites-enabled
	  |
	  |--------------->myserver.com      (DocumentRoot /var/www/myserver)
	  |
	  |--------------->site1.myserver.com (DocumentRoot /var/www/site1)
[/code]
Is this configuration wrong.
What is happening is
 if some one clicks on [url]http://myserver.com[/url] or
[url]http://site1.myserver.com[/url]  he sees
[url]http://site1.myserver.com[/url]

Which should not happen.



	Scene 2)
	
	 If you open
	 [url]http://myserver.com/site2[/url]
	 Following comes
[code]
	 Not Found
	  The requested URL /site2 was not found on this server.
[/code]
	Configuration is
[code]
	On Dom0
	sites-enabled  in same file myserver.com
	  |
	  |--------------->myserver.com    (ProxyPass /site2 to
http://192.168.1.17/)
                                              (ProxyPassReverse /site2
 http://192.168.1.17/)
[/code]
	[url]http://myserver.com/site2[/url] is not opening.


On DomU that is 192.168.1.13  where site1.myserver.com and
myserver.com are hosted
I have
 /etc/apache2/sites-enabled/site1.myserver.com (where it is hosted on LAN)


[code]
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName myserver.com
         DocumentRoot /var/www/mainsite/
        <Directory /var/www/ >
                Options FollowSymLinks
                AllowOverride None
        </Directory>

</VirtualHost>
[/code]
and  /etc/apache2/sites-enabled/myserver.com  (where it is hosted on LAN)

[code]
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName site1.myserver.com
         DocumentRoot /var/www/site1/
        <Directory /var/www/ >
                Options FollowSymLinks
                AllowOverride None
        </Directory>

</VirtualHost>
[/code]

and configuration of myserver.com/site2 on 192.168.1.17

[code]
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName myserver.com/site2
         DocumentRoot /var/www
        <Directory /var/www/ >
                Options FollowSymLinks
                AllowOverride None
        </Directory>

</VirtualHost>
[/code]

So what should I check in?

-- 
Not sent from my iPhone or my Blackberry or anyone else's


Reply to: