Building Angie from Source#
We recommend installing Angie from official pre-built packages. However, if you still need your own build:
-
Download the
.tar.gz
archive from our website:$ curl -O https://download.angie.software/files/angie-1.8.0.tar.gz
-
Unpack the sources and browse to the source code:
$ tar -xpf angie-1.8.0.tar.gz $ cd angie-1.8.0
-
To prepare the build, use the ./configure script to determine the specific characteristics of the OS where the build occurs, particularly the methods that Angie can use to handle connections. After a successful run, the script creates a
Makefile
.Before running ./configure, browse and set the build options:
$ ./configure <OPTIONS>
-
When the
Makefile
is ready, build and install Angie:$ make $ make install
Build Options#
General#
Option |
Description |
Default |
---|---|---|
|
Prints a help message. |
|
|
Sets the name of an unprivileged user whose credentials will be used by
worker processes. After installation, the name can always be changed in
the |
|
|
Sets the name of an unprivileged group whose credentials will be used by
worker processes. After installation, the name can always be changed in
the |
|
|
Sets an optional name for the build. |
|
|
Sets the build directory. |
|
|
Specifies the directory for caching build artifacts. |
If set without a path, |
Paths#
Option |
Description |
Default |
---|---|---|
|
Defines the directory that will store server files. This same directory
will also be used for all relative paths set by configure
(except for paths to library sources) and in the |
|
|
Sets the name of the Angie executable. This name is used only during installation. |
|
|
Defines the directory where Angie dynamic modules will be installed. |
|
|
Sets the name of the |
|
|
Sets the name of the primary error, warning, and diagnostic log file.
After installation, the file name can always be changed in the
|
|
|
Sets the name of the |
|
|
Sets the name of the |
|
|
Sets the directory to store certificates and keys obtained for
|
|
|
Sets the name of the primary request log file for the HTTP server. After
installation, the file name can always be changed in the
|
|
|
Defines the directory for storing temporary files that hold client request
bodies. After installation, the directory can always be changed in the
|
|
|
Defines the directory for storing temporary files with data received from
proxied servers. After installation, the directory can always be changed
in the |
|
|
Defines the directory for storing temporary files with data received from
FastCGI servers. After installation, the directory can always be changed
in the |
|
|
Defines the directory for storing temporary files with data received from
uWSGI servers. After installation, the directory can always be changed in
the |
|
|
Defines the directory for
storing temporary files with data received from SCGI servers. After
installation, the directory can always be changed in the |
|
Features and dependencies#
|
Enables or disables building a module that allows the server to run using
|
|
Enables the use of thread pools. |
|
Enables the use of asynchronous file I/O (AIO) on FreeBSD and Linux. |
|
Enables the debugging log. |
|
Disables the HTTP cache. |
|
Enables the PCRE library. The optional setting is the path to the sources of the PCRE library. The library distribution needs to be downloaded from the PCRE site and extracted. The rest is done by Angie's ./configure and make commands. The library is required for regular expression support in the
|
|
Sets additional build options for PCRE. |
|
Builds the PCRE library with JIT compilation support (the pcre_jit directive). |
|
Disables the use of the PCRE library. |
|
Disables the use of the PCRE2 library instead of the original PCRE library. |
|
Forces the usage of the libatomic_ops library. The optional setting is the path to the library sources. |
|
Enables and sets the path to the OpenSSL library sources. |
|
Sets additional build options for OpenSSL. |
|
Enables server-side and client-side NTLS support in the HTTP and Streaming modules (server-side, client-side) when linked with an NTLS-enabled SSL library. |
|
Sets the path to the sources of the zlib library. The library distribution (version 1.1.3 — 1.2.11) needs to be downloaded from the zlib site and extracted. The rest is done by Angie's ./configure and make commands. The library is required for the GZip module. |
|
Sets additional build options for |
|
Enables building zlib with assembly sources optimized for one
of these CPUs: |
Enabling and Disabling Modules#
You can disable modules that are included by default or enable modules that are available but disabled by default.
HTTP#
Enabling additional modules:
|
Enables the ACME module that supports the ACME protocol. |
|
Enables the Addition module that adds text before and after a response. |
|
Enables the Auth Request module that implements client authorization based on the result of a subrequest. |
|
Enables the DAV module that provides file management automation via the WebDAV protocol. |
|
Enables the Degradation module that allows returning HTTP status codes 204 or 444 for certain locations. This module can only be used in cases where |
|
Enables the FLV module that provides pseudo-streaming server-side support for Flash Video (FLV) files. |
|
Enables the GeoIP module that creates variables depending on the client IP address and the precompiled MaxMind databases. |
|
Enables the GunZIP module
that decompresses responses with |
|
Enables the GZip Static module that allows sending
precompressed files with the |
|
Enables the Image Filter module that transforms images in JPEG, GIF, PNG, and WebP formats. |
|
Enables the MP4 module that provides pseudo-streaming server-side support for MP4 files. |
|
Enables the Perl module. |
|
Defines the directory that will store Perl modules. |
|
Sets the path to the Perl executable. |
|
Enables the Random Index module that processes
requests ending with the slash character ( |
|
Enables the RealIP module that changes the client address to the address sent in the specified header field. |
|
Enables the Secure Link module. |
|
Enables the Slice module that splits a request into subrequests, each returning a certain range of the response. The module provides effective caching of large responses. |
|
Enables SSL support for the HTTP server. The OpenSSL library is required to build and run this module. |
|
Enables the Stub Status module that provides access to basic status information. |
|
Enables the Sub module that modifies a response by replacing one specified string with another. |
|
Enables the HTTP/2 module. |
|
Enables the HTTP/3 module. |
Note
It's highly recommended to build the HTTP/3 module with an SSL library that fully supports QUIC:
Using BoringSSL:
$ ./configure
--with-debug
--with-http_v3_module
--with-cc-opt="-I../boringssl/include"
--with-ld-opt="-L../boringssl/build/ssl
-L../boringssl/build/crypto"
Using LibreSSL:
$ ./configure
--with-debug
--with-http_v3_module
--with-cc-opt="-I../libressl/build/include"
--with-ld-opt="-L../libressl/build/lib"
Using QuicTLS:
$ ./configure
--with-debug
--with-http_v3_module
--with-cc-opt="-I../quictls/build/include"
--with-ld-opt="-L../quictls/build/lib"
Otherwise, the OpenSSL library will use a compatibility layer that doesn't support early data and some other features, such as session reuse. The resulting build will only interoperate with clients and servers that use the same OpenSSL compatibility layer.
|
Enables the XSLT module that transforms XML responses using one or more XSLT stylesheets. The libxml2 and libxslt libraries are required to build and run this module. |
|
Enables the Google PerfTools module that allows profiling Angie worker processes using Google Performance Tools. The module is intended for Angie developers. |
Disabling standard modules:
|
Disables the Access module that allows limiting access to certain client addresses. |
|
Disables the API module that provides a RESTful HTTP interface for accessing JSON-based information about the web server instance. |
|
Disables the Auth Basic module that allows limiting access to resources by validating the user name and password using the HTTP Basic Authentication protocol. |
|
Disables the AutoIndex
module that processes requests ending with the slash character
( |
|
Disables the Browser
module that creates variables whose values depend on the value of the
|
|
Disables the Charset
module that adds the specified charset to the |
|
Disables the :ref:` module <http_empty_gif>` that emits a single-pixel transparent GIF. |
|
Disables the FastCGI module that passes requests to a FastCGI server. |
|
Disables the Geo module that creates variables with values depending on the client IP address. |
|
Disables the module that compresses the HTTP server responses. The zlib library is required to build and run this module. |
|
Disables the gRPC module that passes requests to a gRPC server. |
|
Disables the Limit Conn module that limits the number of connections per key, for example, the number of connections from a single IP address. |
|
Disables the Limit Req module that limits the request processing rate per key, for example, the processing rate of requests coming from a single IP address. |
|
Disables the Map module that creates variables with values depending on the values of other variables. |
|
Disables the Memcached module that obtains responses from a memcached server. |
|
Disables the Mirror module that implements mirroring of an original request by creating background mirror subrequests. |
|
Disables the Proxy module of the HTTP server. |
|
Disables the Prometheus module of the HTTP server. |
|
Disables the Referer
module that can block access to a site for requests with invalid values
in the |
|
Disables the Rewrite module that allows the HTTP server to redirect requests and change their URIs. The PCRE library is required to build and run this module. |
|
Disables the SCGI module that passes requests to an SCGI server. |
|
Disables the Split Clients module that creates variables for A/B testing. |
|
Disables the SSI module that processes SSI (Server Side Includes) commands in responses passing through it. |
|
Disables the module that implements the hash load balancing method. |
|
Disables the module that implements the ip_hash load balancing method. |
|
Disables the module that provides connection caching to upstream servers. |
|
Disables the module that implements the least_conn load balancing method. |
|
Disables the module that implements the random load balancing method. |
|
Disables the module that implements session persistence, ensuring all requests in the client session are passed to the same backend server in the upstream. |
|
Disables the module that allows storing the run-time state of an upstream in a shared memory zone. |
|
Disables the UserID module that sets cookies suitable for client identification. |
|
Disables the uWSGI module that passes requests to a uWSGI server. |
Streaming#
Enabling additional modules:
|
Enables the GeoIP module that creates variables depending on the client IP address and the precompiled MaxMind databases. |
|
Enables the MQTT Preread module that allows
extracting client IDs and usernames from |
|
Enables the RDP Preread module that allows extracting cookies from RDP sessions. |
|
Enables the RealIP module that changes the client address to the address sent in the PROXY protocol header. |
|
Enables SSL support for the Streaming server. The OpenSSL library is required to build and run this module. |
|
Enables the SSL Preread module that allows extracting information from ClientHello messages without terminating SSL/TLS. |
Disabling standard modules:
|
Disables the Geo module that creates variables with values depending on the client IP address. |
|
Disables the Limit Conn module that limits the number of connections per key, for example, the number of connections from a single IP address. |
|
Disables the Map module that creates variables with values depending on values of other variables. |
|
Disables the Return module that sends the specified value to the client and then closes the connection. |
|
Disables the Set module that sets a value for a variable. |
|
Disables the Split Clients module that creates variables for A/B testing. |
|
Disables the module that implements the hash load balancing method. |
|
Disables the module that implements the least_conn load balancing method. |
|
Disables the module that implements the random load balancing method. |
|
Disables the module that enables storing the run-time state of an upstream in a shared memory zone. |
Mail#
Enabling additional modules:
|
Enables SSL support for the Mail server. The OpenSSL library is required to build and run this module. |
Disabling standard modules:
Other options#
|
Enables an external module at the specified path. |
|
Enables an external dynamic module at the specified path. |
|
Enables dynamic module compatibility; when enabled, Angie can load and use dynamic modules that were built for the same Angie version, even if these modules were built with different options. |
|
Sets the name of the C compiler. |
|
Sets the name of the C preprocessor. |
|
Sets additional parameters that will be added to the |
|
Sets additional parameters that will be used during linking. When using
the system PCRE library under FreeBSD, |
|
Enables builds optimized for a specific CPU: |
Examples#
Simple HTTPS-Enabled Build: This basic configuration enables HTTPS support using SSL/TLS, with the necessary dependencies (PCRE for regex, zlib for compression, and OpenSSL for SSL/TLS):
$ ./configure \
--sbin-path=/usr/sbin/angie \
--conf-path=/etc/angie/angie.conf \
--pid-path=/run/angie.pid \
--with-http_ssl_module \
--with-pcre=../pcre2-10.40 \
--with-zlib=../zlib-1.3 \
--with-openssl=../openssl-3.0.8
Performance-Optimized Build: This configuration is optimized for performance by enabling HTTP/2, gzip static compression, JIT for PCRE, and asynchronous I/O; thread pools are also enabled to handle high loads efficiently:
$ ./configure \
--sbin-path=/usr/sbin/angie \
--conf-path=/etc/angie/angie.conf \
--pid-path=/run/angie.pid \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_gzip_static_module \
--with-pcre=../pcre2-10.40 \
--with-pcre-jit \
--with-zlib=../zlib-1.3 \
--with-threads \
--with-file-aio
Load Balancer with TCP/UDP Proxying: This configures a load balancer for both HTTP and non-HTTP services:
$ ./configure \
--sbin-path=/usr/sbin/angie \
--conf-path=/etc/angie/angie.conf \
--pid-path=/run/angie.pid \
--with-stream \
--with-stream_ssl_module \
--with-pcre=../pcre2-10.40 \
--with-zlib=../zlib-1.3
Custom build: This configures HTTPS, HTTP/2, compression, enhanced security and performance, along with additional modules for Brotli compression and cache management, optimized for both HTTP and TCP/UDP proxying:
$ ./configure \
--prefix=/usr/local/angie \ # Sets the installation directory for Angie
--sbin-path=/usr/sbin/angie \ # Path to the Angie binary
--conf-path=/etc/angie/angie.conf \ # Path to the main configuration file
--pid-path=/run/angie.pid \ # Path to the PID file
--lock-path=/var/lock/angie.lock \ # Path to the lock file
--error-log-path=/var/log/angie/error.log \ # Path to the error log
--http-log-path=/var/log/angie/access.log \ # Path to the access log
--with-http_ssl_module \ # Enables SSL module for HTTPS
--with-http_v2_module \ # Enables HTTP/2 support for improved performance
--with-http_realip_module \ # Allows Angie to correctly handle X-Real-IP and X-Forwarded-For headers
--with-http_gzip_static_module \ # Serves pre-compressed .gz files to reduce CPU load
--with-http_stub_status_module \ # Provides a status page
--with-threads \ # Enables thread pools to improve performance under heavy load
--with-file-aio \ # Enables asynchronous I/O
--with-stream \ # Enables TCP/UDP proxy functionality
--with-stream_ssl_module \ # Adds SSL/TLS support for stream (TCP/UDP) proxy
--with-pcre=../pcre2-10.40 \ # Specifies the path to PCRE library for regex support
--with-pcre-jit \ # Enables just-in-time compilation for PCRE
--with-zlib=../zlib-1.3 \ # Specifies the path to the zlib library for compression
--with-openssl=../openssl-3.0.8 \ # Specifies the path to the OpenSSL library for SSL/TLS
--with-openssl-opt="enable-ec_nistp_64_gcc_128" \ # Optimizes OpenSSL for 64-bit NIST curves
--add-module=../ngx_brotli \ # Adds third-party ngx_brotli module for Brotli compression support
--add-dynamic-module=../ngx_cache_purge # Adds third-party ngx_cache_purge module for cache management