Results 1 to 7 of 7

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

  1. #1
    Join Date
    Jan 2019
    Posts
    6

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

    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?

  2. #2
    Join Date
    Jan 2019
    Posts
    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!

  3. #3
    Join Date
    Jan 2019
    Posts
    6

    Unhappy

    Nobody with an answer or suggesttion?

  4. #4
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,966
    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?
    Regards, Alex G.

    - You can hire me on www.poralix.com to work on your server
    - Follow and like @Poralix on Facebook

  5. #5
    Join Date
    Jan 2019
    Posts
    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

  6. #6
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,966
    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 Code:
    <?php
    var_dump
    ($_SERVER);

    whether or not you see a correct IP there.


    Probably you have an error in your script....
    Regards, Alex G.

    - You can hire me on www.poralix.com to work on your server
    - Follow and like @Poralix on Facebook

  7. #7
    Join Date
    Jan 2019
    Posts
    6
    Quote Originally Posted by zEitEr View Post
    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 Code:
    <?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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •