What else a server administrator needs to know

The skill map

A site on a VPS works after lesson 5, and then stops being a project and starts being a machine you look after. The knowledge it asks for is not endless, but it has parts, and each part has a purpose. The table below is the whole map; the sections after it take the parts in the order a beginner meets them.

SkillWhat it lets you do
The command lineFind files, read logs, run anything twice the same way.
Users and permissionsGive a site the least access it needs, and know who can read what.
Services and systemdStart, stop and diagnose the programs that answer requests.
PackagesInstall and update software from a trusted source.
NetworkingUnderstand addresses, ports, name resolution and firewalls.
Web servers and TLSServe the site and its certificate without a panel.
DatabasesKeep the site data consistent, backed up and reachable only from the site.
Backups and monitoringKnow before your visitors that something is wrong, and recover when it is.
LogsFind the first error instead of the loudest one.
Shell scripts and gitRepeat a job without retyping it, and keep configuration under version control.

The command line

Everything on a server is a file or a process, and the shell is how you see both. You need perhaps thirty commands and three habits. The habits matter more: read the manual before the internet, print a path before you delete it, and change one thing at a time.

man 5 nginx.conf

The number in man 5 means the section: 1 is a command, 5 is a file format, 8 is system administration. A man page is faster and more exact than a random blog post, and it was written by the people who made the program. When you do not know the name of a command:

apropos "dns lookup"

dig (1) - DNS lookup utility host (1) - DNS lookup utility getent (1) - get entries from Name Service Switch libraries

Practice with real files, not toys. Find the three largest files in a folder, find a line in a log, count how often an error repeats:

du -h /var/log/* | sort -h | tail -n 3

grep -c " 500 " /var/log/nginx/access.log

Bash is the language of these commands. You do not need to write programs at first; a pipeline of two commands already solves most daily questions.

Users, permissions and sudo

Every process runs as a user, and every file says who may read, write and execute it. The three numbers in chmod are permissions for the owner, the group and everyone else, in that order: 4 is read, 2 is write, 1 is execute.

ModeMeaningTypical use
644Owner reads and writes, others readA picture, a PHP file of the site
600Only the owner reads and writesA key, a file with a password
755Owner writes, everyone reads and entersA folder that a web server reads
750Owner and group read and enterA site folder whose group is the web server

Learn id to see who you are, and ls -l to see who owns what. Never solve a permission problem with chmod 777: it gives write access to every user on the machine, including the one an attacker created. Give the group the access instead, and make the group right. sudo is configured in /etc/sudoers, which you edit only with visudo so that a syntax error cannot lock you out.

Services and systemd

On Ubuntu every long-running program is a systemd service with a unit file, usually in /lib/systemd/system/. Four systemctl commands answer almost every question:

systemctl status nginx

sudo systemctl restart nginx

sudo systemctl enable nginx

journalctl -u nginx --since "1 hour ago" --no-pager

status shows whether the service runs and the last lines it printed. restart stops and starts it; reload asks it to reread its configuration without dropping connections, and is what you want for Nginx and PHP-FPM. enable makes it start at boot; a service can run now and still be forgotten after a reboot without it. When you write your own unit file, copy an existing one and read every line; the two lines people forget are After=network.target and Restart=on-failure.

Packages

Install software from the distribution, not from a random archive. Ubuntu packages are signed, tested together and updated by the security team. The four commands to know:

apt search nginx

apt show nginx

sudo apt install nginx

dpkg -l | grep nginx

apt show prints the version, the size, the dependencies and the maintainer before you install. A program you compile yourself from source will not receive security updates, and in two years nobody will remember how it was built. When a site needs a newer version than the distribution ships, prefer the official repository of the project, and write down where it came from.

Updates are a habit, not an event: see Updates: patch day, not someday, and switch on automatic security updates as lesson 8 shows.

Networking

Four ideas explain almost every network problem: an address, a port, a route and a name. An address says which machine, a port says which service on that machine, a route says how packets get there, and a name is a convenience that is resolved into an address before anything happens.

ip -brief address

lo UNKNOWN 127.0.0.1/8 ::1/128 eth0 UP 203.0.113.10/24 2001:db8::10/64

ip route

default via 203.0.113.1 dev eth0 proto static 203.0.113.0/24 dev eth0 proto kernel scope link src 203.0.113.10

The default route is the way out to the internet. Without it the server can talk to its own subnet and nowhere else, which looks exactly like a broken DNS. Then test the layers in order: the address answers, the port answers, the name resolves, the service answers.

ping -c 2 1.1.1.1

dig +short example.com

curl -I https://example.com

A firewall sits between the port and the network. On Ubuntu it is ufw in front of nftables; a closed port looks like a service that is down when you test it from outside and fine when you test it from the server. That difference is the clue: if localhost works and the internet does not, suspect the firewall or the provider network before the program.

Web servers and TLS

You already wrote a server block in lesson 5. The skill to build is reading one: every request follows listen, server_name, root, location and the handler. When a page returns the wrong thing, read those five in that order. nginx.conf: configuration and sites is the reference for the details.

TLS is a certificate, a private key and a chain of trust. Certbot makes all three for you, and the parts you must understand are the names it covers, the date it expires and the check that renewal still works. To look at what a server really sends:

openssl s_client -connect example.com:443 -servername example.com < /dev/null | openssl x509 -noout -subject -dates

subject=CN = example.com notBefore=Nov 6 09:00:00 2026 GMT notAfter=Feb 4 09:00:00 2027 GMT

The -servername option sends SNI, so you see the certificate of that name and not of the default site. If the two differ, the name is missing from the configuration.

Databases

A webmaster does not need to be a database administrator, but needs four things: create a database and a user, grant only what the site needs, take a consistent dump, and restore it into a test database. MariaDB is the reference for the commands; the habits are these:

mysqldump --single-transaction -u example_user -p example_db > site-$(date +%F).sql

Backups and monitoring

Two questions decide whether you survive a bad day: how old is the newest copy, and did anyone ever restore it? The 3-2-1 rule answers the first: three copies, on two kinds of storage, one of them off the server. The restore test answers the second, and it is the part everybody skips. Backups that actually restore has the method; rsync, restic and borg are the tools.

Monitoring is the same idea for the present: a check that runs every minute from outside, and a few numbers from inside. Uptime, free disk, memory, the age of the newest backup, the days left on the certificate. An alert that reaches your phone is worth more than a beautiful dashboard nobody opens.

df -h /

Filesystem Size Used Avail Use% Mounted on /dev/vda1 39G 12G 25G 33% /

How to learn

The order matters less than the loop: read a little, do it on a machine, break it, fix it, write down what you learned. A server you are afraid to touch teaches nothing, so build one you are allowed to destroy.

A learning order

  1. Files, permissions, grep, find, less: two weeks of daily use.
  2. Users, sudo, SSH keys: one week, and then never log in as root again.
  3. systemd, packages, logs: one week, enough to install and diagnose a service.
  4. Networking: addresses, routes, ports, DNS, the firewall. Two weeks, because this is where most confusion lives.
  5. Nginx and PHP-FPM: one week, with your own site as the exercise.
  6. TLS and certificates: two days, mostly learning to read what the server sends.
  7. Databases: one week of create, grant, dump and restore.
  8. Backups and monitoring: a weekend, with a real restore.
  9. Bash scripts and cron: one week, automating the backup and the update check.
  10. Git for configuration files: a weekend, and then every change has a history.

Ten weeks at half an hour a day is a realistic plan for a motivated beginner. The lessons in this course follow the same order, so the course itself is the first pass through the list.

Certifications

A certificate does not make you an administrator, but a good one gives a study plan with a deadline and a ticket past some hiring filters. Four are worth knowing:

CertificateWhat it coversWorth it when
LPIC-1Linux basics: the shell, files, users, processes, packages, networking, security, in two examsYou want a vendor-neutral first certificate and a clear syllabus
RHCSARed Hat Enterprise Linux administration, tested on a real machineYou work with Red Hat or want a practical exam that cannot be passed by memorising questions
CompTIA Linux+A broad introduction to Linux administrationYou are starting and want one recognised entry certificate
CompTIA Security+Security concepts: threats, cryptography, access control, riskYour job description includes security, not only servers

LPIC-1 and Linux+ are vendor-neutral. LPIC-1 is multiple-choice and fill-in-the-blank questions; Linux+ mixes multiple-choice questions with performance-based tasks. RHCSA is tied to Red Hat and is respected because the whole exam is performed on a real system. Security+ is not a Linux certificate and will not teach you Nginx, but it is the usual first step into security work. None of them replaces a working site and a backup you have restored.

Where to go next

Quiz

1 Which command shows the manual page for the format of a configuration file?

  1. man 1 nginx
  2. man 5 nginx.conf
  3. nginx --help
  4. cat nginx.conf
Answer

b) Section 5 holds file formats, section 1 commands. The manual page of the format lists every directive and its default.

2 A site cannot write to its uploads folder. What is the right fix?

  1. chmod 777 on the folder
  2. Give the site user or the web server group the access the folder needs
  3. Run PHP as root
  4. Delete the folder and upload again
Answer

b) 777 lets every user on the machine write there, including one an attacker created. Grant the minimum access to the right user or group.

3 What is the difference between systemctl restart nginx and systemctl reload nginx?

  1. Nothing, they are the same
  2. Reload rereads the configuration without dropping connections; restart stops and starts the service
  3. Restart only works after a reboot
  4. Reload disables the service
Answer

b) Reload is the gentle option for a configuration change. Restart is for a new binary or a stuck process, and briefly drops connections.

4 The site works on the server itself but not from the internet. Where do you look first?

  1. The database password
  2. The firewall rules and the provider network
  3. The certificate expiry date
  4. The CSS files
Answer

b) Localhost working and the internet failing points at the path, not the program: a closed port, a wrong address or a provider firewall.

5 What makes a backup trustworthy?

  1. It runs every night
  2. It has been restored successfully at least once
  3. It is stored on the same server
  4. It is compressed
Answer

b) An untested backup is a hope. Restore it into a separate place and check that the files open and the database queries work.

6 Which certificate is a hands-on exam on Red Hat Enterprise Linux?

  1. LPIC-1
  2. CompTIA Linux+
  3. RHCSA
  4. Security+
Answer

c) RHCSA is performed on a real system, so it cannot be passed by memorising questions. LPIC-1 is multiple-choice and fill-in-the-blank, Linux+ adds performance-based tasks, and Security+ is about security in general.

Article author: Arthur Isaev