GetSRV / Field notes

Unix systems notes

A compact reference for the checks that make a Linux web server easier to understand: service state, recent logs, resource use, listening sockets and file permissions.

LinuxsystemdLogsNetworkingPermissions

01 / SERVICES

Start with the service state

A failed HTTP request may come from a stopped service, a listening-port mismatch or a problem farther upstream. Begin with the service manager, then read the logs around the failure time.

systemctl --failed
systemctl status nginx --no-pager
journalctl -u nginx --since "1 hour ago" --no-pager

A service marked active is running, but that does not prove it can answer the expected request. Follow the service check with a request to the intended hostname and URL.

On systems with restricted log access, use an account with journal-reading privileges. Note timestamps and the exact error before restarting a service; a restart can erase useful clues about a transient problem.

02 / RESOURCES

Check disk space, inodes and memory separately

A filesystem can run out of free bytes or run out of inodes. Both can prevent a process from creating files. Look at the filesystem that holds the application data and logs.

df -h
df -i
free -h
uptime

In the memory report, available memory is often more useful than the free column because Linux uses otherwise idle memory for caches. Load average counts runnable tasks and tasks in uninterruptible sleep; it is not a CPU percentage.

Compare these readings with the machine’s normal behavior and CPU count. A single snapshot is a clue, not a diagnosis. Avoid deleting unfamiliar logs or application files just to make a warning disappear.

03 / CONNECTIONS

Confirm the socket before testing the route

Find out whether the service is listening, on which port, and on which address. A loopback listener is reachable locally; it is not a public listener.

ss -lnt
ip -brief address
ip route show

curl --silent --show-error --max-time 10 \
  --dump-header - --output /dev/null https://example.com/

If a local request succeeds while a remote request fails, compare the destination address, address family, firewall policy and route. If neither works, inspect the service and local configuration first.

Use the real hostname when checking a named HTTPS service. A request to a bare IP may select a different virtual host and will usually not match a hostname certificate.

04 / FILES

Read permissions in the context of the service user

Unix permissions are grouped by owner, group and other users. Read, write and execute correspond to the values 4, 2 and 1. For a directory, execute means permission to traverse it.

ls -ld /var/www /var/www/example.com
ls -l /var/www/example.com/index.html
namei -l /var/www/example.com/index.html

The web server needs to traverse every parent directory and read the files it serves. A readable file can still be inaccessible when a parent directory blocks traversal.

The helper below decodes the three ordinary permission digits. ACLs, special mode bits, ownership and mandatory access controls can add further rules. Do not broaden permissions to 777 as a general fix.

Browser tool

Permission decoder

Local calculation

Read a standard three-digit Unix file mode.

Owner: rw- · Group: r-- · Other: r--

r = read, w = write, x = execute or directory traversal. This tool decodes a number; it does not modify any files.