The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hits By Country

Discussion in 'General Discussion' started by Osama Tariq, May 19, 2016.

  1. Osama Tariq

    Osama Tariq Well-Known Member

    Joined:
    Nov 27, 2014
    Messages:
    187
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Lahore, Pakistan
    cPanel Access Level:
    Root Administrator
    Twitter:
    Is there any way view website hits by country in command line.
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello :),

    No, You can not check this through command line but you can check live access logs of any domain through command line.
     
  3. Osama Tariq

    Osama Tariq Well-Known Member

    Joined:
    Nov 27, 2014
    Messages:
    187
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Lahore, Pakistan
    cPanel Access Level:
    Root Administrator
    Twitter:
    We can dig out from logs:

    Code:
    LIST=`grep -R "$domain" /usr/local/apache/domlogs/* | awk '{print $1}' |cut -d ':' -f2| sort -nr | uniq -c |grep -v "-" | sort -nr | head -1|awk '{print $2}'`
    
    for i in `cat $LIST`; do   
    geoiplookup $i | grep "GeoIP Country Edition"
    done
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,724
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm happy to see you were able to find a solution for separating the access requests by country. Thank you for updating us with the outcome.
     
Loading...

Share This Page