Skip to main content

/usr/local/lsws — The Install Root

This is the single most important path on an OpenLiteSpeed server. Every operational task — configuring, reloading, debugging, backing up — starts here.

Yazi Navigation

If you use yazi as your file manager, navigate directly with:

yazi /usr/local/lsws

Use hjkl to move, Enter to open dirs, q to quit. Much faster than ls -la for visual exploration.


Full Directory Tree

/usr/local/lsws/
├── bin/ # Server control binaries
│ ├── lshttpd # Main server daemon
│ └── lswsctrl # Service control script (start/stop/restart/status)

├── admin/ # WebAdmin console app
│ ├── bin/ # Admin process binaries
│ ├── conf/ # Admin SSL cert + admin credentials
│ │ ├── admin_config.conf
│ │ └── htpasswd # Admin password (hashed)
│ ├── misc/
│ │ └── admpass.sh # Password reset script
│ └── html/ # WebAdmin UI static files

├── conf/ # ALL server configuration lives here
│ ├── httpd_config.conf # Main server config (listeners, vhosts, global settings)
│ └── vhosts/ # Per-site configs
│ └── <vhostname>/
│ └── vhconf.conf # Per-site virtual host config

├── logs/ # Server log files
│ ├── error.log # Main error log — check this first on any problem
│ ├── access.log # Access log (if enabled at server level)
│ ├── lsrestart.log # Restart history
│ └── stderr.log # PHP/worker stderr output

├── lsphp84/ # PHP 8.4 runtime (one dir per installed version)
│ ├── bin/
│ │ └── lsphp # PHP binary used by OLS via LSAPI
│ └── etc/php/8.4/ # php.ini and conf.d

├── Example/ # Default example virtual host (safe to delete in prod)
├── docs/ # Local documentation (basic)
├── lib/ # Shared libraries
└── tmp/ # Runtime PIDs and sockets
└── lshttpd/
├── lshttpd.pid # Main process PID
└── PLAT # Platform info

CLI Exploration Commands

# Quick overview of the install root
ls -la /usr/local/lsws/

# Show entire tree (requires: apt install tree)
tree -L 3 /usr/local/lsws/

# What PHP versions are installed?
ls -d /usr/local/lsws/lsphp*/

# Find ALL config files
find /usr/local/lsws/conf -name "*.conf" | sort

# Find all virtual host configs
find /usr/local/lsws/conf/vhosts -name "vhconf.conf"

# Check what is in the logs directory right now
ls -lht /usr/local/lsws/logs/

# Where is the running PID stored?
cat /tmp/lshttpd/lshttpd.pid

Key Paths — Quick Reference

PathWhat It IsWhen You Touch It
/usr/local/lsws/bin/lswsctrlService controllerEvery restart/reload
/usr/local/lsws/bin/lshttpdMain daemon binaryChecking version, debugging
/usr/local/lsws/conf/httpd_config.confMaster configAdding listeners, vhosts, global settings
/usr/local/lsws/conf/vhosts/<name>/vhconf.confPer-site configSite-specific rules, PHP handlers
/usr/local/lsws/logs/error.logError logDebugging — always check this first
/usr/local/lsws/admin/conf/htpasswdWebAdmin passwordIf locked out
/usr/local/lsws/admin/misc/admpass.shPassword reset helperAdmin lockout recovery
/usr/local/lsws/lsphp84/bin/lsphpPHP binaryChecking version, LSAPI path config

Reading Config Files Directly

The config files use a structured text format. You can read and edit them directly — no GUI required.

# View the main server config
sudo cat /usr/local/lsws/conf/httpd_config.conf

# View a virtual host config
sudo cat /usr/local/lsws/conf/vhosts/example/vhconf.conf

# Search config for listener definitions
grep -n "listener" /usr/local/lsws/conf/httpd_config.conf

# Search for PHP handler references across all vhost configs
grep -rn "lsphp" /usr/local/lsws/conf/vhosts/

# Live-tail the error log while testing
sudo tail -f /usr/local/lsws/logs/error.log
Direct Config Editing

OpenLiteSpeed reads config files on graceful restart. You can edit httpd_config.conf or vhconf.conf directly in vim/nano, then run lswsctrl restart — no WebAdmin needed.


Checking Installed lsphp Versions

# List all installed lsphp versions
ls /usr/local/lsws/ | grep lsphp

# Check each version's binary
for v in /usr/local/lsws/lsphp*/bin/lsphp; do echo "$v:"; $v -v; done

# Check PHP ini path for a specific version
/usr/local/lsws/lsphp84/bin/lsphp --ini | grep "Loaded Configuration"

What's Next

  • conf — Deep dive into the configuration directory
  • logs — Understanding log files and how to tail them
  • Admin Interface Files — What the admin directory contains