Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. LAMP
  3. Proper IP Address and Hostname on Log

Proper IP Address and Hostname on Log

Scheduled Pinned Locked Moved Solved LAMP
4 Posts 2 Posters 637 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • njN Offline
      njN Offline
      nj
      wrote on last edited by
      #1

      Below is a sample log from LAMP app. Notice the IP address, which should have been the remote IP of the user-agent. Also when the app is configured to have multiple hostnames (aliases), there's no way to distinguish which service received the request. Please fix this. Thanks!

      May 10 23:22:23 172.18.0.1 - - [10/May/2021:17:37:23 +0000] "GET /path-redacted" HTTP/1.1" 301 1532 "-" "User-Agent redacted"
      May 10 23:22:25 172.18.0.1 - - [10/May/2021:17:37:25 +0000] "GET /path-redacted" HTTP/1.1" 301 532 "-" "Mozilla (CloudronHealth)"
      May 10 23:22:26 172.18.0.1 - - [10/May/2021:17:37:26 +0000] "GET /path-redacted" HTTP/1.1" 301 65332 "-" "User-Agent redacted"
      May 10 23:22:26 172.18.0.1 - - [10/May/2021:17:37:26 +0000] "GET /path-redacted" HTTP/1.1" 301 5932 "-" "User-Agent redacted"
      May 10 23:22:26 172.18.0.1 - - [10/May/2021:17:37:26 +0000] "GET /path-redacted" HTTP/1.1" 301 7532 "-" "User-Agent redacted"
      May 10 23:22:28 172.18.0.1 - - [10/May/2021:17:37:28 +0000] "GET /path-redacted" HTTP/1.1" 301 5032 "-" "User-Agent redacted"
      May 10 23:22:28 172.18.0.1 - - [10/May/2021:17:37:28 +0000] "GET /path-redacted" HTTP/1.1" 301 1532 "-" "User-Agent redacted"
      May 10 23:22:28 172.18.0.1 - - [10/May/2021:17:37:28 +0000] "GET /path-redacted" HTTP/1.1" 301 2532 "-" "User-Agent redacted"
      May 10 23:22:28 172.18.0.1 - - [10/May/2021:17:37:28 +0000] "GET /path-redacted" HTTP/1.1" 301 532 "-" "Mozilla (CloudronHealth)"
      May 10 23:22:30 172.18.0.1 - - [10/May/2021:17:37:30 +0000] "GET /path-redacted" HTTP/1.1" 301 1532 "-" "User-Agent redacted"
      May 10 23:22:41 172.18.0.1 - - [10/May/2021:17:37:41 +0000] "GET /path-redacted" HTTP/1.1" 301 1532 "-" "User-Agent redacted"
      

      Founder / Coder • My Apps

      girishG 2 Replies Last reply
      0
      • njN nj

        Below is a sample log from LAMP app. Notice the IP address, which should have been the remote IP of the user-agent. Also when the app is configured to have multiple hostnames (aliases), there's no way to distinguish which service received the request. Please fix this. Thanks!

        May 10 23:22:23 172.18.0.1 - - [10/May/2021:17:37:23 +0000] "GET /path-redacted" HTTP/1.1" 301 1532 "-" "User-Agent redacted"
        May 10 23:22:25 172.18.0.1 - - [10/May/2021:17:37:25 +0000] "GET /path-redacted" HTTP/1.1" 301 532 "-" "Mozilla (CloudronHealth)"
        May 10 23:22:26 172.18.0.1 - - [10/May/2021:17:37:26 +0000] "GET /path-redacted" HTTP/1.1" 301 65332 "-" "User-Agent redacted"
        May 10 23:22:26 172.18.0.1 - - [10/May/2021:17:37:26 +0000] "GET /path-redacted" HTTP/1.1" 301 5932 "-" "User-Agent redacted"
        May 10 23:22:26 172.18.0.1 - - [10/May/2021:17:37:26 +0000] "GET /path-redacted" HTTP/1.1" 301 7532 "-" "User-Agent redacted"
        May 10 23:22:28 172.18.0.1 - - [10/May/2021:17:37:28 +0000] "GET /path-redacted" HTTP/1.1" 301 5032 "-" "User-Agent redacted"
        May 10 23:22:28 172.18.0.1 - - [10/May/2021:17:37:28 +0000] "GET /path-redacted" HTTP/1.1" 301 1532 "-" "User-Agent redacted"
        May 10 23:22:28 172.18.0.1 - - [10/May/2021:17:37:28 +0000] "GET /path-redacted" HTTP/1.1" 301 2532 "-" "User-Agent redacted"
        May 10 23:22:28 172.18.0.1 - - [10/May/2021:17:37:28 +0000] "GET /path-redacted" HTTP/1.1" 301 532 "-" "Mozilla (CloudronHealth)"
        May 10 23:22:30 172.18.0.1 - - [10/May/2021:17:37:30 +0000] "GET /path-redacted" HTTP/1.1" 301 1532 "-" "User-Agent redacted"
        May 10 23:22:41 172.18.0.1 - - [10/May/2021:17:37:41 +0000] "GET /path-redacted" HTTP/1.1" 301 1532 "-" "User-Agent redacted"
        
        girishG Do not disturb
        girishG Do not disturb
        girish
        Staff
        wrote on last edited by
        #2

        @nj Thanks for reporting, I see the same behavior. The LAMP app is supposed to have RPAF module which fixes the IP address but clearly it's not working. Investigating...

        1 Reply Last reply
        0
        • girishG Do not disturb
          girishG Do not disturb
          girish
          Staff
          wrote on last edited by
          #3

          With the php below, I can confirm the app can see the real IP. It's just the logs:

          <?php
          print_r($_SERVER);
          print_r($_POST);
          print_r($_GET);
          print_r($_FILES);
          ?>
          
          1 Reply Last reply
          0
          • njN nj

            Below is a sample log from LAMP app. Notice the IP address, which should have been the remote IP of the user-agent. Also when the app is configured to have multiple hostnames (aliases), there's no way to distinguish which service received the request. Please fix this. Thanks!

            May 10 23:22:23 172.18.0.1 - - [10/May/2021:17:37:23 +0000] "GET /path-redacted" HTTP/1.1" 301 1532 "-" "User-Agent redacted"
            May 10 23:22:25 172.18.0.1 - - [10/May/2021:17:37:25 +0000] "GET /path-redacted" HTTP/1.1" 301 532 "-" "Mozilla (CloudronHealth)"
            May 10 23:22:26 172.18.0.1 - - [10/May/2021:17:37:26 +0000] "GET /path-redacted" HTTP/1.1" 301 65332 "-" "User-Agent redacted"
            May 10 23:22:26 172.18.0.1 - - [10/May/2021:17:37:26 +0000] "GET /path-redacted" HTTP/1.1" 301 5932 "-" "User-Agent redacted"
            May 10 23:22:26 172.18.0.1 - - [10/May/2021:17:37:26 +0000] "GET /path-redacted" HTTP/1.1" 301 7532 "-" "User-Agent redacted"
            May 10 23:22:28 172.18.0.1 - - [10/May/2021:17:37:28 +0000] "GET /path-redacted" HTTP/1.1" 301 5032 "-" "User-Agent redacted"
            May 10 23:22:28 172.18.0.1 - - [10/May/2021:17:37:28 +0000] "GET /path-redacted" HTTP/1.1" 301 1532 "-" "User-Agent redacted"
            May 10 23:22:28 172.18.0.1 - - [10/May/2021:17:37:28 +0000] "GET /path-redacted" HTTP/1.1" 301 2532 "-" "User-Agent redacted"
            May 10 23:22:28 172.18.0.1 - - [10/May/2021:17:37:28 +0000] "GET /path-redacted" HTTP/1.1" 301 532 "-" "Mozilla (CloudronHealth)"
            May 10 23:22:30 172.18.0.1 - - [10/May/2021:17:37:30 +0000] "GET /path-redacted" HTTP/1.1" 301 1532 "-" "User-Agent redacted"
            May 10 23:22:41 172.18.0.1 - - [10/May/2021:17:37:41 +0000] "GET /path-redacted" HTTP/1.1" 301 1532 "-" "User-Agent redacted"
            
            girishG Do not disturb
            girishG Do not disturb
            girish
            Staff
            wrote on last edited by
            #4

            @nj I have fixed this in the new package. However, it will work only for new installation. For existing install, you have to edit /app/data/apache/app.conf and add the following lines (You can add it after the DocumentRoot /app/data/public line):

                LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
                CustomLog "|/bin/cat" proxy
                ErrorLog "|/bin/cat"
            

            After that restart the app.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Bookmarks
              • Search