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
| Port | Protocol | Use |
|---|---|---|
| 80 | HTTP | Unencrypted web traffic |
| 443 | HTTPS | TLS-encrypted web traffic |
| 7080 | HTTPS | WebAdmin administration console |
| 8088 | HTTP | Default OpenLiteSpeed example site |
Configuring Port Binding
In WebAdmin
- Navigate to Listeners in the left menu.
- Click Add or edit an existing listener.
- Set the Port field to the desired value (e.g.,
80). - Set the Address to
*for all interfaces or a specific IP. - 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
8088listener before going to production.
Key Takeaways
- Port binding is how OpenLiteSpeed decides which ports accept traffic.
- Use
80for HTTP,443for HTTPS, and restrict7080for admin. - Check for port conflicts with
netstatorssif the listener fails to start.
What's Next
- Continue to IP Binding for controlling which network interfaces accept traffic.