Caddy: Difference between revisions

mNo edit summary
Andrew (talk | contribs)
Check used ports: Replace deprecated netstat with ss
Line 168: Line 168:
To check if Caddy is running and listening as configured you can run <code>netstat</code>:
To check if Caddy is running and listening as configured you can run <code>netstat</code>:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="console">
$ netstat -tulpn
$ sudo ss --listening --no-queues --numeric --processes --tcp --udp | grep 'Process\|caddy'
Active Internet connections (only servers)
Netid State      Local Address:Port  Peer Address:Port Process
Proto Recv-Q Send-Q Local Address           Foreign Address         State      PID/Program name   
tcp   LISTEN          127.0.0.1:2019       0.0.0.0:*   users:(("caddy",pid=1000,fd=10))
tcp       0      0 127.0.0.1:2019         0.0.0.0:*               LISTEN      1202/caddy          
tcp  LISTEN                  *:80               *:*    users:(("caddy",pid=1000,fd=11))
tcp6      0      0 :::80                   :::*                    LISTEN      1202/caddy        
tcp  LISTEN                  *:443             *:*    users:(("caddy",pid=1000,fd=12))
tcp6      0      0 :::443                 :::*                    LISTEN      1202/caddy        
udp  UNCONN                  *:443             *:*    users:(("caddy",pid=1000,fd=13))
udp6      0      0 :::443                 :::*                                1202/caddy          
</syntaxhighlight>
</syntaxhighlight>
The tcp (ipv4) socket port 2019 is Caddy's management endpoint, for when you want manage its config via web REST calls instead of Nix (ignore).
The tcp (ipv4) socket port 2019 is Caddy's management endpoint, for when you want manage its config via web REST calls instead of Nix (ignore).