-1

Is it possible to log the IP address associated with SNI in the apache logs? I realize that this is SSL when it connects, so if its not now, Im wondering if apache would add it so at least we could get the IP address when I see the following in my logs:

[Wed May 15 04:12:58 2013] [error] No hostname was provided via SNI for a name based virtual host

I ask because I see many hacking/probing attempts and want to use fail2ban to ban them.

Thanks

Tim
  • 203
  • 1
  • 9

1 Answers1

2

Have you reviewed the Apache documentation, specifically the section on custom log formats?
The answer you seek is almost certainly in the manual - you can log nearly anything you can think of.

In this particular case you want to add the remote IP address (%a), and possibly the local IP address (%A - though like Michael pointed out that's probably not very useful if your goal is to ban offenders) to your Error log format.

voretaq7
  • 79,879
  • 17
  • 130
  • 214