Use the one-line installer to install ols cli binary:
bash <(curl -fsSL https://raw.githubusercontent.com/Code-Egg/ols-cli/master/install_olscli.sh)Install OpenLiteSpeed, PHP, Database.
sudo ols installsudo ols site create example.com --wpsudo ols site create example.com --wp --lesudo ols site update example.com --php85sudo ols updatesudo ols site update example.com --enable-owasp --enable-recaptcha --hstssudo ols site update example.com --enable-nsols site info example.comols site show example.comols site listols --dry-run site create example.com --wp --le --php85 --enable-owasp --hsts --enable-ns
ols --dry-run site update example.com --enable-recaptcha --disable-owasp --disable-ns --le
ols --dry-run site info example.com
ols --dry-run site show example.com
ols --dry-run site list
ols --dry-run updateThe ols commands:
ols (command) [options]| Command | Purpose | Options |
|---|---|---|
install |
Install/align OpenLiteSpeed runtime and related packages | --php81 --php82 --php83 --php84 --php85 --database --config --http-port --https-port --ssl-cert --ssl-key --no-listeners |
site |
Manage sites (create, update, enable, disable, info, show, list, delete) |
--wp --le --php81 --php82 --php83 --php84 --php85 --enable-owasp --disable-owasp --enable-recaptcha --disable-recaptcha --enable-ns --disable-ns --hsts --keep-db |
update |
Update installed ols binary to latest GitHub release for current platform |
Global options (apply to all commands): --dry-run, --color
ols site (command) [options]| Subcommand | Purpose | Options |
|---|---|---|
create |
Create a new site/vhost | --wp --le --php81 --php82 --php83 --php84 --php85 --enable-owasp --disable-owasp --enable-recaptcha --disable-recaptcha --enable-ns --disable-ns --hsts |
update |
Update an existing site (PHP target optional when only WordPress/security/LE flags are used) | optional --wp, optional --le, optional PHP target: --php81 --php82 --php83 --php84 --php85, or security flags: --enable-owasp --disable-owasp --enable-recaptcha --disable-recaptcha --enable-ns --disable-ns --hsts |
enable |
Enable site from server-level | |
disable |
Disable site from server-level | |
info |
Show site metadata and detected status | |
show |
Print OLS virtual host config | |
list |
List managed sites discovered from OLS vhost directory | |
delete |
Remove site config/files and optionally keep DB | --keep-db |
go build -o ols ./cmd/olsgo test ./...For verbose output:
go test -v ./...Use config file defaults (recommended for first-run bootstrap):
sudo mkdir -p /etc/ols-cli
sudo cp docs/install.example.json /etc/ols-cli/install.json
sudo ols installinstall.json also supports:
owasp_crs_version(for example,"4.21.0") for OWASP CRS setup duringols installvh_recaptcha_typeandvh_recaptcha_reg_conn_limit(defaults:1and500) used when enabling vhost reCAPTCHA viasite create/update --enable-recaptcha
By default, ols install prepares server-level security blocks as:
module mod_securitywithls_enabled 0lsrecaptchawithenabled 1andtype 0namespacewith1
Override config values with flags when needed:
sudo ols install --config /etc/ols-cli/install.json --php85 --database mysql --http-port 80 --https-port 443
sudo ols install --no-listeners