Portal Home > Knowledgebase > Articles Database > How to know ip and user agent of the latest visitor using ubuntu


How to know ip and user agent of the latest visitor using ubuntu




Posted by new2world, 02-22-2016, 05:51 AM
Hi, Would like to know, how can I check the latest visitor to my site using ubuntu and it's user agent Don't have panel just shell. Kindly guide me thanks

Posted by Andei, 02-22-2016, 06:05 AM
Well, the easy way would be to use an analytics software on your website, such as Piwik, which would record all of your visitors. Then you can view just the Ubuntu segment, from Visitors > Software > http://i.imgur.com/D22YrGS.png Of course, you can also go the programming way, and code it yourself, you can fetch the user's IP via PHP, and OS/User Agent via javascript, then save that info in your database and query just the visitors with Ubuntu OS.

Posted by Bitpalace, 02-22-2016, 07:53 AM
Your website has an access_log file. In that log file you can see the latest IP addresses visiting your site including what they are viewing. You will also see the user agent that the user is surfing with.

Posted by net, 02-22-2016, 08:01 AM
Another option is to put some script like live chat with visitor detection. Livezilla has one.

Posted by Giovanni M, 02-22-2016, 08:21 AM
You can check your access_log file in case you are running Apache. Since this is Ubuntu, the log file should be found at /var/log/apache2/access.log To get the last line, you can run the following command: tail -n 1 /var/log/apache2/access.log The line should contain the IP address, date, request URL, return code and the user agent.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read