debian 5 源码编译安装 lighttpd

下载lighttpd,指定压缩包存放目录:

wget -p /opt http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.35.tar.gz


新建一个目录,用于存放解压缩的源码:

mkdir /usr/local/lighttpd


解压缩源码:

tar -xvf /opt/lighttpd-1.4.35.tar.gz -C /usr/local/lighttpd

cd /usr/local/lighttpd/lighttpd-1.4.35


在源码目录直接执行配置文件,同时指定安装目录:

./configure --prefix=/usr/local/lighttpd


出错:

checking whether make supports nested variables... no

checking whether UID '0' is supported by ustar format... yes

checking whether GID '0' is supported by ustar format... yes

checking how to create a ustar tar archive... gnutar

checking whether make supports nested variables... (cached) no

checking for gcc... no

checking for cc... no

checking for cl.exe... no

configure: error: in `/root/download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.35':

configure: error: no acceptable C compiler found in $PATH

See `config.log' for more details


提示没有gcc

安装gcc:

apt-get install gcc

完成后再次执行./configure --prefix=/usr/local/lighttpd


又出错:

checking for library containing dlopen... -ldl

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

下载:

wget http://ncu.dl.sourceforge.net/project/pcre/pcre/7.7/pcre-7.7.tar.gz

加压和安装pcre出错

libtool: ignoring unknown tag CXX

libtool: unrecognized option `-DHAVE_CONFIG_H'

Try `libtool --help' for more information.

make[1]: *** [pcrecpp.lo] Error 1

make[1]: Leaving directory `/root/pcre-7.7'

make: *** [all] Error 2


其实是没有编c++译器,安装c++编译器:

apt-get install libtool

apt-get install g++


再次执行./configure --prefix=/usr/local/lighttpd

其实还是提示这个错误

checking for library containing dlopen... -ldl

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了,但还是not found! 前面的OpenSSL 的检查也是no

我一直在找openssl的依赖包

aptitude search openssl

aptitude search zlib

等等,折腾了很久

中途还重启过


最后的解决办法是

debian:lighttpd-1.4.35#PATH=/usr/local/pcre/bin/:$PATH

其实echo $PATH可以看到系统默认的环境变量是没有/usr/local/pcre的

这是我自己安装pcre的时候指定的pcre安装路径


所以我也不确定前面安装了很多依赖包有没有用上,因为网上也有说确实依赖包什么的


教训!


写的很糟糕,很晚了,明天还要上班。加油!




你可能感兴趣的:(Debian,lighttpd,5,源码编译安装)