Install:OpenLiteSpeed with HTTP2 Installation Notes
From OpenLiteSpeed Wiki
Setting up HTTP/2 support in OpenLiteSpeed mirrors the process for setting up SPDY support.
When compiled from source, OpenLiteSpeed does not have HTTP/2 support compiled by default. HTTP/2 support must be specifically enabled when compiling.
Compiling HTTP/2 requires OpenSSL 1.0.2 or higher. This wiki will take you through the steps for checking your OpenSSL version, installing a newer version (if necessary), and compiling OpenLiteSpeed with HTTP/2.
If you install OpenLiteSpeed from one of our repositories, HTTP/2 will be compiled and enabled (and can be used) by default.
Check OpenSSL version
You can check your current OpenSSL version by running the command
Install OpenSSL 1.0.2
If your system does not have a high enough version of OpenSSL, it can be downloaded from the OpenSSL site.
Upgrading OpenSSL can cause problems in your system, so it is not recommended to replace your current version of OpenSSL if you have a version lower than 1.0.2. Instead, we recommend that you install OpenSSL in a separate directory where it can be used specifically for compiling OpenLiteSpeed. You need to be careful when doing this so that OpenLiteSpeed will be able to find all the files it needs when installing. Use the following steps:
- Download and unpack a newer version of OpenSSL from the OpenSSL site.
- From inside the unpacked package, run the commands:
./config --prefix=/usr/local --openssldir=/usr/local/openssl make make install
/usr/localis the path to your new OpenSSL directory and
/usr/local/opensslis the name of your new OpenSSL directory. You can put your new version of OpenSSL wherever you want, but you need to stipulate the directory name and name it
oppenssl. This is how OpenLiteSpeed will know where to look for the right files.
Install OpenLiteSpeed with HTTP/2 enabled
When building OpenLiteSpeed, use the
--enable-http2 option to build OpenLiteSpeed with HTTP/2 enabled. (Using the old
--enable-spdy option will also enable HTTP/2.) When building with HTTP/2 enabled, you must stipulate where your installation of OpenSSL is using the
--with-openssl configuration option shown below:
./configure --with-openssl=/usr --enable-http2 make make install
Update:Starting from version 1.3.12, SPDY/HTTP2 has been enabled by default during installation hence it is not necessary to add
--enable-http2 ; To disable http2, you have to use
Note: The default OpenSSL location is
/usr. If you installed another copy of OpenSSL in a different directory (such as in
/usr/local, as directed above), be sure to direct OpenLiteSpeed to look for OpenSSL in the correct directory.
Once HTTP/2 support has been built in, you turn on HTTP/2 using the Enable HTTP/2 setting in the Listeners tab of the WebAdmin console (WebAdmin console > Configuration > Listeners > SSL). In this setting, you can enable HTTP/2, SPDY/2, and/or SPDY/3 or disable SPDY altogether. All versions are enabled by default.