源代碼安裝軟件
0》下載軟件安裝包 wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.29.tar.gz
解壓壓縮包 tar zxvf httpd-2.4.29.tar.gz
1》生成配置文件
cd httpd-2.4.29
./configure --prefix=/usr/local/apache2
2》編譯
make
3》安裝
make install
4》啟動(dòng)服務(wù) /usr/local/apache2/apachectl start
設(shè)置開(kāi)機(jī)自啟動(dòng) vi /etc/rc.d/rc.local 在最后一行加入 /usr/local/apache2/bin/apachectl start
關(guān)閉防火墻 service iptables stop
5》查看80端口 netstat -tunpl |grep httpd
查看apache進(jìn)程是否運(yùn)行究抓,ps -ef |grep httpd
6》卸載源代碼安裝的軟件婿滓,rm -rf /usr/local/apache2
#./configure --prefix……檢查編輯環(huán)境時(shí)出現(xiàn):
checking for APR... no
configure: error: APR not found . Please read the documentation
1》下載apr框往、apr-util、pcre源代碼包
wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
wget https://ftp.pcre.org/pub/pcre/pcre-8.10.tar.gz
2》卸載yum安裝的apr腊状、apr-util查乒、pcre
yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs
3》安裝apr,解決apr not found問(wèn)題
[root@xt test]# tar -zxf apr-1.4.5.tar.gz
[root@xt test]# cd apr-1.4.5
[root@xt apr-1.4.5]# ./configure --prefix=/usr/local/apr
[root@xt apr-1.4.5]# make && make install
4》安裝apr-util谬泌,解決apr-util not found問(wèn)題
[root@xt test]# tar -zxf apr-util-1.3.12.tar.gz
[root@xt test]# cd apr-util-1.3.12
[root@xt apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
[root@xt apr-util-1.3.12]# make && make install
5》解決pcre問(wèn)題
[root@xt test]#tar -zxvf pcre-8.10.tar.gz
[root@xt test]#cd pcre-8.10
[root@xt pcre-8.10]#./configure --prefix=/usr/local/pcre
[root@xt pcre-8.10]#make && make install
6》再次安裝apache
[root@xt test]#cd httpd-2.4.29
[root@xt test]#./configure --prefix=/usr/local/apache2 \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util/ \
--with-pcre=/usr/local/pcre
7》源代碼安裝apache佳簸,網(wǎng)站根目錄位置 /usr/local/apache2/htdocs乙墙,apache配置文件 /usr/local/apache2/conf/httpd.conf,apache應(yīng)用程序 /usr/local/apache2/bin/apachectl
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者