Ip-adr (DirectAdmin in .log) <> Ip-adr from php ($_SERVER['REMOTE_ADDR'])

jan99

New member
Joined
Jan 2, 2019
Messages
6
Hi,

DirectAdmin makes log file in folder "logs". DirectAdmin writes there the timestamp + ipadress etc. from the visitor.

However.... mij php script does the same at the begining of each webpage >> log timestamp + ipadress ($_SERVER['REMOTE_ADDR']).

This result in the following situation:
timestamp DirectAdmin is equal timestamp my php script
ipadress DirectAdmin is NOT equal ipadress my php script

DirectAdmin logs an ipadress (not my adress) ..... my php script logs my own ipadress (while I do not access any webpage! ... more specific: all my devices are turned off, exept the modem at that time)

What is going on here, why is there a difference?
 

jan99

New member
Joined
Jan 2, 2019
Messages
6
All devices disconnected from power.

in addition to my above question:
Last night I disconnected from power my modem.
Result: I still get that visitor that uses my Ip adress and put spam in my html-form.
And there is still a difference between DirectAdmin and PHP-script (my own!) ip-adress.
Suggestions are welcome!
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,255
Location
GMT +7.00
Hello,

What is your setup? Do you have Directadmin latest version on your server?

What webserver options do you have there: apache, nginx, nginx_apache, litespeed?

Do you proxy your sites via CloudFlare, other similar services?
 

jan99

New member
Joined
Jan 2, 2019
Messages
6
It is not my server.
php script is running at server from rovider.

Server is apache system.

I have asked provider about proxy .... answer is NO.

DirectAdmin version........... ? I suppose the latest version
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,255
Location
GMT +7.00
If an IP address written in logs does not match one shown in $_SERVER['REMOTE_ADDR'] then you as an user without root access on a server can do almost nothing.... It should be a server administrator to investigate the issue and fix it.

Try and see

PHP:
<?php
var_dump($_SERVER);

whether or not you see a correct IP there.


Probably you have an error in your script....
 

jan99

New member
Joined
Jan 2, 2019
Messages
6
If an IP address written in logs does not match one shown in $_SERVER['REMOTE_ADDR'] then you as an user without root access on a server can do almost nothing.... It should be a server administrator to investigate the issue and fix it.

Try and see

PHP:
<?php
var_dump($_SERVER);

whether or not you see a correct IP there.


Probably you have an error in your script....

I must apologize....
The problem was in a php sub-script (somewhere far away ...) with an if statement. In the equation, 1 "=" character is used instead of 2 "==" characters used.
So no comparison takes place, but a value transfer.

.... sometimes I need extra glasses, ha ha.
 
Top