PeterKjeldsen

Q: Access Log reports all visitors as from 127.0.0.1

Even Googlebot and Bingbot has the IP address 127.0.0.1 in Apache Access Log


Does anyone know how to fix this problem, which occurs in both OS X Server 5.0.3 and 5.0.4 after updating from 5.0.2? 

Mac mini, OS X Server, 5.0.4 (Build 15S2259)

Posted on Sep 25, 2015 10:54 AM

Close

Q: Access Log reports all visitors as from 127.0.0.1

  • All replies
  • Helpful answers

Page 1 Next
  • by DazeConfusedAndLost,Solvedanswer

    DazeConfusedAndLost DazeConfusedAndLost Sep 27, 2015 10:18 PM in response to PeterKjeldsen
    Level 1 (34 points)
    Sep 27, 2015 10:18 PM in response to PeterKjeldsen

    This may be an oversight. Please be sure to file a bug report so Apple can fix this. In the mean time...

     

    You need to open up your custom sites conf files in /Library/Server/Web/Config/apache2/sites/ and change this line:

        CustomLog /var/log/apache2/access_log combinedvhost

    to:

        CustomLog /var/log/apache2/access_log combinedvhostproxy

     

    Keep in mind your custom sites conf files is generated by the Server app and can/will be overwritten whenever you change the web sites' settings.

     

    You can look at service_proxy_access.log instead if you don't want to muck around with conf files.

  • by PeterKjeldsen,

    PeterKjeldsen PeterKjeldsen Sep 27, 2015 12:04 AM in response to DazeConfusedAndLost
    Level 1 (0 points)
    Sep 27, 2015 12:04 AM in response to DazeConfusedAndLost

    Okay thanks, I have reported the bug and I'll try your solution in a moment. I'll let you know if it works.

  • by PeterKjeldsen,

    PeterKjeldsen PeterKjeldsen Sep 27, 2015 10:18 PM in response to DazeConfusedAndLost
    Level 1 (0 points)
    Sep 27, 2015 10:18 PM in response to DazeConfusedAndLost

    Okay that seems to fix it all right, thanks for your help.

     

    Peter

  • by scottl31,

    scottl31 scottl31 Oct 23, 2015 12:48 PM in response to PeterKjeldsen
    Level 1 (13 points)
    Servers Enterprise
    Oct 23, 2015 12:48 PM in response to PeterKjeldsen

    Yes, that looks like a lot of conf files to muck with. Can you tell me where the service_proxy_access.log is and what to do?

     

    Thanks!

  • by PeterKjeldsen,

    PeterKjeldsen PeterKjeldsen Oct 23, 2015 1:13 PM in response to scottl31
    Level 1 (0 points)
    Oct 23, 2015 1:13 PM in response to scottl31

    You don't need to do anything specific to view the file service_proxy_access.log, which is located in /var/log/apache2/

     

    How to find it if you don't use terminal:

     

    1. Click on Finder

    2. Go to the Go menu

    3. Click on Go to folder...

    4. Type /var/log/apache2/ in the text field and click on the Go button

    5. Left click on the file  service_proxy_access.log

    6. Click on Open with...

    7. Select TextEdit (or better TextWrangler if you have it installed on your machine)

     

    Now, I found it better to edit the conf files so they could be shown using the Server app.

     

    However, if you have updated to Server 5.0.15 you should read Access Log reports all visitors as from 127.0.0.1 or - - which deals with the new problems the update introduced.

  • by scottl31,

    scottl31 scottl31 Oct 23, 2015 1:28 PM in response to PeterKjeldsen
    Level 1 (13 points)
    Servers Enterprise
    Oct 23, 2015 1:28 PM in response to PeterKjeldsen

    I'm still at 5.0.3. Been afraid to go further since this log IP thing seems to be the only thing I can find that went wrong.

     

    Anyway, I thought you were editing service_proxy_access.log, but are you saying this is just the log to look at and see the correct IPs?

     

    My folder at /Library/Server/Web/Config/apache2/sites/ has 62 files in it. Do I have to do the edit to all of them? It seems that the ones I have opened have both of the lines you mentioned changing one to the other, like :

     

        CustomLog "/var/log/apache2/access_log" combinedvhost env=!forwarded

        CustomLog "/var/log/apache2/access_log" combinedvhostproxy env=forwarded

  • by PeterKjeldsen,

    PeterKjeldsen PeterKjeldsen Oct 23, 2015 1:43 PM in response to scottl31
    Level 1 (0 points)
    Oct 23, 2015 1:43 PM in response to scottl31

    You should only edit the files for the sites that has the ending .conf and you only need to change line 6 from:

     

    CustomLog /var/log/apache2/access_log combinedvhost

     

    to

     

    CustomLog /var/log/apache2/access_log combinedvhostproxy

     

    You can do a copy and paste job once you have done one and it should work after you have restarted the web service.

     

    When you have done that and you update, you should follow the other description to fix the new log problem in the latest version (5.0.15).

  • by DazeConfusedAndLost,

    DazeConfusedAndLost DazeConfusedAndLost Oct 23, 2015 2:24 PM in response to scottl31
    Level 1 (34 points)
    Oct 23, 2015 2:24 PM in response to scottl31

    If you update to Server 5.0.15, you may also want to read the ReadMe file located at /Library/Server/Web/Config/apache2/ReadMe.txt.

    There are some additional information at the end regarding the new (Server app 5.x) proxy architecture.

     

    It appears that the Server team enabled the combinedvhostproxy log format by default. It is likely you will not need to edit the conf files in /Library/Server/Web/Config/apache2/sites/ after all. You will just need to edit Server app's conf file - see the thread PeterKjeldsen linked to above.

  • by scottl31,

    scottl31 scottl31 Oct 23, 2015 2:43 PM in response to DazeConfusedAndLost
    Level 1 (13 points)
    Servers Enterprise
    Oct 23, 2015 2:43 PM in response to DazeConfusedAndLost

    Do you guys recommend going to 5.0.15?

  • by DazeConfusedAndLost,

    DazeConfusedAndLost DazeConfusedAndLost Oct 23, 2015 2:57 PM in response to scottl31
    Level 1 (34 points)
    Oct 23, 2015 2:57 PM in response to scottl31

    Without knowing what your setup is and how mission critical it is, it's hard to say if you should update. Keep in mind that there are also a bunch of security updates bundled in the 5.0.15 update. So from that standpoint, yes, you should update. Along with OS X 10.11.1. Given you are already on 5.x, and is on the new proxy architecture, and everything is working, the update will likely be painless. [knock on wood]

     

    Reminder: Backup first.

  • by PeterKjeldsen,

    PeterKjeldsen PeterKjeldsen Oct 23, 2015 3:20 PM in response to scottl31
    Level 1 (0 points)
    Oct 23, 2015 3:20 PM in response to scottl31

    Yes for security reasons alone would be my answer, and yes it is reasonably painless.


    If you use round cube you should also make sure to export all contacts in the roundcube address book so you can import them after re-installing roundcube.

  • by scottl31,

    scottl31 scottl31 Oct 23, 2015 3:31 PM in response to PeterKjeldsen
    Level 1 (13 points)
    Servers Enterprise
    Oct 23, 2015 3:31 PM in response to PeterKjeldsen

    Mission critical in that we host a site that we wouldn't want to be offline. Right after the 5.0.3 update, it wasn't working correctly. Sites were trying to redirect to the wiki, which we aren't using. but it seemed fine after about an hour. So OK on 5.0.15? Sites not broken after updating? And IP in logs fixed?

  • by scottl31,

    scottl31 scottl31 Oct 23, 2015 3:35 PM in response to scottl31
    Level 1 (13 points)
    Servers Enterprise
    Oct 23, 2015 3:35 PM in response to scottl31

    Also, really hated yosemite. is el capitan any better?

  • by DazeConfusedAndLost,

    DazeConfusedAndLost DazeConfusedAndLost Oct 23, 2015 4:23 PM in response to scottl31
    Level 1 (34 points)
    Oct 23, 2015 4:23 PM in response to scottl31

    "Better" or "worst" is subjective. It all depends on what you are used to or (dis)like or expect. You won't notice much differences since you are running it in a server environment. As long as you are not installing any *nix packages from source, you shouldn't run into any issues with the new "Rootless" feature. Everything should work as it did before.

     

    If you do update to Server 5.0.15, you will still need to edit Server's http config file if you want to see visitor ip-addresses in the access_log. Or you may use the service_proxy_access.log instead, in which case, no editing necessary. Until Apple corrects the issue, that is.

Page 1 Next