溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

RHEL7源碼安裝Apache服務(wù)

發(fā)布時(shí)間:2020-08-10 02:57:54 來(lái)源:ITPUB博客 閱讀:179 作者:大雄45 欄目:軟件技術(shù)
導(dǎo)讀 Apache 是世界使用排名第一的 Web 服務(wù)器軟件。它可以運(yùn)行在幾乎所有廣泛使用的計(jì)算機(jī)平臺(tái)上,由于其跨平臺(tái)和安全性被廣泛使用,是最流行的 Web 服務(wù)器端軟件之一。

RHEL7源碼安裝Apache服務(wù)

下載安裝包
[root@chao tools]# wget https://mirror.bit.edu.cn/apache/httpd/httpd-2.4.43.tar.gz
--2020-05-28 15:28:00--  https://mirror.bit.edu.cn/apache/httpd/httpd-2.4.43.tar.gz
正在解析主機(jī) mirror.bit.edu.cn (mirror.bit.edu.cn)... 202.204.80.77, 219.143.204.117, 2001:da8:204:1205::22
正在連接 mirror.bit.edu.cn (mirror.bit.edu.cn)|202.204.80.77|:443... 已連接。
已發(fā)出 HTTP 請(qǐng)求,正在等待回應(yīng)... 200 OK
長(zhǎng)度:9348230 (8.9M) [application/octet-stream]
正在保存至: “httpd-2.4.43.tar.gz”
100%[=========================================================================================================>] 9,348,230    204KB/s 用時(shí) 51s    
2020-05-28 15:28:57 (180 KB/s) - 已保存 “httpd-2.4.43.tar.gz” [9348230/9348230])
[root@chao tools]# ls
httpd-2.4.43.tar.gz
安裝依賴組件
[root@chao yum.repos.d]# yum install apr apr-util apr-devel apr-util-devel pcre pcre-devel
已加載插件:fastestmirror, langpacks
123                                                                                                                         | 3.6 kB  00:00:00     
Loading mirror speeds from cached hostfile
正在解決依賴關(guān)系
--> 正在檢查事務(wù)
---> 軟件包 apr.x86_64.0.1.4.8-3.el7 將被 安裝
---> 軟件包 apr-devel.x86_64.0.1.4.8-3.el7 將被 安裝
---> 軟件包 apr-util.x86_64.0.1.5.2-6.el7 將被 安裝
---> 軟件包 apr-util-devel.x86_64.0.1.5.2-6.el7 將被 安裝
--> 正在處理依賴關(guān)系 openldap-devel(x86-64),它被軟件包 apr-util-devel-1.5.2-6.el7.x86_64 需要
--> 正在處理依賴關(guān)系 libdb-devel(x86-64),它被軟件包 apr-util-devel-1.5.2-6.el7.x86_64 需要
--> 正在處理依賴關(guān)系 expat-devel(x86-64),它被軟件包 apr-util-devel-1.5.2-6.el7.x86_64 需要
--> 正在檢查事務(wù)
---> 軟件包 expat-devel.x86_64.0.2.1.0-10.el7_3 將被 安裝
---> 軟件包 libdb-devel.x86_64.0.5.3.21-20.el7 將被 安裝
---> 軟件包 openldap-devel.x86_64.0.2.4.44-5.el7 將被 安裝
--> 正在處理依賴關(guān)系 cyrus-sasl-devel(x86-64),它被軟件包 openldap-devel-2.4.44-5.el7.x86_64 需要
--> 正在檢查事務(wù)
---> 軟件包 cyrus-sasl-devel.x86_64.0.2.1.26-21.el7 將被 安裝
--> 解決依賴關(guān)系完成
......
安裝編譯環(huán)境
[root@chao httpd-2.4.43]# yum install -y gcc gcc-cc c++
已加載插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
沒(méi)有可用軟件包 gcc-cc。
沒(méi)有可用軟件包 c++。
正在解決依賴關(guān)系
--> 正在檢查事務(wù)
---> 軟件包 gcc.x86_64.0.4.8.5-16.el7 將被 安裝
--> 正在處理依賴關(guān)系 cpp = 4.8.5-16.el7,它被軟件包 gcc-4.8.5-16.el7.x86_64 需要
......
編譯安裝
[root@chao tools]# ls
httpd-2.4.43.tar.gz
[root@chao tools]# tar xf httpd-2.4.43.tar.gz 
[root@chao tools]# ls
httpd-2.4.43  httpd-2.4.43.tar.gz
[root@chao tools]# cd httpd-2.4.43/
[root@chao httpd-2.4.43]# ./configure --prefix=/usr/local/apache2 --enable-rewrite --enable-so
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to "  -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
......
config.status: creating include/ap_config_auto.h
config.status: executing default commands
configure: summary of build options:
    Server Version: 2.4.43
    Install prefix: /usr/local/apache2
    C compiler:     gcc -std=gnu99
    CFLAGS:           -pthread  
    CPPFLAGS:        -DLINUX -D_REENTRANT -D_GNU_SOURCE  
    LDFLAGS:           
    LIBS:             
    C preprocessor: gcc -E

執(zhí)行make

[root@chao httpd-2.4.43]# make

執(zhí)行make install

[root@chao httpd-2.4.43]# make install
開(kāi)放防火墻端口
[root@chao ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent 
success
[root@chao ~]# firewall-cmd --reload 
success
開(kāi)啟apache服務(wù)
[root@chao ~]# /usr/local/apache2/bin/apachectl start
測(cè)試

RHEL7源碼安裝Apache服務(wù)

本文原創(chuàng)地址: https://www.linuxprobe.com/rhel-apache.html

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI