lighttpd에 대해 스터디를 해보겠다고 말한지 오랜 시간이 흘렀다.

간단히 초기화면 호출 정도만 하고 중지되었던 lighttpd.

그런데 OS X에 구성해야 하는 작업이 발생하여 옛 기억을 더듬더 보았다. 그리고 리눅스는 아니지만 어차피 큰 어려움을 없을 것이라 생각하였다. 이론적으로는 당연히..

무작정 1.4.35 버전을 받고는 --prefix 옵션만으로 컴파일을 시도하였다. 그러나.

checking for library containing hstrerror... none required
checking for library containing dlopen... none required
checking for dlfcn.h... (cached) yes
checking for valgrind... no
checking for OpenSSL... no
checking for perl regular expressions support... yes
checking for pcre-config... no
configure: error: pcre-config not found, install the pcre-devel package or build with --without-pcre
$ 

과거 종종 우리를 괴롭혔던 pcre 관련 오류가 발생하였다.

pcre-config not found 라고 하니 아마 pcre 를 설치하면 생기는 pcre-config 가 PATH 에 잡혀있으면 되지 않을까 싶은데 그래서 우선 pcre 를  설치하려고 pcre 홈페이지에 방문해보니 pcre2 가 나왔다. 신상인 것 같아 pcre2 를 받아서 설치하고 생성된 pcre2-config 를 /usr/local 에 링크하였다.

$ sudo ln -sf /app/pcre2/10.00/bin/pcre2-config pcre-config

lighttpd는 pcre-config를 찾았으니까 난 친절히 pcre2-config를 pcre-config로 링크하였다.

그리고 예상대로 configure 과정은 무사히 넘어갔다. 그리고 make, 그런데.

In file included from log.c:1:
In file included from ./base.h:24:
./array.h:9:11: fatal error: 'pcre.h' file not found
# include <pcre.h>
          ^
1 error generated.
make[3]: *** [liblightcomp_la-log.lo] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
$

pcre.h를 찾을 수 없다고 한다. 그래서 pcre.h를 찾아보니 pcre2 소스 내에 존재하고 있다. 그리고 이후 꽤 오랜 사투가 진행되었다. 그 과정은 더 자세히 설명하지 않으려고 한다.

결론적으로는 pcre2가 아닌 pcre를 설치하면 된다. pcre 설치 후 pcre-config를 /usr/local에 링크 잡아주고 lighttpd의 컴파일을 진행하면 오류없이 설치가 가능하다.

* 본인은 해보지 않았지만 brew install pcre를 한다면 더욱 쉽게 되긴 할 것이다.