OpenWrt Forum Archive

Topic: rc2 bug (and fix): lighttpd mod_rewrite and mod_redirect not working

The content of this topic has been archived on 27 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

When trying to use lighttpd mod_rewrite and/or mod_redirect, they complain about missing pcre support (even though pcre is installed).
The problem is that the lighttpd configure script doesn't define HAVE_PCRE_H (which is checked for in src/mod_rewrite.c).

The culprit in the source is

if test "x$cross_compiling" = xno; then
  [ ... check for PCRE ... ]
fi

In short, "Check for PCRE only if we aren't crosscompiling; if we are, we don't have it."

The PCRE_LIB= setting in the ipkg makefile isn't sufficient because it does't set HAVE_PCRE_H, which is checked for in the source.
A quick (and crude but effective wink ) hack would be adding

AC_DEFINE([HAVE_PCRE_H], [1], [Use PCRE])
AC_DEFINE([HAVE_LIBPCRE], [1], [Use PCRE])

to lighttpd's configure.in.

While at it, lighttpd 1.4.2 is out w/ loads of bugfixes, the package should probably be updated.

I've uploaded a patch to current OpenWRT CVS (doing both the fix and update) is to http://www.arklinux.org/~bero/openwrt-lighttpd.patch

(Last edited by bero on 31 Aug 2005, 16:26)

This was fixed in CVS (head and whiterussian) this morning.

Thanks anyway for reporting.

Edit 1 : the package was also updated (in head) to the latest upstream release (v1.4.2), as you suggested.

Edit 2 : just noticed the package was updated upstream (v1.4.3).

(Last edited by Nico on 1 Sep 2005, 18:31)

The discussion might have continued from here.