LiteSpeed (AlmaLinux 8)

LiteSpeed (AlmaLinux 8)

  • OS: almalinux 8

Description

LiteSpeed is a high-performance web server software that is designed to improve the speed and efficiency of websites. It is a popular alternative to the Apache web server, offering faster processing speeds and better resource utilization. LiteSpeed also includes advanced caching features and security measures to help protect websites from cyber threats.

Software included

Package Version
OpenLitespeed latest
PHP 8.1
Docker 3.20.10
Docker compose 2.12.2
containerd.io 1.6.10

Initial start of the service

This application uses Docker to provide faster startup of the accompanying software (LiteSpeed) and direct use. This eliminates the need to familiarize yourself with its specifics in terms of configuration and installation. To start working directly with the application, all you need to do is visit the IP address assigned to your virtual machine in your browser to view your new LiteSpeed installation.

Note: By default, LiteSpeed can be accessed directly by IP address. To start using LiteSpeed with your real domain, you first need to point the domain in question to your IP address and change the settings for where LiteSpeed opens from through its admin panel.

Quick settings and frequently asked questions

  • Logging into the cloud service is done using an SSH key or password that you have specified.
  • Docker is installed as recommended by the official docker documentation.
  • The standard docker and docker compose commands are now available in this application.
  • When the virtual machine is first started, it takes a few minutes before a Docker container containing Wordpress and OpenLitespeed is started.
  • LiteSpeed data is set to be persistent and is located in /opt/lsws/lsws-docker/sites/localhost/html/.
  • Once everything is ready, you can take the IP address of the machine and open it with a browser. If you have already pointed your domain to the corresponding IP address, then use it. You will be greeted by the initial page to complete your Wordpress installation, which takes a few minutes.

Licensing

Upon first boot, LiteSpeed will automatically issue a license key for 15 days trial period. After the trial is up, you must purchase a valid LiteSpeed license. You can replace your serial key using the following method:

cd /opt/lsws/lsws-docker/
bash bin/webadmin.sh --serial <SERIAL> # Replace <SERIAL> with your new license key

Setting OpenLitespeed Webadmin password

By default, after startup the OpenLitespeed password for access to its panel is not set. We recommend changing it as soon as you start your service. The replacement is done with the following commands:

cd /opt/lsws/lsws-docker/
bash bin/webadmin.sh password # Replace 'password' with the password you want to set

After changing your password, you can access your OpenLitespeed panel on port 7080 with the user admin.

Adding and removing a new site

Adding a new site is done using the following commands:

cd /opt/lsws/lsws-docker/
bash bin/domain.sh --add example.com # Replace 'example.com' with the domain you want to add
cd /opt/lsws/lsws-docker/
bash bin/domain.sh --del example.com # Replace 'example.com' with the domain you want to remove

Letsencrypt

If you want to use Letsencrypt, you need to do an initial installation, this is done with the following command:

cd /opt/lsws/lsws-docker/
bash /bin/acme.sh --install --email user@example.com # Replace 'user@example.com' with your email address

After initial installation, we can issue a new certificate:

cd /opt/lsws/lsws-docker/
bash bin/acme.sh --domain example.com # Replace 'example.com' with the domain for which you are issuing a certificate. It should already be pointed to your IP address

Other useful parameters:

  • [-r, --renew]: Renewing a specific domain, optional -D or --domain parameter to specify the domain name. To force a renewal, use the -f parameter.
  • [-R, --renew-all]: Renew all domains if possible. To force a renewal, use the -f parameter.
  • [-f, -F, --force]: Force a renewal.
  • [-v, --revoke]: Domain certificate revocation.
  • [-V, --remove]: Remove domain from Letsencrypt configuration.

Updating the web server

cd /opt/lsws/lsws-docker/
bash bin/webadmin.sh --upgrade

Working with Docker

The organization of this application is entirely done using Docker. In this way, we can provide you with ready-made applications faster. In addition, their configuration is more flexible and quite controllable. To be able to control this application, however, you need to know some basic Docker functionalities and features.

Restarting all services

Restarting the database and the Docker container that contains LiteSpeed itself, along with the rest of the software, can be done in two ways:

  1. By restarting the entire virtual machine
  2. Restarting the Docker containers, which is the faster option. To do this, access your machine via SSH, and run the following commands:
sudo su -
cd /opt/lsws/lsws-docker/
docker compose restart

Recreating Docker containers

Recreation of a docker container may be necessary if you've changed the configuration inside the docker-compose.yml file. If there are changes, please follow these steps:

cd /opt/lsws/lsws-docker/
docker compose stop
docker compose up -d

Checking the status of the Docker application

To check, you need to run the following commands:

sudo su -
docker ps -a

Please pay attention to the STATUS column. It should show how long the service has been running, for example Up X minutes. If the status is Restarting then you need to check what is wrong with the application. In such a case, you can check by following the application logs as follows:

  1. Get the application's name that you can see in the NAMES column from the output of the docker ps -a command. View the logs with the docker logs <NAME> command, where is the name of the container.