Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

223
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda