Goal : lighttpd redirection, http -> https

Meet the error when running lighttpd with lighttpd.conf

content of configuration

$HTTP["scheme"] == "http" {
    $HTTP["host"] =~ ".*" {
        url.redirect = (".*" => "https://%0$0")
    }
}

error

2024-09-24 06:02:21: (data_config.c.176) can't handle '$HTTP["host"] =~ ".*"' as you compiled without pcre support. \n(perhaps just a missing pcre-devel 
package ?) \n

 

1. Download source

https://github.com/PCRE2Project/pcre2/releases/tag/pcre2-10.44

 

Release PCRE2-10.44 · PCRE2Project/pcre2

This is mostly a bug-fix and tidy-up release. An explicit limit can now be set on the size of a compiled pattern.

github.com

 

2. configurre

PREFIX=`pwd`
CROSS_COMPILE=/opt/arm/bin/arm-linux-gnu
HOST=arm-linux-gnu

./configure --host=${HOST} \
CC=${CROSS_COMPILE}-gcc \
AR=${CROSS_COMPILE}-ar \
STRIP=${CROSS_COMPILE}-strip \
RANLIB=${CROSS_COMPILE}-ranlib \
--prefix=${PREFIX}/_install

 

3. make && make install

 

4. lighttpd configure for build

PCRE2DIR=$(pwd)/../pcre/pcre2/_install

...

--with-pcre2=$PCRE2DIR \
--with-pcre2-include=$PCRE2DIR/include \
--with-pcre2-libs=$PCRE2DIR/lib/ \

...

+ Recent posts