Skip to main content

IP Restrictions

Learning Focus

By the end of this lesson you will know how to restrict access to sensitive paths by IP address in OpenLiteSpeed.

Why IP Restrictions Matter

Restricting access by IP is one of the simplest and most effective ways to protect:

  • WebAdmin console (port 7080)
  • Admin panels (e.g., /wp-admin/)
  • Staging or internal sites
  • API endpoints meant for internal use only

Configuring IP Restrictions

Server Level (WebAdmin Console)

# Use firewall rules to restrict WebAdmin access
sudo ufw allow from YOUR_IP to any port 7080
sudo ufw deny 7080

# Verify
sudo ufw status | grep 7080

Virtual Host Level (WebAdmin)

  1. Navigate to Virtual Hosts → your site → SecurityAccess Control
  2. Set Allowed List: your-ip-address (comma-separated for multiple)
  3. Set Denied List: * (deny all others)
  4. Save and Graceful Restart

Path-Based Restrictions (via Context)

  1. Navigate to Virtual HostsContext → select admin path
  2. Set Access ControlAllowed List: 192.168.1.0/24
  3. Save and Graceful Restart

Common Restriction Patterns

PathWho Should AccessMethod
WebAdmin :7080You onlyFirewall + IP binding
/wp-admin/Your office IPsContext access control
Staging siteInternal teamVhost access control
API endpointsKnown serversContext + firewall
warning

Always test restrictions from an unallowed IP before relying on them. A misconfigured allowlist that includes * provides no protection.

Key Takeaways

  • IP restrictions are a simple but effective first layer of access control.
  • Use firewall rules (UFW/iptables) for port-level restrictions.
  • Use WebAdmin access control for path-level restrictions.
  • Always test from outside your allowed range.

What's Next