Web Server and Networking

30/05/25

Web Server

Now that I have networking and the basics setup, one of my first missions with my homelab is to set up a web server so that I can host this website locally. I mainly have experience with using Apache but I wanted to try using Nginx which is the other mainstream web server. I think Nginx also has some load balancing capabilities that would be fun to be experiment with later.

After installing Nginx with sudo apt install nginx, I could access the default page on my local network at http://192.168.1.5 which was really cool to see:

Nginx home page

By default Nginx listens for incoming requests on all network interfaces via port 80, hence why that worked. I also learnt that all IPv4 IPs on a machine are represented by 0.0.0.0 in networking contexts.

Ports

Next I wanted to check what ports were open. The command I used was sudo ss -tuln. In the command, the t flag makes it specify TCP ports, u does UDP ports, l shows which ports are being listened on, and n shows numeric IP addresses.

This was the output:

jiggy@debian-box:/etc/network$ sudo ss -tuln Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* tcp LISTEN 0 511 0.0.0.0:80 0.0.0.0:* tcp LISTEN 0 128 [::]:22 [::]:* tcp LISTEN 0 511 [::]:22 [::]:*

22 is the SSH port and 80 the is HTTP port where I can access the Nginx default page. 0.0.0.0 and [::] means I'm listening on all network interfaces, which confirms the default Nginx behaviour. But that is good because as of now only the ports that need to be opened are open and I have reliable access to my web server internally as well as SSH.