1. 程式人生 > >Linux9.3 Apache安裝

Linux9.3 Apache安裝

ble 移植 clas apr-util apach ref 5.4 apr www

Apache是一個基金會的名字,httpd才是我們要安裝的軟件包,早期它的名字就叫apache
Apache官網www.apache.org


wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.26.tar.gz
wget http://mirrors.hust.edu.cn/apache/apr/apr-1.5.2.tar.gz
wget http://mirrors.hust.edu.cn/apache/apr/apr-util-1.5.4.tar.gz

apr和apr-util是一個通用的函數庫,它讓httpd可以不關心底層的操作系統平臺,可以很方便地移植(從linux移植到windows),2.4依賴apr。區別在於apr


tar zxvf httpd-2.4.26.tar.gz
tar zxvf apr-util-1.5.4.tar.gz
tar zxvf apr-1.5.2.tar.gz
cd /usr/local/src/apr-1.5.2
./configure --prefix=/usr/local/apr
make && make install

可以自定義模塊安裝

cd /usr/local/src/apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install

cd /usr/local/src/httpd-2.4.27
./configure \ //這裏的反斜杠是脫義字符,加上它我們可以把一行命令寫成多行
--prefix=/usr/local/apache2.4 \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--enable-so \
--enable-mods-shared=most
make && make install

查看所有模塊
ls /usr/local/apache2.4/modules
/usr/local/apache2.4/bin/httpd -M //查看加載的模塊

Linux9.3 Apache安裝