Why can't 80% of the code farmers be architects? >>> 
aims
usegoaccessView nginx logs in real time on the browser.
step
Install goaccess
Log in to the CentOS server and install goaccess using yum:
yum install goaccess
There is no available package goaccess.
There is no goaccess in yum of centos7, and then only compile and install manually.
Install dependencies
yum install ncurses-devel
yum install geoip-devel
yum install tokyocabinet-devel
yum install openssl-devel
Install goaccess manually
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
Configure nginx
vim /var/nginx/conf/nginx.conf
# Add request configuration
location /report.html {
alias /var/nginx/html/report.html;
}
Restart nginx
systemctl restart nginx.service
Use goaccess
cd /var/nginx/logs
goaccess budget.access.log -o ../html/report.html --real-time-html --time-format='%H:%M:%S' --date-format='%d%b%Y' --log-format=COMBINED
verification
In a browser, openhttp: // xxxxx: 8080 / report.html, you can view the real-time log, the effect is as follows:
