溫馨提示×

溫馨提示×

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

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

CentOS7.6手動編譯httpd-2.4.25

發(fā)布時(shí)間:2020-08-03 04:41:48 來源:網(wǎng)絡(luò) 閱讀:162 作者:lkjwer 欄目:系統(tǒng)運(yùn)維

手動編譯httpd-2.4.25
系統(tǒng):CentOS7.1810

httpd:2.4.25

編譯時(shí)報(bào)錯(cuò)解決技巧:報(bào)什么錯(cuò),就裝這個(gè)錯(cuò)誤的devel,比如報(bào)http2錯(cuò)誤,就yum search http2,找到libnghttp2-devel,然后yum install libnghttp2-devel再重新configure

配置EPEL源,有些包只有epel源有

[root@centos7 ~]# cat /etc/yum.repos.d/epel.repo
[epel]
name=aliyun epel
baseurl=https://mirrors.aliyun.com/epel/7/x86_64/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-7
enabled=1
一、下載地址:
https://www.lanzous.com/i5csh0h

http://archive.apache.org/dist/httpd/httpd-2.4.25.tar.bz2

二、安裝依賴
[root@imooc-nginx ~]# yum install gcc openssl-devel pcre-devel apr-devel apr-util-devel libnghttp2-devel ncurses-devel
三、解壓
[root@imooc-nginx ~]# bzip2 -d httpd-2.4.25.tar.bz2
[root@imooc-nginx ~]# tar xf httpd-2.4.25.tar
四、開始編譯
[root@imooc-nginx ~]# cd httpd-2.4.25/
[root@imooc-nginx httpd-2.4.25]# ./configure \
--prefix=/apps/httpd24 \
--sysconfdir=/etc/httpd \
--enable-http2 \
--disable-auth-basic \
--enable-ssl \
--enable-so
五、根據(jù)Makefile,構(gòu)建應(yīng)用程序
[root@imooc-nginx httpd-2.4.25]# make

make -j 2 #可以多線程編譯,根據(jù)CPU個(gè)數(shù)寫

六、make install

拷貝文件

[root@imooc-nginx httpd-2.4.25]# make install
七、啟動apache
可以考慮加PATH變量或做軟鏈接

[root@imooc-nginx httpd-2.4.25]# /apps/httpd24/bin/apachectl start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::20c:29ff:fe4d:5986. Set the 'ServerName' directive globally to suppress this message
八、測試訪問
主頁內(nèi)容:/apps/httpd24/htdocs/index.html

root@ubutnu:~# curl -q http://172.18.145.106
<html><body><h2>It works!</h2></body></html>
九、讓httpd開機(jī)自啟
[root@imooc-nginx httpd-2.4.25]# vim /etc/rc.d/rc.local
[root@imooc-nginx httpd-2.4.25]# tail -1 /etc/rc.d/rc.local
/apps/httpd24/bin/apachectl start
[root@imooc-nginx httpd-2.4.25]# chmod +x /etc/rc.d/rc.local

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

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

AI