Skip to main content

Port Binding

Learning Focus

By the end of this lesson you will understand how port binding works in OpenLiteSpeed, which ports to use for different protocols, and how to troubleshoot port conflicts.

What Port Binding Does

Port binding determines which TCP ports OpenLiteSpeed listens on. The listener grabs a port, and all incoming traffic on that port flows through the listener to the appropriate virtual host.

Standard Port Assignments

PortProtocolUse
80HTTPUnencrypted web traffic
443HTTPSTLS-encrypted web traffic
7080HTTPSWebAdmin administration console
8088HTTPDefault OpenLiteSpeed example site

Configuring Port Binding

In WebAdmin

  1. Navigate to Listeners in the left menu.
  2. Click Add or edit an existing listener.
  3. Set the Port field to the desired value (e.g., 80).
  4. Set the Address to * for all interfaces or a specific IP.
  5. Save and perform a Graceful Restart.

What the Config Looks Like

In httpd_config.conf, a listener binding looks like:

listener Default {
address *:8088
secure 0
}

listener HTTPS {
address *:443
secure 1
...
}

Troubleshooting Port Conflicts

If OpenLiteSpeed fails to start with a port-related error:

# Check what is already using a port
sudo netstat -tlnp | grep :80
sudo ss -tlnp | grep :80

# Common conflicts
# - Apache (apache2/httpd) on port 80/443
# - Nginx on port 80/443
# - Another web server instance

# Stop the conflicting service
sudo systemctl stop apache2
sudo systemctl stop nginx

# Then restart OpenLiteSpeed
sudo systemctl restart lsws
warning

If another service is occupying ports 80 or 443, OpenLiteSpeed cannot start its listeners on those ports. Always check for conflicts before troubleshooting further.

Best Practices

  • Keep public listeners on standard ports (80, 443) for user convenience.
  • Avoid exposing unnecessary ports to the public internet.
  • Use firewall rules to restrict access to admin ports like 7080.
  • Remove or disable the default 8088 listener before going to production.

Key Takeaways

  • Port binding is how OpenLiteSpeed decides which ports accept traffic.
  • Use 80 for HTTP, 443 for HTTPS, and restrict 7080 for admin.
  • Check for port conflicts with netstat or ss if the listener fails to start.

What's Next

  • Continue to IP Binding for controlling which network interfaces accept traffic.