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]

 



Thanks Eric. I need.one more help.
In mod_log_config file, I found  "r->connection->remote_ip" and "r->connection->local_ip" fields. To retrieve the values of these fields i wrote a small code in "mod_log_config" file itself under "static const char *log_remote_address(request_rec *r, char *a)" which is as follows:
{
File *fp;
fp=fopen("/file.txt","a");
fprintf(fp,"%s",r->connection->remote_ip);
flose(fp);
}
 after that I compiled the whole httpd source code using "make" command, it worked fine without any error. Then i sent request to the server from different system, even than the file.txt didn't create nor the IP address. 
Please let me know if I am doing it right or wrong. How do i perform it, so that i can get IP addresses of all incoming requests as soon as they arrive the server.
 
Thanks
-Bhavna 
On Fri, Dec 14, 2012 at 6:21 PM, Eric Covener <covener@xxxxxxxxx> wrote:
mod_log_config writes out IP addresses to the log. You could read the
same data in any hook.

On Fri, Dec 14, 2012 at 12:56 AM, Bhavna Saini <bhavnasaini10@xxxxxxxxx> wrote:
> Hi,
>
> I am working on Apache httpd web server source code i.e. "httpd-2.2.23" for
> my thesis.
> I want to retrieve the IP addresses of the Clients from which the requests
> are coming to web server and want to save it in a text file. How it can be
> done using source code.
> Please let me know the file of source code through which i can get it.
>
> Thanks,
> Bhavna



--
Eric Covener
covener@xxxxxxxxx

---------------------------------------------------------------------
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