Debian:从源码安装Apache

先安装一些依赖的库:

aptitude  install build-essential
apt-get install libapr1-dev libaprutil1-dev

然后安装Zlib和Apache。现在Zlib最新的版本为 1.2.8 ,Apache的最新稳定版为:2.4.9


wget http://zlib.net/zlib-1.2.8.tar.gz
tar -zxf zlib-1.2.8.tar.gz
cd zlib-1.2.8/
./configure --prefix=/usr/local
make && make install



wget http://www.apache.org/dist/httpd/httpd-2.4.9.tar.gz
tar -zxf httpd-2.4.9.tar.gz
cd httpd-2.4.9/
./configure  --prefix=/usr/local/apache --enable-mods-shared=most --enable-ssl=shared --with-ssl=/usr/local
make && make install

启动Apache服务:


ln -s /usr/local/apache/bin/apachectl /usr/local/bin
ln -s /usr/local/apache/bin/httpd /usr/local/bin


然后就可以执行下面三个命令了:

apachectl -k start
apachectl -k stop
apachectl -k restart

设置Apache服务开机自启动:

ln -s /usr/local/apache/bin/apachectl /etc/init.d/
update-rc.d apachectl defaults



你可能感兴趣的:(Linux,Unix/Linux)