您好,登錄后才能下訂單哦!
手動編譯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
[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 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
免責(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)容。