手动编译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-utils-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><h1>It works!</h1></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. VadRoot枚举进程模块在Windows7下的完整实现
  2. string中Insert与Format效率对比、String与List中Contains与IndexOf的效率对比
  3. linux中的权限对于文件和目录的重要性
  4. SSH连接超时不自动断开
  5. 简单MVC项目搭建--Java1.7+Eclipse luna + Maven 3.2.5 +spring 4.1.4
  6. PHPcms 系统简单使用
  7. Linux下的C编程实战
  8. POJ 1456(贪心)
  9. python函数和常用模块(二),Day4
  10. web.xml中配置固定数据
  11. 39.Android版本小知识
  12. JAVA深复制(深克隆)与浅复制(浅克隆)
  13. 空格&amp;amp;nbsp在不同浏览器中显示距离不一致问题解决方法
  14. 在VS2010下开发C语言程序
  15. webconfig 初认识
  16. Topo软件
  17. CSS Filter
  18. 从PCI上读取数据 线程和定时器效率
  19. Akka-CQRS(5)- CQRS Writer Actor 部署和测试
  20. bzoj 5099: [POI2018]Pionek

热门文章

  1. 为什么那么多自学JAVA的后来都放弃了?总结起来就这些原因
  2. 程序员成长的四个简单技巧,你 get 了吗?
  3. Mysql数据类型最细讲解
  4. MyCat教程二:mysql主从复制实现
  5. 你不知道的Canvas(一)
  6. 《Java并发编程实战》读书笔记-第4章 对象的组合
  7. HDU 3873 Invade the Mars(带限制条件的Dijkstra)
  8. &lt;学会提问-批判性思维指南&gt;运用
  9. [UWP]使用GetAlphaMask制作阴影
  10. Fiddler抓包工具的基本操作