Blog / Others/ Installing Dependencies for Compiling OpenLiteSpeed: A Guide for Different Systems

Installing Dependencies for Compiling OpenLiteSpeed: A Guide for Different Systems

编译安装 OpenLiteSpeed 服务器:各系统依赖包安装指南

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 dnf instead of yum.
  • FreeBSD Alternative: On FreeBSD, you can also use the pkg package manager for quicker installation: pkg install pcre rcs GeoIP expat openssl.
  • Build Environment: Ensure you install build-essential (Debian-based) or the Development Tools group (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.

Post a Comment

Your email will not be published. Required fields are marked with *.