I have not used any PHP command up till now. I was trying to make it work
using the apache(httpd) source code itself.
Can it be done without using any script language?? OR by adding some code
lines in the apache source code files itself??

On Thu, Dec 27, 2012 at 1:01 AM, John Iliffe <john.ili...@iliffe.ca> wrote:

> Maybe I'm missing something following this discussion, but doesn't the
> following PHP command fetch the information you need?  If so, I'm sure the
> same results can be obtained in other scripting languages.
>
>  $_SERVER['REMOTE_ADDR'];
>
> Regards,
>
> John
> ===========================================
> On Wednesday 26 December 2012 11:54:38 Bhavna Saini wrote:
> > Thanks for the info.
> > I have gone through customlog and i understand that it is used to log
> > the IP and other parameters,
> > But I want to compare the IP address of incoming requests with IP
> > address present in a pre-built data structure. After comparing, the
> > request will be served accordingly.
> > Therefore, I need the source code file of apache which accepts requests
> > and through which I can get the IP at the initial stage.
> >
> > It would be really helpful if you could provide me this info.
> >
> > Thanks,
> >
> > -Bhavna
> >
> > On Thu, Dec 20, 2012 at 10:39 PM, Tom Evans
> <tevans...@googlemail.com>wrote:
> > > On Thu, Dec 20, 2012 at 4:20 PM, Bhavna Saini
> > > <bhavnasain...@gmail.com>
> > >
> > > 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-unsubscr...@httpd.apache.org
> > > For additional commands, e-mail: users-h...@httpd.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
>
>

Reply via email to