You are not logged in.

#1 2015-07-02 16:06:52

Tuxy
Member
Registered: 2015-04-26
Posts: 22

nginx-stats.sh v1.0 {2015-06-24}

nginx-stats.sh v1.0 {2015-06-24} by Tux
Simple nginx web server access log stats, all and unique ip counters.
https://github.com/tuxy/bash/blob/master/nginx-stats.sh

--- Install ---

// download script to your server

sudo curl -s https://raw.githubusercontent.com/tuxy/bash/master/nginx-stats.sh -o ~/

// change script directories

txt='/home/web/pub/stats.txt'
dir='/var/log/nginx'

"txt" directory is where you're stats will be saved.
"dir" directory is for nginx access logs.

// set script execute permission

sudo chmod +x ~/nginx-stats.sh

// edit root crontab

sudo crontab -u root -e

// add script to root crontab

@hourly /home/user/nginx-stats.sh

// example output

 Nginx Traffic Stats
 ~~~~~~~~~~~~~~~~~~~
 All Hits ......: 9,541
 Unique Hits ...: 1,335

Note you can also move this script to /root and use "~/nginx-stats.sh" in crontab instead.

Last edited by Tuxy (2015-07-02 16:50:14)


--{ Using Arch Linux Since 2011-10-25 }--
Keybase @ https://keybase.io/tuxy
GitHub @ https://github.com/tuxy

Offline

#2 2015-07-02 16:14:38

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: nginx-stats.sh v1.0 {2015-06-24}

Are your packages in the AUR?

Offline

#3 2015-07-02 16:23:19

Tuxy
Member
Registered: 2015-04-26
Posts: 22

Re: nginx-stats.sh v1.0 {2015-06-24}

@karol, No just git :-) Why?


--{ Using Arch Linux Since 2011-10-25 }--
Keybase @ https://keybase.io/tuxy
GitHub @ https://github.com/tuxy

Offline

Board footer

Powered by FluxBB