vi /etc/nginx/sites-available/web-log-analyser.conf
upstream websocket { server 127.0.0.1:57890; } server { listen 80; listen [::]:80; server_name web-log-analyser.<domaine-sinp>; auth_basic "Zone restreinte"; auth_basic_user_file /etc/nginx/.htpasswd; location ^~ /ws { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_pass http://websocket; proxy_http_version 1.1; proxy_read_timeout 1d; } location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $realip_remote_addr; proxy_set_header X-Forwarded-Host $host:$server_port; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://127.0.0.1:50082/;# ATTENTION : bien mettre un slash final ! Sinon => erreur 404 } }
cd /etc/nginx/sites-enabled/ ; ln -s ../sites-available/web-log-analyser.conf web-log-analyser.conf
nginx-reload
ou nginx -t && nginx -s reload
docker network ls
cd ~/docker/web-log-analyser
docker compose up
CTRL+C
docker compose up -d
docker compose down
certbot --nginx -d web-log-analyser.silene.eu
certbot --nginx -d web-log-analyser.biodiversite-aura.net
ws-url
: remplacer ws: par
wss:
et remplacer le port 80
par 443
origine
: remplacer le scheme de l'URL http
par https
upstream websocket { server 127.0.0.1:57890; } server { listen 443 ssl http2; # managed by Certbot listen [::]:443 ssl http2; # managed by Certbot server_name web-log-analyser.<domaine-sinp>; auth_basic "Zone restreinte"; auth_basic_user_file /etc/nginx/.htpasswd; location ^~ /ws { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_pass http://websocket; proxy_http_version 1.1; proxy_read_timeout 1d; } location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $realip_remote_addr; proxy_set_header X-Forwarded-Host $host:$server_port; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://127.0.0.1:50082/;# ATTENTION : bien mettre un slash final ! Sinon => erreur 404 } ssl_certificate /etc/letsencrypt/live/web-log-analyser.<domaine-sinp>/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/web-log-analyser.<domaine-sinp>/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } server { listen 80; listen [::]:80; server_name web-log-analyser.<domaine-sinp>; return 302 https://web-log-analyser.<domaine-sinp>$request_uri; }
%Y-%m-%d
/web-srv/opt/goaccess-reports
rsync -av ./web-srv/opt/ admin@web-<region>-sinp:/home/admin/dwl/ --dry-run
rsync -av ./web-srv/opt/ admin@web-<region>-sinp:/home/admin/dwl/
/opt/goaccess-reports/
: cp -r /home/admin/dwl/goaccess-reports /opt/
chmod +x *-report
/etc/cron.d/
en supprimant son extension .cron : cp /opt/goaccess-reports/goaccess_reports.cron /etc/cron.d/goaccess_reports
service cron reload
/opt/goaccess-reports/daily-report <date-au-format-YYYY-MM-DD>
. Ex. : /opt/goaccess-reports/daily-report 2020-01-01
/opt/goaccess-reports/weekly-report <date-d-un-lundi-au-format-YYYY-MM-DD>
. Ex. : /opt/goaccess-reports/daily-report 2020-01-13
/opt/goaccess-reports/monthly-report <date-d-un-jour-du-mois-au-format-YYYY-MM-DD>
. Ex. : /opt/goaccess-reports/monthly-report 2020-01-01
~/docker/web-log-analyser/goaccess/
docker-compose.yml
et ajouter le volume suivant au container web-log-analyser-goaccess : - ./goaccess/dbip-city-lite-2023-06.mmdb:/var/lib/GeoIP/GeoLite2-City.mmdb
.wrap-panels:after { content: "IP Geolocation by DB-IP : https://db-ip.com"; color: grey; }
docker-compose.yml
: - ./goaccess/custom.css:/goaccess/reports/custom.css:ro
# User interfaces Options html-custom-css /custom.css # Geolocation Options geoip-database /var/lib/GeoIP/GeoLite2-City.mmdb
docker compose restart
--persist
, --restore
et --db-path=/goaccess/database
. Normalement, cela devrait nous permettre de retrouver toutes logs analysés dans l'interface en temps réel…