Forum Moderators: phranque

Message Too Old, No Replies

access_log shows all requests are from 192.168.1.2

         

Jules273

12:00 pm on Feb 28, 2006 (gmt 0)

10+ Year Member



I have a minor but irritating problem with my access log.
Every request that's made, whether on the local subnet or from an external ip address shows up on the access_log as 192.168.1.2. I have checked that everything is working correctly and Google and MSN are getting to my site, but are still listed as being at 192.168.1.2. I am not using a proxy server and am running Mac OS X 10.4.5. I have recently reinstalled the server but with a very similar configuration to its prior incarnation. I am using the default apache installation (1.3.33).

Incidentally my mail server is able to get external IP addresses without problem.

Iguana

12:40 pm on Feb 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



192.168.1.1 is default for wireless router (Linksys maybe) - .2 would be the first device to connect to it

Jules273

1:05 pm on Feb 28, 2006 (gmt 0)

10+ Year Member



That is correct - the gateway is on 192.168.1.1 and the server is on 192.168.1.2, but that does not explain why apache can't see any external ip addresses, nothing has changed at the router and no other programs have this problem (the problem does not exist on any of the other internal apache servers - they all get the correct ip addresses).

extras

4:19 pm on Feb 28, 2006 (gmt 0)

10+ Year Member



Are you sure that logging format is correct?
Maybe you are using %A (SERVER_ADDR local IP) instead of %a (REMOTE_ADDR client IP).
[httpd.apache.org...]

Jules273

4:31 pm on Feb 28, 2006 (gmt 0)

10+ Year Member



Thanks for suggestion, but I am using combined log format:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

The "%h" comes up as 192.168.1.2 in every entry except for localhost which comes up as 127.0.0.1.

I tried turning on hostnamelookups but this still resolved to my local domain.

extras

12:09 am on Mar 1, 2006 (gmt 0)

10+ Year Member



If you areusing the proxy server, it's normal to show the IP of proxy server.
ex.
Google,Yahoo --- Internet --->>
>>--- Nat/router --- Proxy(192.168.1.2) --- Apache

Jules273

8:44 pm on Mar 1, 2006 (gmt 0)

10+ Year Member



Thankyou. In a roundabout way you solved my problem. I am not running a proxy server, but Mac OS X Server runs apache with a performance cache (which is pointless on my website as most of the content is dynamic).

The performance cache runs on port 80 and the websites run on port 16080.

In the Server Admin dialog I turned off the performance cache option, but (as with many options in Server Admin) my preference wasn't respected.

The solution was to manually change the website ports to 80 (from 16080) in Webmin and then go back to Server Admin and disable the performance cache again.

Now my website is running on port 80 and all the IP addresses are correct.

extras

11:37 pm on Mar 1, 2006 (gmt 0)

10+ Year Member



The "performance cache" is probably Squid, and it's a provy. :)
Glad to hear that you solved it, anyway.

Jules273

2:57 am on Mar 2, 2006 (gmt 0)

10+ Year Member



Not squid, it was apache module mod_proxy ;)