On Thu, Dec 20, 2012 at 4:20 PM, Bhavna Saini <bhavnasaini10@xxxxxxxxx> wrote:Eric is saying that normally only root can write to the root file
> 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.
system directory '/', and therefore a child process, typically running
as apache or www, would not be able to write to it.
Why would you want to edit source code to do that?
>
> 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
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