You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by James Godrej <ja...@yahoo.in> on 2010/07/15 18:38:01 UTC

changing server name in HTTP request

I am having a website which is being served on my LAN as 
http://internal1.mydomain.com
 the vhost configuration for this is 
<VirtualHost *:80>
ServerAdmin webmaster@localhost
 ServerName internal1.mydomain.com 
ProxyRequests Off 
         <Proxy *>
        Order deny,allow
        Allow from all
        </Proxy>
ProxyPreserveHost On 

ProxyPass / http://localhost:9090/ 
ProxyPassReverse / http://localhost:9090/ 

</VirtualHost >

it is working very fine on LAN. I am able to use my application completely from 
LAN.

There is another server which is having public IP and I want this website to be 
available on internet.

A request for public domain comes as

http://www.mypublicdomain.com/something

How do I transfer that internally so that it reaches or is being served by 
http://internal1.mydomain.com
Is it possible to change the ServerName of an HTTP Request in Apache2 
if yes then how?


Re: changing server name in HTTP request

Posted by Simão Fontes <si...@fccn.pt>.
Hello James,

First of all you have to consider reading online documentation before
asking questions to the mailing lists.

inline responses

James Godrej wrote:
> I am having a website which is being served on my LAN as 
> http://internal1.mydomain.com
>  the vhost configuration for this is 
> <VirtualHost *:80>
> ServerAdmin webmaster@localhost
>  ServerName internal1.mydomain.com 
> ProxyRequests Off 
>          <Proxy *>
>         Order deny,allow
>         Allow from all
>         </Proxy>
> ProxyPreserveHost On 
>
> ProxyPass / http://localhost:9090/ 
> ProxyPassReverse / http://localhost:9090/ 
>
> </VirtualHost >
>
> it is working very fine on LAN. I am able to use my application completely from 
> LAN.
>
> There is another server which is having public IP and I want this website to be 
> available on internet.
>
> A request for public domain comes as
>
> http://www.mypublicdomain.com/something
>   
You should put a proxypass rule defining the address
Like this: ProxyPass /something http://tomcatserver:9090/
> How do I transfer that internally so that it reaches or is being served by 
> http://internal1.mydomain.com
> Is it possible to change the ServerName of an HTTP Request in Apache2 
> if yes then how?
>   
You need to set the proxy directive on server.xml

<Connector port="8081" ...
              proxyName="www.mycompany.com"
              proxyPort="80"/>
      

	
	




http://tomcat.apache.org/tomcat-5.5-doc/proxy-howto.html



Best regards
Simão

-- 
Arquivo da Web Portuguesa | FCCN
Av. do Brasil, n.º 101
1700-066 Lisboa 
Tel.: +351 21 8440100 (facultativo) Fax: +351 21 8472167
arquivo-web.fccn.pt | www.fccn.pt

Aviso de Confidencialidade
Esta mensagem é exclusivamente destinada ao seu destinatário, podendo conter informação CONFIDENCIAL, cuja divulgação está expressamente vedada nos termos da lei. Caso tenha recepcionado indevidamente esta mensagem, solicitamos-lhe que nos comunique esse mesmo facto por esta via ou para o telefone +351 218440100 devendo apagar o seu conteúdo de imediato. This message is intended exclusively for its addressee. It may contain CONFIDENTIAL information protected by law. If this message has been received by error, please notify us via e-mail or by telephone +351 218440100 and delete it immediately.