Forum Moderators: coopster
Hmm, I get the IP ok but the host command output doesn't display. need to do a little more debugging, probably not finding the host command on my virtual server.
Warning: Don't put this script on the server that you're checking. Unless of course you're the type who likes to see yourself in the mirror. ;)
Hmm, I get the IP ok but the host command output doesn't display. need to do a little more debugging, probably not finding the host command on my virtual server.
What do you actually get? If it's just blank it would imply that the "host" command cannot be found in the path of the user that your web server is running as (or you don't have the host command installed). I'm running Redhat Linux 7.1, with Apache running as its own user - "apache" - i've done nothing special over the stock installation.
Warning: Don't put this script on the server that you're checking. Unless of course you're the type who likes to see yourself in the mirror. ;)
Ahah! Unless you knock up some mechanism so that your own requests are not logged...
[webmasterworld.com...]
What do you actually get?
yeah, I get nothing. I'm fairly certain that the web user's not finding the host command. It's a bit more complicated than path issues as it's a virtual server and the web user sees a different root directory than I see when I'm logged into the server.
Thanks for the tip on keeping myself out of the logs,
but I like to look at myself in the mirror ;)
Seriously, I find it more beneficial to see my own hits vs. not. And I do have another virtual host on the server with different access_logs to run this script from.
How would you modify your script to show, say, the last 100 requests for pages (not gifs etc)?
shell_exec("tail -n 100 /path/to/access_log") would return the complete output of the last 100 lines of your log.
You could then split() the output into an array of single lines and then loop through the array doing the same process as described above on each line.
Look in this thread for my post about supressing logging of images and other boring stuff...
[webmasterworld.com...]