ols1clk is a One-Click Script for installing OpenLiteSpeed (OLS).
It can:
- Install OpenLiteSpeed with default settings.
- Install WordPress with OpenLiteSpeed using
-Wor--wordpress. - Fully provision WordPress using
--wordpressplus, with optional site settings. - Use MariaDB by default, or MySQL or Percona Server for MySQL through command-line options.
- Import an existing WordPress installation using
--wordpresspath.
Common usage:
Install OpenLiteSpeed, LSPHP, MariaDB, WordPress, and LiteSpeed Cache:
bash <(curl -fsSL https://raw.githubusercontent.com/litespeedtech/ols1clk/master/ols1clk.sh) -WInstall OpenLiteSpeed and LSPHP only:
bash <(curl -fsSL https://raw.githubusercontent.com/litespeedtech/ols1clk/master/ols1clk.sh)See below for additional options and usage examples.
| Opt | Option | Description |
|---|---|---|
--adminuser <username> |
Sets the WebAdmin Console username instead of using admin. |
|
-A |
--adminpassword <password> |
Sets the WebAdmin Console password instead of generating a random password. |
--adminport <port> |
Sets the WebAdmin Console port instead of using 7080. |
|
-E |
--email <email> |
Sets the administrator email address. |
| Opt | Option | Description |
|---|---|---|
--lsphp <version> |
Sets the LSPHP version, such as 84. Supported versions are 74, 80, 81, 82, 83, 84, and 85. |
| Opt | Option | Description |
|---|---|---|
--mariadbver <version> |
Sets the MariaDB version. Supported versions are 10.6, 10.11, 11.4, and 11.8. |
|
-R |
--dbrootpassword <password> |
Sets the database root password. |
--dbname <database-name> |
Sets the WordPress database name. | |
--dbuser <database-username> |
Sets the WordPress database username. | |
--dbpassword <password> |
Sets the WordPress database-user password. | |
--prefix <prefix> |
Sets the WordPress database-table prefix. | |
--pure-mariadb |
Installs OpenLiteSpeed and MariaDB. | |
--pure-mysql |
Installs OpenLiteSpeed and MySQL. | |
--pure-percona |
Installs OpenLiteSpeed and Percona Server for MySQL. | |
--with-mysql |
Installs OpenLiteSpeed and the selected application with MySQL. | |
--with-percona |
Installs OpenLiteSpeed and the selected application with Percona Server for MySQL. |
| Opt | Option | Description |
|---|---|---|
-W |
--wordpress |
Installs WordPress. You must complete the WordPress setup in a browser. |
--wordpressplus <site-domain> |
Installs, sets up, and configures WordPress. It also enables LiteSpeed Cache. | |
--wordpresspath <path> |
Specifies the location for a new or existing WordPress installation. | |
--wpuser <username> |
Sets the WordPress administrator username. | |
--wppassword <password> |
Sets the WordPress administrator password. | |
--wplang <language> |
Sets the WordPress language. The default is en_US. |
|
--sitetitle <title> |
Sets the WordPress site title. The default is mySite. |
| Opt | Option | Description |
|---|---|---|
--listenport <port> |
Sets the HTTP listener port. The default is 80. |
|
--ssllistenport <port> |
Sets the HTTPS listener port. The default is 443. |
|
--sitedomain <site-domain> |
Sets the domain mapping at the listener level. The default is *. |
|
--autocert |
Installs ACME and enables Automatic SSL Certificates at the server level. | |
--proxy-r |
Configures a proxy that uses rewrite rules. | |
--proxy-c |
Configures a proxy that uses server configuration. | |
--proxy-s |
Configures a web socket proxy. | |
--proxy-port <port> |
Sets the proxy port. The default is 8080. |
| Opt | Option | Description |
|---|---|---|
--owasp-enable |
Enables ModSecurity with OWASP rules. If OLS is already installed, this option enables the rules directly. | |
--owasp-disable |
Disables ModSecurity with OWASP rules. | |
--fail2ban-enable |
Enables Fail2Ban protection for the WebAdmin Console and WordPress login pages. |
| Opt | Option | Description |
|---|---|---|
-U |
--uninstall |
Uninstalls OpenLiteSpeed and removes the installation directory. |
-P |
--purgeall |
Uninstalls OpenLiteSpeed, removes the installation directory, and purges all MySQL data. |
-Q |
--quiet |
Uses quiet mode and does not prompt for input. |
-V |
--version |
Displays script version information. |
-v |
--verbose |
Displays additional installation messages. |
--update |
Updates ols1clk from GitHub. |
|
-H |
--help |
Displays help information. |
# Install OpenLiteSpeed with the default PHP version.
./ols1clk.sh# Install OpenLiteSpeed with WordPress and MariaDB.
./ols1clk.sh -W# Install OpenLiteSpeed with WordPress and MySQL.
./ols1clk.sh -W --with-mysql# Enable OWASP rules. This option can be used after OLS is installed.
./ols1clk.sh --owasp-enableMake sure that your domain points to the server.
Then run:
./ols1clk.sh --sitedomain www.example.com --autocert./ols1clk.sh --proxy-r --proxy-port 7860Run the following command to create an additional virtual host. The example document root is /var/www/www.example.com. Replace www.example.com with your domain.
/bin/bash <(curl -fsSL https://raw.githubusercontent.com/litespeedtech/ls-cloud-image/master/Setup/vhsetup.sh) -d www.example.comThe first time you create an additional virtual host, the script requires the database root password from /usr/local/ols/password. If you use a custom value, update that file or write the password to /root/.db_password:
echo 'root_mysql_pass="DB_ROOT_PASSWORD"' > /root/.db_passwordThen run:
/bin/bash <(curl -fsSL https://raw.githubusercontent.com/litespeedtech/ls-cloud-image/master/Setup/vhsetup.sh) -d www.example.com -wMake sure that your domain points to the server.
Then run:
/bin/bash <(curl -fsSL https://raw.githubusercontent.com/litespeedtech/ls-cloud-image/master/Setup/vhsetup.sh) -d www.example.com -le [email protected] -f-f forces HTTPS redirection.
Follow the Build WordPress Image guide to quickly set up OpenLiteSpeed, WordPress, LiteSpeed Cache, phpMyAdmin, Let's Encrypt, and Redis with WebSocket support.
For additional supported CMS scripts, visit the ls-cloud-image Wiki.
If you still have questions after reading these instructions:
- Join the GoLiteSpeed Slack community for real-time discussion.
- Report issues in GitHub ols1clk.
- Discuss OpenLiteSpeed topics in the OLS Google Group.