Re: How to retrieve IP address of incoming packets in text file using httpd source code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 20, 2012 at 4:20 PM, Bhavna Saini <bhavnasaini10@xxxxxxxxx> wrote:
> Hi Eric,
>
> In the previous mail you mentioned that "webserver can't write to /file.txt
> from a child process". I couldn't get it properly. Please give some more
> details of it.

Eric is saying that normally only root can write to the root file
system directory '/', and therefore a child process, typically running
as apache or www, would not be able to write to it.

>
> Actually I want to retrieve the IP addresses of incoming requests as soon as
> it reaches the server and want to save it in a file. Please let me know
> using which source code file of apache web server I can perform it.
>
> Thanks,
>
> -Bhavna

Why would you want to edit source code to do that?

CustomLog logs/ip_request.log "%a %U"

http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#customlog

This would create a file at $SERVER_ROOT/logs/ip_request.log with
contents like so:

192.168.1.1 /index.html
192.168.1.10 /favicon.ico

Cheers

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux