linux下apache源碼安裝

[root@localhostapache]# cd /home/apache/解壓:[root@localhostapache]# tar zxvf httpd-2.4.18編譯安裝:[root@localhostapache]#yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs安裝apr依賴:[root@localhostapache]# tar zxvf apr-1.4.5.tar.gz[root@localhostapache]# cd apr-1.4.5[root@localhostapr-1.4.5]# ./configure --prefix=/usr/local/apr[root@localhostapr-1.4.5]#make && make install[root@localhostapr-1.4.5]cd ../安裝util依賴:[root@localhostapache]# tar zxvf? apr-util-1.3.12.tar.gz[root@localhostapache]# cd apr-util-1.3.12[root@localhostapr-util-1.3.12]#? ./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config[root@localhostapr-util-1.3.12]# make && make install[root@localhostapr-util-1.3.12]# cd ../安裝pcre依賴:[root@localhostapache]# unzip -o pcre-8.10.zip[root@localhostapache]# cd pcre-8.10[root@localhostpcre-8.10]# ./configure --prefix=/usr/local/pcre[root@localhostpcre-8.10]# make && make install[root@localhostpcre-8.10]# cd ../httpd-2.4.18[root@localhosthttpd-2.4.18]# ./configure? --prefix=/usr/local/apache? --enable-so --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ -with-pcre=/usr/local/pcre[root@localhosthttpd-2.4.18]#make[root@localhosthttpd-2.4.18]#make install進(jìn)入apache的目錄:[root@localhosthttpd-2.4.18]#cd /usr/local/apache[root@localhostapache]#? cd conf/備份apache配置文件:[root@localhostconf]#cp -a httpd.conf httpd.conf-查看httpd服務(wù)是否已存在:[root@localhostconf]#chkconfig? --list httpd關(guān)閉系統(tǒng)自帶了httpd的服務(wù),如果存在httpd服務(wù):[root@localhostconf]#chkconfig httpd off查看自帶httpd服務(wù)狀態(tài):? [root@localhostconf]#service httpd statuslinux啟動(dòng)apache命令:[root@localhostconf]#/usr/local/apache/bin/apachectl -k start查看linux80端口是否開(kāi)啟:? ? ? ? ? ? ? ? [root@localhostconf]#netstat -an | grep :80linux下查看apache進(jìn)程:? ? [root@localhostconf]#ps -aux | grep httpd[root@localhostconf]#cd ../..拷貝apache啟動(dòng)腳本:[root@localhostlocal]#cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apache這里是編輯apache啟動(dòng)腳本[root@localhostlocal]#vi /etc/rc.d/init.d/apache在開(kāi)頭的#!/bin/sh? 下面加上#chkconfig: 2345? 85? 15添加apache服務(wù):[root@localhostlocal]#chkconfig --add apache列出apache服務(wù):? [root@localhostlocal]#chkconfig --list apache停止apache服務(wù):? ? [root@localhostlocal]#service apache stop查看linux的80端口是否關(guān)閉:[root@localhostlocal]#netstat -an | grep :80查看是否存在httpd服務(wù),若果之前自帶httpd服務(wù)啟動(dòng)的話會(huì)導(dǎo)致新添加的apache服務(wù)啟動(dòng)失敗:? ? [root@localhostlocal]#ps -aux | grep httpd啟動(dòng)apache服務(wù):[root@localhostlocal]#service apache start

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 一、LAMP環(huán)境的介紹 1.LAMP環(huán)境的重要性 思索許久,最終還是決定寫(xiě)一篇詳細(xì)的LAMP的源碼編譯安裝的實(shí)驗(yàn)文...
    endmoon閱讀 2,889評(píng)論 4 26
  • 一、Nagios簡(jiǎn)介 Nagios是一款開(kāi)源的電腦系統(tǒng)和網(wǎng)絡(luò)監(jiān)視工具,能有效監(jiān)控Windows、Linux和Uni...
    1b3bd36d9d21閱讀 8,399評(píng)論 3 13
  • 1、確認(rèn)搭建LAMP所需的環(huán)境是否已經(jīng)安裝: [root@localhost ~]#rpm -q make gcc...
    4e855d444c9f閱讀 543評(píng)論 0 0
  • ```` linux版本:centos7.2 php版本 :5.6.30 mysql版本:5.6.17 nginx...
    銭兎孑閱讀 1,228評(píng)論 0 2
  • “30歲”,我曾用漫長(zhǎng)的歲月來(lái)抵抗它,夾雜著又用了無(wú)數(shù)的迷糊來(lái)回避它。 直到歲月臨近——如果30歲真的會(huì)是一場(chǎng)一個(gè)...
    陳不靈閱讀 551評(píng)論 1 0

友情鏈接更多精彩內(nèi)容