goaccess install and use

Installation depends

$ sudo apt-get install libncursesw5-dev
$ Wget https: // github.com/maxmind/geoip-api-c/releases/download/v1.6.11/GeoIP-1.6.11.tar.gz 
$ takes -xzvf GeoIP- 1.6 . 11 .tar.gz
$ cd GeoIP-1.6.11
$ ./configure
$ make
# make install

installation

$ wget https://tar.goaccess.io/goaccess-1.3.tar.gz
$ Tar -xzvf goaccess-1.3.tar.gz
$ cd goaccess-1.3/
$ ./configure --enable-utf8 --enable-geoip=legacy
$ make
# make install

 

Nginx configuration

location /report.html {
            alias /home/zopen/nginx/html/report.html; # specify the directory of individual configuration
        }
#转发websocket请求
location /goaccess { proxy_pass http://127.0.0.1:7890; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }

start up

--ws-url need to change their host + port must be added if it is 80
$ /usr/bin/goaccess /usr/local/nginx/logs/nginx.log  -o /var/html/report.html  --real-time-html --time-format='%H:%M:%S'  --date-format='%d/%b/%Y'   --daemonize --ws-url=host:80/goaccess

  

 

 

  

Guess you like

Origin www.cnblogs.com/tl542475736/p/11628568.html