-
Notifications
You must be signed in to change notification settings - Fork 103
Installation tempesta supported regex
At first it is necessary to install dependencies for Hyperscan.
Colm (Colm Programming Language)
git clone https://github.com/adrian-thurston/colm.git
./autogen.sh
./configure
make
make install
add LD_LIBRARY_PATH="/usr/local/lib"
to /etc/environment
Ragel
git clone https://github.com/adrian-thurston/ragel.git
./autogen.sh
./configure --with-colm=/usr/local
make
make install
PCRE
download PCRE from sourceforge
wget https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz
tar -xf archive.tar.gz
./configure --enable-pcre16 --enable-pcre32
make
make install
Hyperscan
git clone https://github.com/tempesta-tech/linux-regex-module.git
git checkout ag_changes_for_easy_installation
cmake -DCMAKE_BUILD_TYPE=Release ./
make
make install
Description of additional cmake options for Hyperscan
Maybe it makes sense to clean directories of Colm, Ragel and Hyperscan after installation, because they take up a lot of space during compilation. For this, after make install
, we can run
git clean -d -f -x
Tempesta FW version with regex
git clone https://github.com/tempesta-tech/tempesta.git
cd tempesta
git checkout ag_Multi-pattern-regular-expressions
Using in http_chain
-
~
: "<string_of_regex>" =>regex
, case sensitive regular expression -
~*
: "<string_of_regex>" =>regex
, case insensitive regular expression (simply /i modifier will be added to the end of regex)
Using for locations
- location
~
"<string_of_regex>" - location
~*
"<string_of_regex>"
For regular expression syntax, read the Perl regular expressions man page. https://perldoc.perl.org/perlre#Capture-groups.
Not all capability implemented in Hyperscan, a list of supported and unsupported expressions is here http://intel.github.io/hyperscan/dev-reference/compilation.html#pattern-support
Description of the implementation.
G-Core linux regex module added to Tempesta FW as an additional module. Avx-512 extensions are disabled in makefile of regex. (I don't have these instructions in my CPU, but Hyperscan chooses them by default and kernel crashes occur.)
Starting process.
When reading config file in tempesta_fw module, any regular expression is written to a separate text file which also contains the number of regex. This number is associated with this regular expression inside tempesta_fw module.
When tempesta_fw module is already started, external application hscollider compiles all created text files with regular expression and save results to DB format. After this, DB files are placed in a special directory for xdp_rex (/sys/kernel/config/rex/). This process may take about a couple of seconds.
Stopping process.
Before stopping xdp_rex module all databases must be deleted from /sys/kernel/config/rex/ directory
- Home
- Requirements
- Installation
-
Configuration
- Migration from Nginx
- On-the-fly reconfiguration
- Handling clients
- Backend servers
- Load Balancing
- Caching Responses
- Non-Idempotent Requests
- Modify HTTP Messages
- Virtual hosts and locations
- HTTP Session Management
- HTTP Tables
- HTTP(S) Security
- Header Via
- Health monitor
- TLS
- Virtual host confusion
- Traffic Filtering by Fingerprints
- Run & Stop
- Application Performance Monitoring
- Use cases
- Performance
- Contributing