CentOS7.6手动编译httpd-2.4.25

发布时间:2020-08-03 04:41:48 作者:lkjwer
来源:网络 阅读:158

手动编译httpd-2.4.25
系统:CentOS7.1810

httpd:2.4.25

编译时报错解决技巧:报什么错,就装这个错误的devel,比如报http2错误,就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
五、根据Makefile,构建应用程序
[root@imooc-nginx httpd-2.4.25]# make

make -j 2 #可以多线程编译,根据CPU个数写

六、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
八、测试访问
主页内容:/apps/httpd24/htdocs/index.html

root@ubutnu:~# curl -q http://172.18.145.106
<html><body><h2>It works!</h2></body></html>
九、让httpd开机自启
[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

推荐阅读:
  1. CentOS7.6系统目录
  2. CentOS7.6安装jdk1.8

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

http dyum linux ce tos

上一篇:AttributeError: 'baiduPage' object has no attribute '_testMethodDoc'

下一篇:oracle常规操作

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》