1820027 Members
3495 Online
109608 Solutions
New Discussion юеВ

Apache Linux 9

 
SOLVED
Go to solution
Nobody's Hero
Valued Contributor

Apache Linux 9

I am running RH9 with Apache. In the /var/log/httpd directory, I have an access_log file. It looks like:

111.111.11.1 - - [14/Mar/2004:08:38:46 -0500] "GET /thi_fac_acct_rpt.html HTTP/1.1" 200 19117

Is there any way that I can get Apache to tell me who 111.111.11.1 is? Can I get Apache to reflect a login id rather than IP?

10x
RPM
UNIX IS GOOD
4 REPLIES 4
Paul Cross_1
Respected Contributor
Solution

Re: Apache Linux 9

There used to be a directive in much older apache versions that did this. I don't think this exists anymore... You could easily script it, but this looks cool:

http://httpd.apache.org/docs-2.1/programs/logresolve.html
Claudio Cilloni
Honored Contributor

Re: Apache Linux 9

Apache doens't know the login id. It receives HTTP requests through TCP connection, and it knows only the remote IP address and port. That line means that a client from the ip address 111.111.11.1 asked for the file thi_fac_acct_rpt.html, and apache replied sending that file to the client.

Hope I'm not going wrong...

Ciao
Claudio
Paul Cross_1
Respected Contributor

Re: Apache Linux 9

Maybe I wasn't sure what you meant... Are you trying to get IP to hostname info, or the name of the user?

The link I gave you is for resolving ip numbers to hostnames. If you are trying to get the userid, that would depend on how, if, when, you are doing user authentication.

-p
Claudio Cilloni
Honored Contributor

Re: Apache Linux 9

by the way... I remember it is possible to activate the name resolution of the ip address (but I don't remember how), so in the log file you will see the dns name corresponding to that ip. But this could cause apache to do a lot of queries to the dns service.
but this isn't the login id you asked for...

Ciao
Claudio