ServerHandbook live check: run log ------------------------------------------------------------------------------ Article https://serverhandbook.com/kb/port-already-in-use-ubuntu Check scripts/live/checks/port-already-in-use-ubuntu.mjs (sha256 1bac9c8aa8bc7c6b326d4f56374c9bcc56e2fab53c0131062b37758ae26ba113) Ran at 2026-11-19T09:36:33Z (232 s) Result PASS, all 22 claims held Tested on System Ubuntu 24.04.4 LTS Kernel 6.8.0-138-generic Package nginx 1.24.0-2ubuntu7.19 Package apache2 2.4.58-1ubuntu8.19 Package iproute2 6.1.0-1ubuntu6.4 Package lsof 4.95.0-1build3 Package psmisc 23.7-1build1 Setup A fresh Ubuntu 24.04 server (a rented cloud server, rebuilt to the provider’s stock image) with Apache already installed and running on port 80, reached over SSH as the sudo user deploy. Nginx is then installed on the same server. Every version above was read from the server at run time. Passwords used on the throwaway test server are shown as [password]. How we test: https://serverhandbook.com/how-we-test ------------------------------------------------------------------------------ What the steps changed on the server (recorded before the first step and after the last) Packages added (2) nginx 1.24.0-2ubuntu7.19 nginx-common 1.24.0-2ubuntu7.19 Packages upgraded (0) Packages removed (0) Services enabled at boot (1) nginx.service Services disabled (1) apache2.service Listening sockets opened (2) tcp 0.0.0.0:80 nginx tcp [::]:80 nginx Listening sockets closed (1) tcp *:80 apache2 Files added in /etc (30) /etc/default/nginx /etc/init.d/nginx /etc/logrotate.d/nginx /etc/nginx/fastcgi.conf /etc/nginx/fastcgi_params /etc/nginx/koi-utf /etc/nginx/koi-win /etc/nginx/mime.types /etc/nginx/nginx.conf /etc/nginx/proxy_params /etc/nginx/scgi_params /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default /etc/nginx/snippets/fastcgi-php.conf /etc/nginx/snippets/snakeoil.conf /etc/nginx/uwsgi_params /etc/nginx/win-utf /etc/rc0.d/K01nginx /etc/rc1.d/K01nginx /etc/rc2.d/K01apache2 /etc/rc2.d/S01nginx /etc/rc3.d/K01apache2 /etc/rc3.d/S01nginx /etc/rc4.d/K01apache2 /etc/rc4.d/S01nginx /etc/rc5.d/K01apache2 /etc/rc5.d/S01nginx /etc/rc6.d/K01nginx /etc/systemd/system/multi-user.target.wants/nginx.service /etc/ufw/applications.d/nginx Files changed in /etc (0) Files removed from /etc (5) /etc/rc2.d/S01apache2 /etc/rc3.d/S01apache2 /etc/rc4.d/S01apache2 /etc/rc5.d/S01apache2 /etc/systemd/system/multi-user.target.wants/apache2.service Disk used on / (includes logs written during the run): +2.3 MB ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Check-your-server script (2 items): https://cdn.serverhandbook.com/check/port-already-in-use-ubuntu/ubuntu-24.04.4-20261119t093633z.sh SHA-256 6dfc1b404a66a782f31047e62991af0e608ed58f093ba985d10f8c9b135ed2aa ------------------------------------------------------------------------------ On the stock server, before the first step: FAIL nginx is running FAIL Apache is not set to start at boot (it would take port 80 again) After the last step: PASS nginx is running PASS Apache is not set to start at boot (it would take port 80 again) ------------------------------------------------------------------------------ Claims (22), each with what the run saw ------------------------------------------------------------------------------ 1. ok a bare Ubuntu 24.04 server box (web-server) starts 2. ok (setup) Apache is installed and running | active 3. ok the install prints "Not attempting to start NGINX, port 80 is already in use." in the middle, then carries on | Reading package lists... Done | Building dependency tree... Done | Reading state information... Done | The following additional packages will be installed: | nginx-common | Suggested packages: | fcgiwrap nginx-doc | The following NEW packages will be installed: | nginx nginx-common | 0 upgraded, 2 newly installed, 0 to remove and 144 not upgraded. | Need to get 570 kB of archives. | After this operation, 1,602 kB of additional disk space will be used. | Get:1 https://mirror.hetzner.com/ubuntu/packages noble-updates/main amd64 nginx-common all 1.24.0-2ubuntu7.19 [45.3 kB] | Get:2 https://mirror.hetzner.com/ubuntu/packages noble-updates/main amd64 nginx amd64 1.24.0-2ubuntu7.19 [525 kB] | Fetched 570 kB in 0s (1,378 kB/s) | Preconfiguring packages ... | Selecting previously unselected package nginx-common. | (Reading database ... 39454 files and directories currently installed.) | Preparing to unpack .../nginx-common_1.24.0-2ubuntu7.19_all.deb ... | Unpacking nginx-common (1.24.0-2ubuntu7.19) ... | Selecting previously unselected package nginx. | Preparing to unpack .../nginx_1.24.0-2ubuntu7.19_amd64.deb ... | Unpacking nginx (1.24.0-2ubuntu7.19) ... | Setting up nginx-common (1.24.0-2ubuntu7.19) ... | Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service. | Could not execute systemctl: at /usr/bin/deb-systemd-invoke line 148. | Setting up nginx (1.24.0-2ubuntu7.19) ... | Not attempting to start NGINX, port 80 is already in use. | Processing triggers for man-db (2.12.0-4build2) ... | Processing triggers for ufw (0.36.2-6) ... | Scanning processes... | Scanning linux images... | | Running kernel seems to be up-to-date. | | No services need to be restarted. | | No containers need to be restarted. | | No user sessions are running outdated binaries. | | No VM guests are running outdated hypervisor (qemu) binaries on this host. 4. ok apt itself still exits 0: nothing at the end says it failed | 0 5. ok systemctl is-active nginx: failed | failed 6. ok the journal: bind() to 0.0.0.0:80 failed (98: Address already in use) | Nov 19 09:38:00 web-server nginx[3337]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) | Nov 19 09:38:00 web-server nginx[3337]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) 7. ok ss without sudo: the port is LISTEN but no process is named | State Recv-Q Send-Q Local Address:Port Peer Address:Port Process | LISTEN 0 511 *:80 *:* 8. ok sudo ss: users:(("apache2",pid=…)) on port 80 | State Recv-Q Send-Q Local Address:Port Peer Address:Port Process | LISTEN 0 511 *:80 *:* users:(("apache2",pid=2422,fd=4),("apache2",pid=2421,fd=4),("apache2",pid=2418,fd=4)) 9. ok lsof names apache2 listening on *:80 | COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | apache2 2418 root 4u IPv6 13653 0t0 TCP *:80 (LISTEN) | apache2 2421 www-data 4u IPv6 13653 0t0 TCP *:80 (LISTEN) | apache2 2422 www-data 4u IPv6 13653 0t0 TCP *:80 (LISTEN) 10. ok fuser -v lists apache2 on 80/tcp | USER PID ACCESS COMMAND | 80/tcp: root 2418 F.... apache2 | www-data 2421 F.... apache2 | www-data 2422 F.... apache2 11. ok the process belongs to the apache2 service: active (running) | ● apache2.service - The Apache HTTP Server | Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; preset: enabled) | Active: active (running) since Thu 2026-11-19 09:37:15 UTC; 1min 25s ago 12. ok disable --now stops Apache and removes it from boot | Synchronizing state of apache2.service with SysV service script with /usr/lib/systemd/systemd-sysv-install. | Executing: /usr/lib/systemd/systemd-sysv-install disable apache2 | Removed "/etc/systemd/system/multi-user.target.wants/apache2.service". 13. ok port 80 is free: ss prints only its header | State Recv-Q Send-Q Local Address:Port Peer Address:Port Process 14. ok nginx is active | active 15. ok sudo ss: nginx now holds port 80 (IPv4 and IPv6) | State Recv-Q Send-Q Local Address:Port Peer Address:Port Process | LISTEN 0 511 0.0.0.0:80 0.0.0.0:* users:(("nginx",pid=4160,fd=5),("nginx",pid=4159,fd=5),("nginx",pid=4158,fd=5)) | LISTEN 0 511 [::]:80 [::]:* users:(("nginx",pid=4160,fd=6),("nginx",pid=4159,fd=6),("nginx",pid=4158,fd=6)) 16. ok curl: Server: nginx | Server: nginx/1.24.0 (Ubuntu) 17. ok port 22 lists "systemd" pid=1 as well as sshd: socket activation (ssh.socket) | State Recv-Q Send-Q Local Address:Port Peer Address:Port Process | LISTEN 0 4096 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=1039,fd=3),("systemd",pid=1,fd=131)) | LISTEN 0 4096 [::]:22 [::]:* users:(("sshd",pid=1039,fd=4),("systemd",pid=1,fd=132)) 18. ok systemctl list-sockets: ssh.socket listens on port 22 | 0.0.0.0:22 ssh.socket ssh.service | [::]:22 ssh.socket ssh.service 19. ok (nginx is running at the end of the steps) | active 20. ok (Apache is not set to start at boot at the end of the steps) | disabled 21. ok (tested on) the box reports its OS, kernel and the version of 5 package(s) | PRETTY_NAME="Ubuntu 24.04.4 LTS" | VIRT=none | KERNEL=6.8.0-138-generic | PKG apache2 2.4.58-1ubuntu8.19 | PKG iproute2 6.1.0-1ubuntu6.4 | PKG lsof 4.95.0-1build3 | PKG nginx 1.24.0-2ubuntu7.19 | PKG psmisc 23.7-1build1 22. ok undo: Apache holds port 80 again | Synchronizing state of apache2.service with SysV service script with /usr/lib/systemd/systemd-sysv-install. | Executing: /usr/lib/systemd/systemd-sysv-install enable apache2 | Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /usr/lib/systemd/system/apache2.service. | State Recv-Q Send-Q Local Address:Port Peer Address:Port Process | LISTEN 0 511 *:80 *:* users:(("apache2",pid=5220,fd=4),("apache2",pid=5219,fd=4),("apache2",pid=5217,fd=4)) ------------------------------------------------------------------------------ Commands and what they printed (17) ------------------------------------------------------------------------------ $ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nginx Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: nginx-common Suggested packages: fcgiwrap nginx-doc The following NEW packages will be installed: nginx nginx-common 0 upgraded, 2 newly installed, 0 to remove and 144 not upgraded. Need to get 570 kB of archives. After this operation, 1,602 kB of additional disk space will be used. Get:1 https://mirror.hetzner.com/ubuntu/packages noble-updates/main amd64 nginx-common all 1.24.0-2ubuntu7.19 [45.3 kB] Get:2 https://mirror.hetzner.com/ubuntu/packages noble-updates/main amd64 nginx amd64 1.24.0-2ubuntu7.19 [525 kB] Fetched 570 kB in 0s (1,378 kB/s) Preconfiguring packages ... Selecting previously unselected package nginx-common. (Reading database ... 39454 files and directories currently installed.) Preparing to unpack .../nginx-common_1.24.0-2ubuntu7.19_all.deb ... Unpacking nginx-common (1.24.0-2ubuntu7.19) ... Selecting previously unselected package nginx. Preparing to unpack .../nginx_1.24.0-2ubuntu7.19_amd64.deb ... Unpacking nginx (1.24.0-2ubuntu7.19) ... Setting up nginx-common (1.24.0-2ubuntu7.19) ... Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service. Could not execute systemctl: at /usr/bin/deb-systemd-invoke line 148. Setting up nginx (1.24.0-2ubuntu7.19) ... Not attempting to start NGINX, port 80 is already in use. Processing triggers for man-db (2.12.0-4build2) ... Processing triggers for ufw (0.36.2-6) ... Scanning processes... Scanning linux images... Running kernel seems to be up-to-date. No services need to be restarted. No containers need to be restarted. No user sessions are running outdated binaries. No VM guests are running outdated hypervisor (qemu) binaries on this host. $ systemctl is-active nginx failed $ sudo journalctl -u nginx --no-pager -n 20 | grep -m 2 "Address already in use" Nov 19 09:38:00 web-server nginx[3337]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Nov 19 09:38:00 web-server nginx[3337]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) $ ss -tlnp 'sport = :80' State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 511 *:80 *:* $ sudo ss -tlnp 'sport = :80' State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 511 *:80 *:* users:(("apache2",pid=2422,fd=4),("apache2",pid=2421,fd=4),("apache2",pid=2418,fd=4)) $ sudo lsof -nP -iTCP:80 -sTCP:LISTEN COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME apache2 2418 root 4u IPv6 13653 0t0 TCP *:80 (LISTEN) apache2 2421 www-data 4u IPv6 13653 0t0 TCP *:80 (LISTEN) apache2 2422 www-data 4u IPv6 13653 0t0 TCP *:80 (LISTEN) $ sudo fuser -v 80/tcp USER PID ACCESS COMMAND 80/tcp: root 2418 F.... apache2 www-data 2421 F.... apache2 www-data 2422 F.... apache2 $ systemctl status apache2 --no-pager | head -n 3 ● apache2.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; preset: enabled) Active: active (running) since Thu 2026-11-19 09:37:15 UTC; 1min 25s ago $ sudo systemctl disable --now apache2 Synchronizing state of apache2.service with SysV service script with /usr/lib/systemd/systemd-sysv-install. Executing: /usr/lib/systemd/systemd-sysv-install disable apache2 Removed "/etc/systemd/system/multi-user.target.wants/apache2.service". $ sudo ss -tlnp 'sport = :80' State Recv-Q Send-Q Local Address:Port Peer Address:Port Process $ sudo systemctl start nginx $ systemctl is-active nginx active $ sudo ss -tlnp 'sport = :80' State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 511 0.0.0.0:80 0.0.0.0:* users:(("nginx",pid=4160,fd=5),("nginx",pid=4159,fd=5),("nginx",pid=4158,fd=5)) LISTEN 0 511 [::]:80 [::]:* users:(("nginx",pid=4160,fd=6),("nginx",pid=4159,fd=6),("nginx",pid=4158,fd=6)) $ curl -sI http://localhost | grep -i "^server" Server: nginx/1.24.0 (Ubuntu) $ sudo ss -tlnp 'sport = :22' State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 4096 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=1039,fd=3),("systemd",pid=1,fd=131)) LISTEN 0 4096 [::]:22 [::]:* users:(("sshd",pid=1039,fd=4),("systemd",pid=1,fd=132)) $ systemctl list-sockets --no-pager | grep ssh 0.0.0.0:22 ssh.socket ssh.service [::]:22 ssh.socket ssh.service $ sudo systemctl stop nginx && sudo systemctl enable --now apache2 Synchronizing state of apache2.service with SysV service script with /usr/lib/systemd/systemd-sysv-install. Executing: /usr/lib/systemd/systemd-sysv-install enable apache2 Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /usr/lib/systemd/system/apache2.service. ------------------------------------------------------------------------------ The check-your-server script, its full screen before the steps ------------------------------------------------------------------------------ ServerHandbook check, port-already-in-use-ubuntu (proved 2026-11-19) FAIL nginx is running fix: https://serverhandbook.com/kb/port-already-in-use-ubuntu#free-the-port FAIL Apache is not set to start at boot (it would take port 80 again) fix: https://serverhandbook.com/kb/port-already-in-use-ubuntu#free-the-port 0 passed, 2 failed To fix a FAIL, follow the steps in https://serverhandbook.com/kb/port-already-in-use-ubuntu ------------------------------------------------------------------------------ The check-your-server script, its full screen after the steps ------------------------------------------------------------------------------ ServerHandbook check, port-already-in-use-ubuntu (proved 2026-11-19) PASS nginx is running PASS Apache is not set to start at boot (it would take port 80 again) 2 passed, 0 failed ------------------------------------------------------------------------------ The check's source (scripts/live/checks/port-already-in-use-ubuntu.mjs) As it ran. ------------------------------------------------------------------------------ /** * KB fix: "Address already in use" / which process is using a port. The real case: Apache already holds port 80 and * Nginx is installed on the same server, so Nginx cannot start ("bind() to 0.0.0.0:80 failed (98: Address already in * use)"). Steps: see the error; find the owner with ss (and why it needs sudo), lsof and fuser; stop the owner the * right way (its systemd service, not kill); prove Nginx now holds the port; the systemd socket case (port 22 owned by * "systemd", ssh.socket). * * Runs on a fresh server; Apache is installed first (hidden) as the stock state the reader starts from. */ import { bareBox, reportBox } from '../lib.mjs' export const meta = { reader: [ { item: 'nginx is running', cmd: 'systemctl is-active nginx', expect: '^active$', step: 'free-the-port' }, { item: 'Apache is not set to start at boot (it would take port 80 again)', cmd: 'systemctl is-enabled apache2 2>&1', expect: '^(disabled|masked)$|not-found|No such file', step: 'free-the-port', }, ], } const RELEASE = process.env.LIVE_BOX_RELEASE || '24.04' const FORCE_V4 = `echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4 >/dev/null` const check = (ctx) => bareBox(ctx, async ({ sudoUser }) => { const { run, L } = sudoUser() // ── hidden: another web server already on port 80 ── L(`${FORCE_V4} && sudo apt-get update -qq && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apache2 >/dev/null`, 1800000) const a = L('systemctl is-active apache2') ctx.check('(setup) Apache is installed and running', /^active$/m.test(a), a) // ── 1. the error ──────────────────────────────────────────────────────────────────────── const inst = run('sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nginx', { id: 'install', timeout: 900000 }) // The two releases' nginx packages say it differently (2026-11-19): 26.04 tries to start and reports the failure, // 24.04 checks the port first and does not try. Both lines sit in the middle of the output; apt carries on. const MSG = RELEASE === '24.04' ? 'Not attempting to start NGINX, port 80 is already in use.' : 'Failed to start NGINX in postinst script' ctx.check(`the install prints "${MSG}" in the middle, then carries on`, inst.out.includes(MSG) && /No VM guests are running outdated hypervisor|Processing triggers/.test(inst.out.split(MSG)[1] ?? ''), inst.out) ctx.check('apt itself still exits 0: nothing at the end says it failed', inst.exit === 0, String(inst.exit)) const act = run('systemctl is-active nginx', { id: 'is-active' }) ctx.check('systemctl is-active nginx: failed', /^failed$/m.test(act.out), act.out) const j = run('sudo journalctl -u nginx --no-pager -n 20 | grep -m 2 "Address already in use"', { id: 'journal' }) ctx.check('the journal: bind() to 0.0.0.0:80 failed (98: Address already in use)', /bind\(\) to 0\.0\.0\.0:80 failed \(98: Address already in use\)/.test(j.out), j.out) // ── 2. who holds the port ─────────────────────────────────────────────────────────────── const ss1 = run("ss -tlnp 'sport = :80'", { id: 'ss-nosudo' }) ctx.check('ss without sudo: the port is LISTEN but no process is named', /LISTEN/.test(ss1.out) && !/users:/.test(ss1.out), ss1.out) const ss2 = run("sudo ss -tlnp 'sport = :80'", { id: 'ss-sudo' }) ctx.check('sudo ss: users:(("apache2",pid=…)) on port 80', /users:\(\("apache2",pid=\d+/.test(ss2.out), ss2.out) const lsof = run('sudo lsof -nP -iTCP:80 -sTCP:LISTEN', { id: 'lsof' }) ctx.check('lsof names apache2 listening on *:80', /^apache2\s+\d+\s+root\s/m.test(lsof.out) && /\*:80 \(LISTEN\)/.test(lsof.out), lsof.out) const fu = run('sudo fuser -v 80/tcp', { id: 'fuser' }) ctx.check('fuser -v lists apache2 on 80/tcp', /80\/tcp/.test(fu.out) && /apache2/.test(fu.out), fu.out) const sv = run('systemctl status apache2 --no-pager | head -n 3', { id: 'which-service' }) ctx.check('the process belongs to the apache2 service: active (running)', /apache2\.service/.test(sv.out) && /active \(running\)/.test(sv.out), sv.out) // ── 3. free the port the right way, then start Nginx ──────────────────────────────────── const dis = run('sudo systemctl disable --now apache2', { id: 'disable-apache' }) ctx.check('disable --now stops Apache and removes it from boot', /Removed/.test(dis.out) || dis.exit === 0, dis.out) const ss3 = run("sudo ss -tlnp 'sport = :80'", { id: 'ss-free' }) ctx.check('port 80 is free: ss prints only its header', !/LISTEN/.test(ss3.out), ss3.out) run('sudo systemctl start nginx', { id: 'start-nginx' }) const act2 = run('systemctl is-active nginx', { id: 'is-active-after' }) ctx.check('nginx is active', /^active$/m.test(act2.out), act2.out) const ss4 = run("sudo ss -tlnp 'sport = :80'", { id: 'ss-nginx' }) ctx.check('sudo ss: nginx now holds port 80 (IPv4 and IPv6)', /users:\(\("nginx",pid=\d+/.test(ss4.out) && /0\.0\.0\.0:80/.test(ss4.out) && /\[::\]:80/.test(ss4.out), ss4.out) const cu = run('curl -sI http://localhost | grep -i "^server"', { id: 'curl' }) ctx.check('curl: Server: nginx', /^Server: nginx/im.test(cu.out), cu.out) // ── 4. the systemd socket case ────────────────────────────────────────────────────────── const s22 = run("sudo ss -tlnp 'sport = :22'", { id: 'ss-22' }) ctx.check('port 22 lists "systemd" pid=1 as well as sshd: socket activation (ssh.socket)', /"systemd",pid=1,/.test(s22.out), s22.out) const sock = run('systemctl list-sockets --no-pager | grep ssh', { id: 'list-sockets' }) ctx.check('systemctl list-sockets: ssh.socket listens on port 22', /ssh\.socket/.test(sock.out) && /:22\b/.test(sock.out), sock.out) // ── end state ─────────────────────────────────────────────────────────────────────────── const e1 = L('systemctl is-active nginx') ctx.check('(nginx is running at the end of the steps)', /^active$/.test(e1.trim()), e1, { reader: { cmd: 'systemctl is-active nginx', expect: '^active$' }, }) const e2 = L('systemctl is-enabled apache2 2>&1') ctx.check('(Apache is not set to start at boot at the end of the steps)', /^(disabled|masked)$|not-found|No such file/m.test(e2), e2, { reader: { cmd: 'systemctl is-enabled apache2 2>&1', expect: '^(disabled|masked)$|not-found|No such file' }, }) ctx.stepsDone() reportBox( ctx, L, `A fresh Ubuntu ${RELEASE} server (${process.env.LIVE_VPS ? 'a rented cloud server, rebuilt to the provider’s stock image' : 'a VM from Ubuntu’s cloud image'}) with Apache already installed and running on port 80, reached over SSH as the sudo user deploy. Nginx is then installed on the same server.`, ['nginx', 'apache2', 'iproute2', 'lsof', 'psmisc'], ) // ── undo ──────────────────────────────────────────────────────────────────────────────── const un = run('sudo systemctl stop nginx && sudo systemctl enable --now apache2', { id: 'undo' }) const back = L("sudo ss -tlnp 'sport = :80'") ctx.check('undo: Apache holds port 80 again', /"apache2"/.test(back), `${un.out}\n${back}`) }) export default check