Hi,
I have a webserver apache2 on debian Lenny.
I am using gateway as Dom0 and rest of the operating systems are different Dom's .Using a xen virtualization setup.
I want to have a few websites
http://site1.myserver.com
http://myserver.com
and
http://myserver.com/site2
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.
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>
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>
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/)
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
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)
Is this configuration wrong.
What is happening is
if some one clicks on
http://myserver.com or
http://site1.myserver.com he sees
http://site1.myserver.com
Which should not happen.
Scene 2)
If you open
http://myserver.com/site2
Following comes
Code:
Not Found
The requested URL /site2 was not found on this server.
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/)
http://myserver.com/site2 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>
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>
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>
So what should I check in?