ip:
awk '{print $1}' /var/log/httpd/site.ru_access.log | sort | uniq -c | sort -nr | head -20
User-Agent
awk -F\" '{print $6}' /var/log/httpd/site.ru_access.log | sort | uniq -c | sort -nr | head -20
Рубрика
Всего: 61 запись
ip:
awk '{print $1}' /var/log/httpd/site.ru_access.log | sort | uniq -c | sort -nr | head -20
User-Agent
awk -F\" '{print $6}' /var/log/httpd/site.ru_access.log | sort | uniq -c | sort -nr | head -20
Автоматический перезапуск tomcat если он не активен
#!/bin/bash TOMCAT_PID=$(ps -ef | awk '/[t]omcat/{print $2}') echo TOMCAT PROCESSID $TOMCAT_PID if [ -z "$TOMCAT_PID" ] then echo "TOMCAT NOT RUNNING" service tomcat restart else echo "TOMCAT RUNNING" fi
При ошибке обновления:
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=genclo error was
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
ls -l ./ | sed -n 's~^-.*\(\..*\)$~\1~p' | sort | uniq
grep "/test/" ./log.log | cut -d ' ' -f 1 | sort | uniq -c | sort -n | tail -n 30
Источник: https://habr.com/ru/articles/236771/
iptables -A INPUT -s 192.168.10.10 -j DROP
cat access.log | cut -d'"' -f 6 | grep bot | sort | uniq
Заблокировать лишних в .htaccess
SetEnvIfNoCase User-Agent "AhrefsBot|DotBot|SemrushBot|PetalBot" bad_bot <Limit GET POST HEAD> Order Allow,Deny Allow from all Deny from env=bad_bot </Limit>