vhconf.conf
Learning Focus
By the end of this lesson you will understand the purpose and structure of vhconf.conf, how it relates to the main config, and how to edit it safely for individual sites.
What It Is
vhconf.conf is the per-virtual-host configuration file. Each virtual host in OpenLiteSpeed has its own vhconf.conf that defines site-specific settings such as document root, rewrite rules, contexts, external apps, and script handlers.
Default location pattern:
/usr/local/lsws/conf/vhosts/<VHOST_NAME>/vhconf.conf
How It Relates to httpd_config.conf
The main httpd_config.conf references each virtual host by name. OpenLiteSpeed then reads the corresponding vhconf.conf for site-specific behavior.
Key Sections
| Section | What It Controls |
|---|---|
| docRoot | Path to the public web files |
| index | Default index files (e.g., index.html, index.php) |
| rewrite | URL rewriting rules |
| context | Path-based handlers (static, PHP, proxy, redirect) |
| extprocessor | External application definitions (e.g., lsphp) |
| scripthandler | Maps file extensions to external apps |
| accessLog | Per-vhost access log settings |
Working with vhconf.conf
Viewing
# List all virtual host configs
ls -la /usr/local/lsws/conf/vhosts/
# View a specific vhost config
cat /usr/local/lsws/conf/vhosts/example/vhconf.conf
Editing
# Backup first
sudo cp /usr/local/lsws/conf/vhosts/example/vhconf.conf \
/usr/local/lsws/conf/vhosts/example/vhconf.conf.bak
# Edit
sudo nano /usr/local/lsws/conf/vhosts/example/vhconf.conf
# Reload
sudo /usr/local/lsws/bin/lswsctrl restart
# Verify
tail -20 /usr/local/lsws/logs/error.log
info
Changes to vhconf.conf require a graceful reload to take effect. You do not need a full server restart.
Key Takeaways
- Each site gets its own
vhconf.conffor isolated, per-site configuration. - The file controls document root, rewrites, contexts, and PHP handler mappings.
- Always backup before editing and reload after changes.
What's Next
- Continue to .htaccess Support to learn about Apache-compatible configuration.