LiteSpeed

OpenLiteSpeed WebAdmin: listeners, virtual hosts and rewrite rules

Find your way around the OpenLiteSpeed WebAdmin console on port 7080: create a virtual host, map it to HTTP and HTTPS listeners, add SSL, set the PHP handler and enable rewrites.

IntermediateOpenLiteSpeed VPS3 min read

OpenLiteSpeed is configured mainly through its WebAdmin console, a web GUI on port 7080. Its model is different from Apache or Nginx: listeners own the ports, virtual hosts hold the site settings, and mappings join the two by domain. This guide walks through adding a site end to end.

Before you start

Log in to WebAdmin

  1. Set or reset the admin password:
    sudo /usr/local/lsws/admin/misc/admpass.sh
  2. Open https://SERVER_IP:7080 and accept the self-signed certificate warning.

How the pieces fit

ObjectHolds
Server ConfigurationGlobal tuning, PHP external apps, modules, security
ListenersIP and port (e.g. *:80, *:443), SSL for that port
Virtual HostsDocument root, index files, logs, rewrite, per-site SSL, contexts
Virtual Host MappingsWhich domains on a listener go to which vhost

Create the document root

sudo mkdir -p /var/www/example.com/{html,logs}
sudo chown -R nobody:nogroup /var/www/example.com

On AlmaLinux the group is nobody. Use a dedicated user with suEXEC if you host several owners.

Add the virtual host

  1. Go to Virtual Hosts → Add.
  2. Name: example.com; Virtual Host Root: /var/www/example.com/; Config File: $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf. Click the create link when it says the file does not exist.
  3. Set Enable Scripts/ExtApps and Restrained to Yes. Save.
  4. Open the vhost → General: Document Root $VH_ROOT/html/, Domain Name example.com, Domain Aliases www.example.com; Index Files index.php, index.html.
  5. Log tab: point error and access logs to $VH_ROOT/logs/.

Enable rewrites and .htaccess

In the vhost → Rewrite: Enable Rewrite = Yes, Auto Load from .htaccess = Yes. OpenLiteSpeed reads only the rewrite rules from .htaccess, and only at startup, so do a graceful restart after editing it.

Map the vhost to listeners

  1. Listeners → Default (port 80) → Virtual Host Mappings → Add: Virtual Host example.com, Domains example.com, www.example.com.
  2. Create a listener for HTTPS if none exists: Listeners → Add, Name SSL, IP ANY, Port 443, Secure = Yes. Add the same mapping.

Add an SSL certificate

  1. Issue a certificate with the webroot method:
    sudo certbot certonly --webroot -w /var/www/example.com/html -d example.com -d www.example.com
  2. In the vhost → SSL: Private Key File /etc/letsencrypt/live/example.com/privkey.pem, Certificate File /etc/letsencrypt/live/example.com/fullchain.pem, Chained Certificate Yes.
  3. The 443 listener also needs a default certificate in its own SSL tab; per-vhost certificates are selected by SNI.
  4. Add a Certbot deploy hook that runs /usr/local/lsws/bin/lswsctrl restart so renewals load.

Choose the PHP version

PHP runs as an LSAPI external app (lsphp). Under Server Configuration → External App each installed lsphp version appears; a matching Script Handler maps .php to it. To use a different version for one site, add a script handler in that vhost's Script Handler tab. Background: LSAPI explained.

Apply changes

Click Graceful Restart (top right). It reloads config without dropping connections. From the shell: sudo /usr/local/lsws/bin/lswsctrl restart.

Troubleshooting

  • Default "Congratulations" page shows: mapping missing on that listener, or the domain spelled differently.
  • 404 on pretty URLs: rewrite not enabled or no restart after editing .htaccess.
  • Wrong certificate on HTTPS: vhost SSL not set, so the listener's default certificate was used.

FAQ: OpenLiteSpeed WebAdmin

Can I edit config files instead of the GUI?

Yes, files are in /usr/local/lsws/conf/, but the GUI rewrites them; don't mix both at once.

Should port 7080 be public?

No. Restrict it by IP or use an SSH tunnel.

Does a graceful restart drop visitors?

No. New processes take over while old ones finish their requests.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.