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.
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 On Sat, Dec 15, 2012 at 11:20 PM, Bhavna Saini <[email protected]>wrote: > > > ---------- Forwarded message ---------- > From: Eric Covener <[email protected]> > Date: Sat, Dec 15, 2012 at 6:22 PM > Subject: Re: [users@httpd] How to retrieve IP address of incoming packets > in text file using httpd source code > To: [email protected] > > > On Sat, Dec 15, 2012 at 5:04 AM, Bhavna Saini <[email protected]> > wrote: > > 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. > > > > Your webserver can't write to /file.txt from a child process. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > >
