1. 程式人生 > >安裝apache2.4.27筆記

安裝apache2.4.27筆記

httpd apache

編譯安裝遇到太多問題,記錄幾點遇到的坑

系統centos 7.3 http版本2.4.27


1.安裝apr、apr-util

./configure --prefix=/usr/local/apr
make
makeinstall
./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr/ 
make  
make install

./configure --prefix=/usr/local/apr-util-httpd/

--with-apr=/usr/local/apr-httpd/

make

make instal

apr

/

apr-util

apr

/

apr-util

2.安裝apache

 ./configure --prefix=/etc/httpd/ --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/


對apache進行make的時候報錯如下:

make[2]: *** [htpasswd] Error 1make[2]: Leaving directory `/usr/local/directadmin/custombuild/httpd-2.0.63/support‘make[1]: *** [all-recursive] Error 1make[1]: Leaving directory `/usr/local/directadmin/custombuild/httpd-2.0.63/support‘make: *** [all-recursive] Error 1
把 apr、aprutil的目錄copy到httpd的目錄下
cp -r apr-1.6.2 /opt/httpd-2.4.27/srclib/apr
cp -r apr-util-1.6.0 /opt/httpd-2.4.27/srclib/apr-util
./configure --prefix=/etc/httpd/ --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-included-apr
make  
make install


3.將httpd添加為系統服務

cp /etc/httpd/bin/apachectl /etc/rc.d/init.d/httpd   
vi /etc/rc.d/init.d/httpd
# chkconfig: 345 85 15
# description: Activates/Deactivates Apache Web Server
註意:“#”也要有

添加自啟動

systemctl enable httpd

安裝apache2.4.27筆記