Re: [users@httpd]答复: [users@httpd] NameVirtualHost question

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

 



Keep things in thread, it's best for everyone

Instead of creating a message you replied to another message, asking a second question, and this mixes things up...

I am not sure wether this will help you, but if you get a null header maybe this works

String ipAddress = null;
if (request.getHeader("X-Forwarded-For") == null) 
   ipAddress = request.getRemoteAddr();
else 
   ipAddress = request.getHeader("X-Forwarded-For");		

Alan wrote:

Hi, thanks for reading my letter, 

I got a problem , when I use apache2.24 ‘s proxy module to connect tomcat5.0.28 , I can’t get client IP Address by  request.getRemoteAddr(),

I have also tried

request.getHeader("x-forwarded-for");
request.getHeader("Proxy-Client-IP");

request.getHeader("Proxy-Client-IP");
request.getHeader("WL-Proxy-Client-IP");

 all of them doesn’t work , can you give me some adverise?
thank you !

 

doesn’t work,  means

 

request.getHeader("x-forwarded-for")  =null ,request.getHeader("Proxy-Client-IP")=null

request.getHeader("Proxy-Client-IP")=null,request.getHeader("WL-Proxy-Client-IP")=null,

so I can’t get client IP address

 

 

 

 


发 件人: Luis Moreira [mailto:luis.moreira@xxxxxx]
发 送时间: 2007年9月21 17:29
收 件人: users@xxxxxxxxxxxxxxxx
主 题: Re: NameVirtualHost question

 

What do you mean by "it doesnt work" ?
Have you checked your logs, to see (for instance) if Apache is fetching files from the wrong root?

Luis

Matus UHLAR - fantomas wrote:

On 17.09.07 13:29, Néstor Boscán wrote:
  
I have a server that has an Apache Server 1.3. The server only has 1 IP and
can be access using two differente names server1 and server2. I would like
to create a VirtualHost for each name that sets the ServerName. Now I tried
the following
 
NameVirtualHost ip:80
<VirtualHost server1:80>
<VirtualHost server2:80>
    
 
NameVirtualHost and VirtualHost should have the same argument.
 
  
And it doesn't work. It will not use the VirtualHosts. I also tried this:
    
 
  
NameVirtualHost ip:80
    
 
  
<VirtualHost ip:80>
ServerName server1
    
 
  
<VirtualHost ip:80>
ServerName server2
    
 
  
And again it doesn't work.
    
 
this should work, unless there's configuration error elsewhere.
 
  

 

--
Luis Moreira
Analista
E. S. Informática
Gestão de Sistemas, Qualidade e Produção
Comunicação de Dados e Segurança
Rua Fraternidade Operária 5
2799-501 Carnaxide
Tel: +351 21 416 82 88
Fax: +351 21 416 80 92

Email : luis.moreira@xxxxxx
URL: http://www.esi.pt

--------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx

--
Luis Moreira
Analista
E. S. Informática
Gestão de Sistemas, Qualidade e Produção
Comunicação de Dados e Segurança
Rua Fraternidade Operária 5
2799-501 Carnaxide
Tel: +351 21 416 82 88
Fax: +351 21 416 80 92
Email : luis.moreira@xxxxxx
URL: http://www.esi.pt
--------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux