Dependencies for Compiling OpenLiteSpeed
Before compiling OpenLiteSpeed from source, you must install the necessary build tools and libraries for your operating system. Below are the installation commands for different systems.
CentOS / RHEL Systems
For CentOS 5, 6, 7 and corresponding RHEL versions.
yum install epel-release
yum install gcc gcc-c++ make autoconf glibc rcs
yum install pcre-devel openssl-devel expat-devel geoip-devel zlib-devel
Ubuntu / Debian Systems
For Ubuntu, Debian, and their derivatives.
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install rcs libpcre3-dev libexpat1-dev libssl-dev libgeoip-dev zlib1g-dev libxml2 libxml2-dev libpng-dev openssl
FreeBSD System
On FreeBSD, you can install dependencies via the ports system.
cd /usr/ports/devel/pcre; make install clean; rehash
cd /usr/ports/devel/rcs; make install clean; rehash
cd /usr/ports/net/GeoIP; make install clean; rehash
cd /usr/ports/textproc/expat2; make install clean; rehash
cd /usr/ports/security/openssl; make install clean; rehash
Additional Notes and Considerations
- System Version Updates: Note that CentOS 5/6 and some older Ubuntu/Debian versions are no longer officially supported. It is recommended to use newer system versions (e.g., CentOS 7/8 Stream, Ubuntu 20.04/22.04, Debian 11/12) for better security and compatibility.
- Package Manager Differences: Different Linux distributions use different package manager commands (yum/dnf, apt-get/apt). Use the correct command for your system. For example, on CentOS 8 or RHEL 8 and above, use
dnfinstead ofyum. - FreeBSD Alternative: On FreeBSD, you can also use the
pkgpackage manager for quicker installation:pkg install pcre rcs GeoIP expat openssl. - Build Environment: Ensure you install
build-essential(Debian-based) or theDevelopment Toolsgroup (RHEL-based) to get a complete compilation toolchain.
After installing the dependencies above, you can proceed to download the OpenLiteSpeed source code and compile it.