1. 程式人生 > >源碼安裝apache 2.4.29

源碼安裝apache 2.4.29

apache 2.4.29

安裝 apr apr-until prce 安裝apache的依賴程序。
https://www.cnblogs.com/visec479/p/5160297.html

[root@Office-test-007113 tools]# wget http://mirrors.shu.edu.cn/apache/httpd/httpd-2.4.29.tar.gz 下載apache軟件包
[root@Office-test-007113 tools]# mkdir -p /application/apache2.4.29
[root@Office-test-007113 tools]#tar -zxvf httpd-2.4.29.tar.gz

[root@Office-test-007113 tools]# cd httpd-2.4.29
[root@Office-test-007113 httpd-2.4.29]# ./configure \
--prefix=/application/apache2.4.29 \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util/ \
--with-pcre=/usr/local/pcre \
--enable-deflate \
--enable-expires \
--enable-headers \
--enable-modules=most \
--enable-so \
--with-mpm=worker \
--enable-rewrite

[root@Office-test-007113 httpd-2.4.29]#make 編譯
[root@Office-test-007113 httpd-2.4.29]#make install 安裝
[root@Office-test-007113 httpd-2.4.29]# cd /application/ 切換目錄

[root@Office-test-007113 application]# ln -s /application/apache2.4.29/ /application/apache 添加軟連接

[root@Office-test-007113 application]# ll /application/
total 4
lrwxrwxrwx. 1 root root 25 Apr 3 21:24 apache -> /application/apache2.4.29
drwxr-xr-x. 14 root root 4096 Apr 3 21:34 apache2.4.29
[root@Office-test-007113 application]#
[root@Office-test-007113 application]# /application/apache/bin/apachectl start 啟動apache
[root@Office-test-007113 application]# ps -ef |grep http 檢查apache的啟動
root 32129 1 0 21:29 ? 00:00:00 /application/apache2.4.29/bin/httpd -k start
daemon 32130 32129 0 21:29 ? 00:00:00 /application/apache2.4.29/bin/httpd -k start
daemon 32131 32129 0 21:29 ? 00:00:00 /application/apache2.4.29/bin/httpd -k start
daemon 32132 32129 0 21:29 ? 00:00:00 /application/apache2.4.29/bin/httpd -k start
root 32233 1207 0 21:35 pts/0 00:00:00 grep http
[root@Office-test-007113 application]# /etc/init.d/iptables stop 關閉防火墻,用瀏覽器訪問電腦,看是否可以訪問。
[root@Office-test-007113 application]#

源碼安裝apache 2.4.29