Every request to a website is written as one line in the web server's access log. That file is the most precise record of what is happening on the site: which pages were opened, which IPs made the most requests, who is trying to guess the admin password and which bot is hunting for files that do not exist. When a site slows down, server load spikes or you suspect a breach, being able to read logs saves a lot of time. This article shows how to analyse them with standard Linux commands and no special software.
Anatomy of a log line
Apache and Nginx usually log in the "combined" format: client IP, timestamp, method and path, status code, response size, referrer and user agent. With awk, field 1 is the IP, field 4 the time, fields 6 and 7 the method and path, and field 9 the status code.
203.0.113.45 - - [28/Oct/2026:14:31:07 +0500] "POST /wp-login.php HTTP/1.1" 200 4521 "-" "Mozilla/5.0"
On a VPS logs usually live in /var/log/nginx/ or /var/log/apache2/. On shared hosting they are in the panel's logs section or a dedicated folder in the account; the panel or support can tell you where. Older logs are typically compressed as access.log.2.gz and so on.
Top IPs and brute-force attempts
Start by finding the addresses with the most requests. A normal visitor makes dozens, at most hundreds, of requests a day, so an IP with tens of thousands deserves a look, although search engine bots and your own office IP will also appear. Password guessing on WordPress shows up as many POST requests to /wp-login.php and /xmlrpc.php.
zcat -f access.log* | awk '{print $1}' | sort | uniq -c | sort -rn | head -20
grep -E '"POST /(wp-login|xmlrpc)\.php' access.log \
| awk '{print $1}' | sort | uniq -c | sort -rn | head
If the attempts come from hundreds of different IPs, it is a distributed attack and IP blocking will not help. Protect the login itself instead, with two-factor authentication or by allowing the login page only from known addresses.
Vulnerability scanners
Scanners probe for secrets that are common on other sites: .env, the .git folder, config backups, phpMyAdmin paths. These requests usually get a 404, so grouping 404s by IP exposes them quickly. If any of them received a 200, treat it as urgent: the secret file really is exposed.
awk '$9==404 {print $1}' access.log | sort | uniq -c | sort -rn | head
grep -E '\.env|/\.git/|wp-config\.php\.|phpmyadmin' access.log \
| awk '{print $1, $7, $9}' | sort | uniq -c | sort -rn | head -30
Following one IP and verifying bots
Once you have a suspicious address, view its activity in order with grep "^203.0.113.45 " access.log | awk '{print $4, $6, $7, $9}'. A real visitor loads pages along with images and styles; a bot hammers one type of URL. Requests per hour, from awk '{print substr($4,2,14)}' access.log | sort | uniq -c, show when load spikes. Many abusive bots claim to be Googlebot, so verify with reverse DNS: a genuine Googlebot IP resolves to a name ending in googlebot.com or google.com, and that name resolves back to the same IP.
awk -F'"' '{print $6}' access.log | sort | uniq -c | sort -rn | head
host 66.249.66.1
host crawl-66-249-66-1.googlebot.com
whois 203.0.113.45
Example: a furniture shop in Tashkent
A furniture shop's site slowed down every evening. Hourly counts from the log showed requests multiplying around 8 pm. Among the top IPs was a group claiming to be a search bot, but reverse DNS showed they came from a single foreign data centre with no link to any search engine. The bot was crawling every combination of catalogue filters, generating thousands of heavy pages. Blocking those addresses ended the evening slowdowns.
Blocking suspicious IPs
Block only clearly confirmed cases, because a wrong block can shut out real customers or search engines, and be especially careful with whole ranges, since mobile operators serve thousands of users from one range.
# Apache 2.4, .htaccess
<RequireAll>
Require all granted
Require not ip 203.0.113.45
Require not ip 198.51.100.0/24
</RequireAll>
# Nginx, inside the server block
deny 203.0.113.45;
deny 198.51.100.0/24;
IP blocking is a stopgap, as attackers change addresses quickly. Lasting protection comes from keeping the CMS and plugins updated, protecting the login page and reviewing logs regularly. If an attack on shared hosting is loading the server itself, sayt.uz customers can open a ticket in the cabinet with the list of IPs.