Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
How to Store Server IP in apache log file

I am using an AWS AutoScaling Group. Here i have hosted Apche-Ubuntu instances. I want to log which server served the content, by logging its ip.

Closest I have found is this https://ubuntuforums.org/archive/index.php/t-1401710.html (February 11th, 2010, 04:07 PM) comment.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

In Apache you can use the directive LogFormat which allows you to determine what information is included in the header of each log. You create LogFormat strings in the apache2.conf, then use those strings when you use the CustomLog directive.

Example used in the Apache help:

LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog "logs/access_log" common

This means that the logs in access_log will have this information included:

  • Remote Host Name
  • Remote logname
  • Remote User
  • Time
  • First line of request (put in quotes)
  • Final status
  • Size of the request in bytes

In the log formats documentation there is a %A - Local IP-address

I have never tested it, but it might work for what you need.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!