Skip to content

Web Server security checklist

Web Server Logging & Monitoring Checklist: 5 Checks (2026)

Logs are the first thing you reach for after an incident and the last thing anyone verifies is working. This page documents all 5 checks in the CtrlOps Logging and Monitoring audit: what each one reads, the exact value that passes, the values that warn or fail, and the command to fix it.

Hiren Kalariya
Hiren Kalariya

Last reviewed · 13 min read

Example: CtrlOps runs these 5 checks in about 12 seconds, against ~15 min by hand, gives the server a hardening score and proposes fixes that run only after you approve them.

Audit this server in ~12s, not ~15 min.A clear report, and AI fixes you approve. 14-day free trial, no credit card required.

Download for MacDownload for Windows
Checks
5
Rated high
0
Full audit
~12s with CtrlOpsvs ~15 min by hand
Need root
2 of 5

The 5 checks in the order the audit runs them

Select a check to jump to its command, thresholds and fix.

  1. 01Will there be a record of the requests that led up to an incident?No access log directive at all, and access_log off in individual blocks on a server that logs globally.Severity: MEDIUM
  2. 02Are errors being recorded, and at a level that is neither silent nor a disk hazard?No error_log or ErrorLog directive, and a level set to debug or trace in production.Severity: LOW
  3. 03Can every account on the host read your access logs?Files in the web server log directories with the world-readable bit set.Severity: MEDIUMNeeds root
  4. 04Will the log directory fill the disk before anyone notices?logrotate missing, no logrotate config for the web server, and log files over 100MB.Severity: MEDIUMNeeds root
  5. 05Does anything inspect a request before the application handles it?No ModSecurity, NAXSI or CDN WAF, with log-based IP banning reported separately as the weaker alternative.Severity: MEDIUM

The server went down overnight. You open the access log and it is empty: not quiet, empty. Rotation ran a fortnight ago, the new file came back with the wrong permissions, and the server has been dropping log writes ever since. This page documents the 5 checks in the CtrlOps Logging and Monitoring audit, in the order the audit runs them.

Every threshold below is transcribed from the audit script itself. Four of these checks are about whether you will have a record when you need one, and the fifth is about whether anything inspects a request before your application does.

Key takeaways

Five checks, no HIGH severity, and one of them is the only check in the category that fails for something being absent rather than wrong.

  • Four are MEDIUM and one is LOW. Nothing here is HIGH, because none of it stops an attack. What it decides is whether you can reconstruct one.
  • Two need root: log permissions and rotation, because both read inside /var/log/nginx, /var/log/apache2 or /var/log/httpd.
  • Only access logging can fail, and only when no access log is configured anywhere. Everything else warns.
  • The WAF check draws a line that matters. Fail2Ban and CrowdSec ban an IP after a request has been served. A WAF inspects the request before it is handled. The audit reports the first as a warning rather than counting it as the second.
  • The whole audit takes about 12 seconds when CtrlOps runs it over your existing SSH connection, against roughly 15 minutes of grep and stat per host by hand.
#CheckSeverityWhat it catchesRoot needed
1Access loggingMEDIUMNo access log, or blocks with it disabledNo
2Error loggingLOWNo error log, or debug level in productionNo
3Log permissionsMEDIUMWorld-readable log filesYes
4Log rotationMEDIUMNo rotation, or logs past 100MBYes
5Web application firewallMEDIUMNo request filtering at any layerNo

Severity: MEDIUMNo root neededAccess Logging

The access log is the only record of what was requested, by whom and when. Without it, an incident investigation starts and ends with guesswork: no source addresses, no request paths, no timeline, nothing to hand an insurer or a client.

The audit counts access_log directives in the Nginx config, separating those whose value is literally off from the rest, and counts CustomLog or TransferLog in Apache. That separation is deliberate: an earlier version matched the string off anywhere in the line and treated /var/log/nginx/offers.log as disabled logging.

How to check manually

bash
grep -rnE '^[[:space:]]*access_log' /etc/nginx/ | grep -v '#'grep -rnE '^[[:space:]]*access_log[[:space:]]+off[[:space:]]*;' /etc/nginx/ | grep -v '#'grep -rniE '^[[:space:]]*(CustomLog|TransferLog)' /etc/apache2/ /etc/httpd/ 2>/dev/null | grep -v '#'sudo tail -1 /var/log/nginx/access.log

What each result means
ResultWhenWhat it means
PASSAt least one access log is configured and no block disables itAccess logging is enabled. Keep it, it is your only record of an attack.
WARNLogging is on globally but disabled in one or more blocksThe number of blocks with access_log off is named. Confirm those are static asset paths rather than application routes.
FAILNo access log is configured anywhereAfter an incident you will have nothing to investigate with.
SKIPNo web server detected on the hostNothing to evaluate.

The warning is the one worth investigating rather than dismissing. Turning off logging for an image directory is a reasonable performance decision. Turning it off for a high-traffic API endpoint to save disk is how the one route worth investigating becomes the one route with no history.

How to fix it

nginx
# Per site, so traffic can be separated without parsing one huge fileaccess_log /var/log/nginx/sitename-access.log combined;

apache
CustomLog /var/log/apache2/sitename-access.log combined

Use the combined format rather than common: it adds the referer and user agent, which are what let you tell a scanner apart from a browser after the fact.

Severity: LOWNo root neededError Logging

The error log is where the first clue lives in almost every debugging session: an upstream timeout, a permission denial, a worker crash. Set too high and those never appear. Set to debug in production, the log fills the disk and can record request bodies, which means credentials in a file that ships to wherever your logs go.

The audit reads the first error_log directive from Nginx and the first ErrorLog or LogLevel from Apache, then checks whether either names debug or trace.

How to check manually

bash
grep -rnE '^[[:space:]]*error_log' /etc/nginx/ | grep -v '#'grep -rniE '^[[:space:]]*(ErrorLog|LogLevel)' /etc/apache2/ /etc/httpd/ 2>/dev/null | grep -v '#'

What each result means
ResultWhenWhat it means
PASSAn error log directive exists and the level is not debug or traceError logging is configured at a production-appropriate level.
WARNNo error log directive exists, or the level is debug or traceTwo distinct warnings. The first says errors may be going nowhere. The second says the level fills the disk and can record request bodies.
SKIPNo web server detected on the hostNothing to evaluate.

Note that the check reads the first directive it finds rather than every one. A global warn with a debug override on one vhost can pass, so if you deliberately raised the level somewhere, that is on your list rather than the audit's.

How to fix it

nginx
error_log /var/log/nginx/error.log warn;

apache
ErrorLog ${APACHE_LOG_DIR}/error.logLogLevel warn

warn captures warnings, errors and everything more severe, which is the right production floor. Raise it to info for a specific troubleshooting session and put a reminder somewhere to lower it again.

Severity: MEDIUMNeeds rootWeb Server Log Permissions

Access logs carry more than addresses. They carry every requested URL, which on a badly designed application includes session tokens, password reset links, API keys in query strings and internal paths nobody meant to publish. World-readable means every account on the host can read all of it, including whatever account your application runs as.

The audit looks in the web server log directories for files with the world-readable bit and names up to three.

How to check manually

bash
sudo find /var/log/nginx /var/log/apache2 /var/log/httpd -maxdepth 1 -type f -perm -004 2>/dev/nullsudo ls -la /var/log/nginx/

What each result means
ResultWhenWhat it means
PASSNo world-readable files in the web server log directoriesLogs are not readable by unprivileged accounts.
WARNOne or more log files are world-readableUp to three are named. Access logs carry session tokens and internal URLs, so chmod 640 with group adm.
SKIPNo web server log directory was foundNone of the three standard directories exists. Nothing was evaluated.

The check reads the world-readable bit only. It does not check whether the worker user can write to the logs, which is the other permission question worth asking, so verify ownership by hand while you are there.

How to fix it

bash
sudo chown root:adm /var/log/nginx/*.logsudo chmod 640 /var/log/nginx/*.log# RHEL family has no adm group by defaultsudo chown root:root /var/log/httpd/*.logsudo chmod 640 /var/log/httpd/*.log

The master process opens the log files as root and passes the descriptors to the workers, so the worker user needs no permission on them at all. Then fix the rotation config, or the next rotated file arrives with default permissions and undoes this:

text
create 0640 root adm

Severity: MEDIUMNeeds rootWeb Server Log Rotation

A site producing 50 MB of logs a day fills 18 GB in a year, in one file that takes half a minute to open. On a modest VPS that is a full disk, and a full disk stops the database, the application and the web server at the same moment.

The audit checks three things in order: whether logrotate is installed at all, whether any log file is over 100 MB, and whether a logrotate config exists for the web server.

How to check manually

bash
command -v logrotate || echo "logrotate not installed"ls /etc/logrotate.d/nginx /etc/logrotate.d/apache2 /etc/logrotate.d/httpd 2>/dev/nullsudo find /var/log/nginx /var/log/apache2 /var/log/httpd -maxdepth 1 -type f -size +100M 2>/dev/nullcat /var/lib/logrotate/status 2>/dev/null | head

What each result means
ResultWhenWhat it means
PASSA logrotate config exists for the web server and no log exceeds 100MBRotation is configured and keeping up.
WARNlogrotate is not installed, a log file is over 100MB, or there is no logrotate config for the web serverThree distinct warnings, checked in that order. The oversized files are named when that is the branch that fires.
SKIPNo web server log directory was foundNothing was evaluated.

A file over 100 MB with rotation configured is the most useful of the three, because it means rotation exists and is not keeping pace: either the schedule is too slow for the traffic, or the postrotate step is failing and the server is still writing to the rotated file.

How to fix it

text
# /etc/logrotate.d/nginx/var/log/nginx/*.log {    daily    missingok    rotate 14    compress    delaycompress    notifempty    create 0640 root adm    sharedscripts    postrotate        [ -f /var/run/nginx.pid ] && kill -USR1 "$(cat /var/run/nginx.pid)"    endscript}

Test it without rotating anything:

bash
sudo logrotate -d /etc/logrotate.d/nginx

Severity: MEDIUMNo root neededWeb Application Firewall

A web application firewall inspects the request before your application handles it, and refuses the ones that match known attack shapes: injection strings, traversal sequences, the scanner payloads every public host receives continuously. It is not a substitute for input validation. It catches what the code missed, including the bug in a dependency nobody has patched yet.

The audit looks for ModSecurity in the Apache module list or in either config, for NAXSI in the Nginx config, and for a Cloudflare signature in the response headers. Separately, it detects Fail2Ban and CrowdSec, and reports them as a distinct and weaker case.

How to check manually

bash
apache2ctl -M 2>/dev/null | grep -i securitynginx -V 2>&1 | grep -iE 'modsecurity|naxsi'grep -rniE 'modsecurity[[:space:]]*on|SecRuleEngine[[:space:]]*On' /etc/nginx/ /etc/apache2/ /etc/httpd/ 2>/dev/nullcurl -sI https://yourdomain.com | grep -iE 'cf-ray|server: cloudflare|x-sucuri'

What each result means
ResultWhenWhat it means
PASSModSecurity, NAXSI or a Cloudflare signature was foundRequest filtering is present, and what it found is named. Keep its rules updated.
WARNOnly log-based IP banning is present, or nothing at allTwo distinct warnings. The first names Fail2Ban or CrowdSec and explains that they react after a request is served, which does nothing about a single-shot injection. The second says no filtering was detected at any layer.
SKIPNo web server detected on the hostNothing to evaluate.

The separation between a WAF and log-based banning is the point of this check. Fail2Ban is genuinely useful and has its own check in the VPS logging audit. It watches logs and bans repeat offenders, which stops brute force. It cannot stop the first request, which is all an SQL injection needs.

How to fix it

bash
# ModSecurity with the OWASP Core Rule Set, Debian and Ubuntusudo apt install libapache2-mod-security2 modsecurity-crssudo a2enmod security2sudo systemctl reload apache2

Start in detection mode and read what it would have blocked before you let it block anything:

apache
# /etc/modsecurity/modsecurity.confSecRuleEngine DetectionOnly

Run that way for a full traffic cycle, tune the rules that fire on legitimate requests, then switch to SecRuleEngine On.

What this audit does not cover

This audit reads logging configuration, log file permissions, rotation state and request filtering. It does not check:

  • HTTP response headers. HSTS, CSP, frame protection and cookie flags are the Security Headers audit.
  • TLS and certificates. Protocol versions, ciphers and certificate expiry are the TLS Configuration audit.
  • What the server exposes. Directory listing, dotfiles, backups and status endpoints are the Content Exposure audit.
  • Host-level logging. Fail2Ban state, log rotation health across the system and failed SSH login volume are the VPS Logging and Monitoring audit.
  • What is in the logs. The audit checks that logging works and is protected. It does not read your logs, look for attacks in them, or alert on anything.
  • Log shipping and retention. Whether logs reach a central store, and how long they are kept there, is a question about the receiving end rather than about this host.

The manual audit problem at scale

Five checks by hand is fifteen to twenty minutes per server, and the part that takes the time is not the commands. It is confirming that a log which is configured is also being written to, which means checking the directive, then the file, then the timestamp, then the rotation config that will recreate it tomorrow.

Across ten servers that is most of a morning, and the failure it is designed to catch, a log that exists and is empty, is precisely the one that a config-only check reports as healthy.

TaskBy hand, 8 hostsCtrlOps, 8 hosts
Run all 5 checksAbout 2 hoursAbout 95 seconds
Directive versus realityCheck the config, then the file, then the timestampConfig, permissions and file sizes in one pass
Rotation stateRead the config and the status fileChecked against a 100MB size trigger
Get a scored reportNot availableAutomatic
Re-audit after fixingAnother 2 hoursAnother 95 seconds

How CtrlOps runs all 5 checks in one click

Instead of running these commands on every server by hand, CtrlOps runs the whole Logging and Monitoring audit over the SSH connection you already have open. Nothing is installed on the server: no agent, no daemon, no package, no new credentials. The checks are read-only POSIX shell that executes, streams its results back, and leaves nothing behind.

Watch it run

The recording below walks through the SSH and Access audit rather than this one, but the flow is identical for every audit in the catalog: pick it, watch the checks stream in, read the score, send the failures to the AI Terminal.

Step 1: Open the Audit tab

Connect to your server in CtrlOps and open the Audit tab in the left sidebar.

Step 2: Select Logging & Monitoring

Choose it from the Web Server category. All 5 checks are listed with their descriptions, severity levels and the estimated run time, about 12 seconds in total. Two of them need root, and the UI says so before you run anything.

Step 3: Run it

The audit runs over your existing SSH session. Results stream in as they complete, so you watch each check pass, warn or fail rather than waiting on a final report.

Step 4: Read the report

You get a summary containing:

  • A hardening score out of 100
  • A severity breakdown: how many HIGH, MEDIUM and LOW findings
  • Pass, warning, failed and skipped counts
  • A findings table naming the specific log files, their permissions and their sizes

Step 5: Fix what failed

Select the failed findings and send them to the AI Terminal. Each proposed fix command appears with an explanation of what it changes. Nothing runs until you review and approve it, which matters here because a chown across a log directory while the server holds those files open is a change worth reading before it runs.

Step 6: Re-run and compare

Run the same audit again after applying the fixes and watch the score move. Check 4 is the one to re-run after any rotation change, because the failure mode is silent: the config looks right, rotation runs, and the new log stays empty.

Conclusion

Nothing on this page stops an attack. What it decides is whether, on the morning after one, you can say what happened. An access log that was switched off for one route, a rotated file the server never reopened, a permissions change that let every local account read your URLs: each is invisible right up to the moment it is the only thing you needed.

The fifth check is the exception, and it draws a line worth remembering: Fail2Ban reacts to a request that has already been served, a WAF refuses one before it is handled. The CtrlOps Security Audit runs all 5 in about 12 seconds per server.

The neighbouring checklists cover the other web server layers: security headers, TLS configuration, content exposure, configuration hardening and identification and patching.

Frequently asked questions

  • root:adm with mode 640 on Debian and Ubuntu, or root:root with 640 on RHEL family, which has no adm group by default. The master process opens the files as root and passes the descriptors to the workers, so the worker user needs no permission at all. Set the same values in the logrotate create line, or the next rotation undoes it.
  • Define a format in the http block with log_format, then reference it: access_log /var/log/nginx/site-access.log combined;. The built-in combined format adds referer and user agent over common, which is what lets you separate a scanner from a browser afterwards. For structured logs, define a JSON format with escape=json.
  • Almost always the postrotate step. Rotation renames the file, but the server keeps writing to the descriptor it already holds, so the new file stays empty while the renamed one grows. Nginx needs kill -USR1 on its PID, Apache needs apachectl graceful. The other cause is a rotation that recreated the file with an owner the server cannot write to.
  • Logrotate runs daily from cron or a systemd timer, renames the current file, creates a replacement with the permissions in the create line, then runs the postrotate script that signals Nginx to reopen its files. compress with delaycompress gzips the previous cycle's file, and rotate 14 keeps a fortnight of history.
  • No, and this audit is explicit about the difference. Fail2Ban and CrowdSec read logs and ban addresses that repeat a pattern, which stops brute force after the fact. A WAF inspects the request body and headers before the application handles them, which is what stops a single-shot injection. The audit reports a host with only log-based banning as a warning naming the tool it found.
  • Whichever you will actually operate. ModSecurity with the OWASP Core Rule Set is free, runs on your server and needs tuning: start in DetectionOnly, watch what it would have blocked for a full traffic cycle, then enforce. A CDN WAF needs no server-side work and covers you before traffic arrives. Running both usually means two sets of false positives.
  • Because checks 3 and 4 look in /var/log/nginx, /var/log/apache2 and /var/log/httpd only. If your logs go to a dedicated volume or a per-site path, none of those exists and the audit reports that it found no log directory. That is a skip rather than a pass, because it could not evaluate anything.
  • For a static asset location, sometimes, where the volume is high and the value is low. For anything that touches the application, no. The endpoint somebody disables to save disk is reliably the endpoint worth investigating later. If volume is the problem, use a leaner log format or a separate file with shorter retention rather than turning the record off.
  • On a busy server it produces gigabytes a day, which is a disk-space risk on its own, and it can record request bodies. That means a POST containing a password ends up in a file that is backed up, shipped to your log store and retained. Use warn in production and raise the level only for a specific, time-boxed troubleshooting session.
  • No. It audits whether logging is configured, protected and rotating, which is the layer before shipping. Aggregation, search and alerting belong to Loki, the ELK stack or a hosted service. This audit makes sure the pipeline has something correct to start from, because a centralised store faithfully collects an empty log file too.
  • Monthly on production, and after any change to logging or rotation. The finding worth scheduling for is check 4, because a log crossing 100MB and a rotation that stopped reopening files both happen with nothing on the server changing. The others only move when somebody edits the config.

Explore article with AI tools

Written by

Hiren Kalariya

Co-Founder & CEO, TST Technology

Hiren Kalariya is the Co-Founder and CEO of TST Technology and the product lead behind CtrlOps, a local-first desktop app that makes Linux server management fast and easy for developers and DevOps teams. Over the past five years he has shipped 60+ production systems, and he still tests every tool he writes about on real servers.

Keep auditing

Related reading

Stop juggling tools. Start managing fleets.

PuTTY
Termius
MobaXterm
WinSCP
SecureCRT
Royal TS
Warp
CtrlOps14 tools left
Webmin
aaPanel
RunCloud
Dokploy
IP spreadsheet
bash (2)
sticky notes

One app. All your servers. No context switching. Free to start, free to leave.

Start instantly · No credit card · Cancel anytime

Your privacy preferences. We use product analytics to improve CtrlOps. Google measurement runs without analytics cookies. Live chat stays off until you allow it. Cookie policy