Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Can one identify unique users from apache log file with 100% surety ?.

For e.g. If 10 users are accessing the a website from a proxy server. What IP will the log file show ?. Proxy server's IP or users ?.

Also what is a better way of tracking users ?.

Log file based analysis or Javascript based embedding in Application ?.

Regards Ankur Gupta

share|improve this question
add comment

3 Answers 3

Can one identify unique users from apache log file with 100% surety ?

I don't think so, not unless you are having them log in with Apache authentication - in that case, their username would show up in the log file.

For e.g. If 10 users are accessing the a website from a proxy server. What IP will the log file show ?. Proxy server's IP or users ?

You would see the proxy server's IP because the users are connecting to you through the proxy. Similarly, any group of users NAT'ed on a LAN will appear to come from a single IP.

Also what is a better way of tracking users ?

You might try using cookies/sessions for that purpose.

share|improve this answer
    
Thanks for the answer molecularbear. –  user15861 Dec 5 '09 at 10:01
add comment

The common log format generally shows the remote IP address. For users behind a router or NAT, this will be the address of their router.

Apache logs are best at counting raw traffic. They can be used to track individual sessions if the application that Apache is serving puts some unique identifier (like a session id) in the url.

User tracking is difficult at best, and should be done at the application level. Web applications can track individual user actions and correlate them with who is logged in, etc.

Alternatively, you can using something like Google Analytics.

share|improve this answer
    
Thanks for the answer seth. –  user15861 Dec 5 '09 at 10:00
add comment

As already mentioned in the other answers, you cannot track the users of your website with dead certainty.

This said, Apache httpd delivers a nice module named mod_usertrack, which uses cookies to track users on your site. Of course it will only work if users allow cookies from your domain and their web browser supports cookies at all.

The same would be true for any JavaScript-based solution like Google Analytics or Piwik: they only work if the client supports the specific technology (JavaScript, cookies...).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.