Apache httpd 2.4 源代码安装
 
 
这里选用Apache2.4版本。
Apache2.4依赖包:
pcre-8.42.tar.gz    下载:wget https://ftp.pcre.org/pub/pcre/pcre-8.42.tar.gz
 
安装apr:
#tar -zxvf apr-1.46.tar.gz
#cd apr-1.46
#./configure --prefix=/usr/local/apr
#make
#make install
 
安装apr-util:
#tar -zxvf apr-util-1.5.1.tar.gz
#cd apr-util-1.5.1
#./configure --with-apr=/usr/local/apr
#make
#make install
问题:
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
yum install expat-devel
 
安装pcre:
#tar -zxvf pcre-8.32.tar.gz
#cd  pcre-8.32
#./configure --prefix=/usr/local/pcre(此处出现configure: error: You need a C++ compiler for C++ support
#sudo yum install gcc-c++)
#make
#make install
 
安装apache2.4:
#tar -zxvf httpd-2.4.37.tar.gz
#cd httpd-2.4.37
#./configure --prefix=/usr/local/apache24 --enable-so --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr/ --with-pcre=/usr/local/pcre/
#make
#make install
 
问题:
configure: error: Did not find pcre-config script at /usr/local/pcre/
在./configure 时添加 --with-pcre=/usr/local/pcre/bin/pcre-config
 
cannot find -lexpat
一般出现 cannot find -l****, 是因为相应的 相应为库有问题,所以要安装该库 或者 更新版本。
yum install -y expat*
 
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_GetErrorCode'
原因:该错误是因为缺少了xml相关的库,导致reference无效
解决方法:
①安装libxml2-devel
[root@test_01 ~]# yum install -y libxml2-devel
②删除apr-util目录并且重新编译安装
③重新编译安装httpd,成功解决。
 
配置文件:
问题:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
 
vim /usr/local/apache/conf/httpd.conf
在“#ServerName www.example.com:80”下面添加一行如下:
ServerName localhost:80
 
启动服务:
usr/local/apache/bin/apachectl start
浏览器输入localhost,显示"It works!"
 
(
注:实体机不能访问虚拟机web服务器,可以输入 
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
service iptables save
service iptables restart
(将此处的80改为自己的web服务器的端口号)
)
firewall-cmd --zone=public --add-port=80/tcp  --permanent
systemctl restart firewalld.service
firewall-cmd --reload
firewall-cmd --list-ports
 
firewall-cmd --remove-posr=8080/tcp

CentOS7 下源代码安装apache2.4的更多相关文章

  1. CentOS7 下源代码安装php7

    安装PHP7: php-7.1.2.tar.gz:下载:wget http://cn2.php.net/get/php-7.1.2.tar.gz/from/this/mirror 安装php: # t ...

  2. 在Centos7下源代码安装配置Nginx

    1.安装前准备开发环境安装pcre开发包:yum install -y pcre-devel 安装编译源码所需的工具和库:yum install gcc gcc-c++ ncurses-devel p ...

  3. CentOS7 下源代码安装mysql5.6

    ###### mysql ######### 引言:这里选用mysql5.6版本,5.7版本编译时间需要几个小时. 编译安装环境: yum -y install make gcc-c++ cmake ...

  4. EnvironmentError: mysql_config not found问题解决(centos7下python安装mysql-python)

    centos7下python安装mysql-python模块,执行命令: pip install mysql-python 出现报错:EnvironmentError: mysql_config no ...

  5. centos7下编译安装php-7.0.15(PHP-FPM)

    centos7下编译安装php-7.0.15(PHP-FPM) 一.下载php7源码包 http://php.net/downloads.php 如:php-7.0.15.tar.gz 二.安装所需依 ...

  6. Centos7下快速安装Mongo3.2

    Centos7下快速安装Mongo3.2 一般安装Mongo推荐源码安装,有时候为了快部署测试环境,或者仅仅是想装个mongo shell,这时候yum安装是最合适的方式, 下面介绍一下如何在Cent ...

  7. Ubuntu 16.04下编译安装Apache2.4和PHP7结合

    Ubuntu 16.04下编译安装Apache2.4和PHP7结合,并安装PDOmysql扩展. 1.编译安装apache2.4.20 1 第一步: ./configure --prefix=/usr ...

  8. 19.CentOS7下PostgreSQL安装过程

    CentOS7下PostgreSQL安装过程 装包 sudo yum install postgresql-server postgresql-contrib 说明: 这种方式直接明了,其他方法也可以 ...

  9. centos7 下 yum 安装Nginx

    centos7 下 yum 安装和配置 Nginx 添加yum源 Nginx不在默认的yum源中,可以使用epel或者官网的yum源,这里使用官网的yum源 rpm -ivh http://nginx ...

随机推荐

  1. 【Finchley】【升级变更】Spring Cloud 升级到Finchley版本后需要注意的地方

    Spring Boot 2.x 已经发布了很久,现在 Spring Cloud 也发布了 基于 Spring Boot 2.x 的 Finchley 版本,现在一起为项目做一次整体框架升级. 升级前 ...

  2. LuoguP3792 由乃与大母神原型和偶像崇拜

    题目地址 题目链接 题解 由乃题还是毒瘤啊orz 显然的一个结论是,如果保证不重复,维护区间min,max然后判断max-min+1==r-l+1是否成立即可 但是有重复 于是就要orz题解区的各位大 ...

  3. P2604 [ZJOI2010]网络扩容

    思路 简单的费用流问题,跑出第一问后在残量网络上加边求最小费用即可 代码 #include <cstdio> #include <algorithm> #include < ...

  4. Java基础 【类之间的关系】

    在Java与其他面向对象设计语言中,类之间常见的关系有6种 分别是:  依赖.关联.聚合.组合.继承.实现,他们的耦合度依次增强. 其中,关联.聚合.组合关系仅仅是在语义上有所区别,所谓语义就是指上下 ...

  5. forEach、map、filter、find、sort、some等易错点整理

    一.常用方法解析   说起数组操作,我们肯定第一反应就是想到forEach().map().filter()等方法,下面分别阐述一下各方法的优劣. 1.forEach 1.1 基础点   forEac ...

  6. Codeforces 729E Subordinates

    题目链接:http://codeforces.com/problemset/problem/729/E 既然每一个人都有一个顶头上司,考虑一个问题: 如果这些人中具有上司数目最多的人有$x$个上司,那 ...

  7. mysql索引使用

    原文:http://www.jianshu.com/p/2b541c028157 索引是快速搜索的关键.MySQL索引的建立对于MySQL的高效运行是很重要的.下面介绍几种常见的MySQL索引类型.在 ...

  8. java进程占用系统内存高,排查解决

    转自:http://blog.51cto.com/chengxiaobai/2052530?cid=695076 故障:最近收到生产服务器的报警短信以及邮件,报警内容为:内存使用率高于70%. 使用t ...

  9. ros topic 发布一次可能会接收不到数据

    rostopic pub - /hdw_update hdw_driver/update_file_msg A B C D 系统提示: publishing and latching message ...

  10. Linux下解包/打包,压缩/解压命令

    .tar 解包:tar xvf FileName.tar 打包:tar cvf fileName.tar DirName tar.gz和.tgz 解压:tar zxvf FileName.tar.zi ...