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. Flutter学习指南:UI布局和控件

    Flutter学习指南:UI布局和控件 - IT程序猿  https://www.itcodemonkey.com/article/11041.html

  2. 差分数组|小a的轰炸游戏-牛客317E

    小a的轰炸游戏 题目链接:https://ac.nowcoder.com/acm/contest/317/E 思路  这题考查的是对差分数组原理和前缀和的理解. 四个数组分别记录朝着四个方向下放的个数 ...

  3. SQLServer2014 安装错误:等待数据库引擎恢复句柄失败

    查了很多资料最后靠百度百科里的一票报道彻底解决困难.在次发表一下以便给后人排忧解难 已下为百度连接 https://jingyan.baidu.com/article/7908e85cb24c19af ...

  4. (转载)WinformGDI+入门级实例——扫雷游戏(附源码)

    本文将作为一个入门级的.结合源码的文章,旨在为刚刚接触GDI+编程或对相关知识感兴趣的读者做一个入门讲解.游戏尚且未完善,但基本功能都有,完整源码在文章结尾的附件中. 整体思路: 扫雷的游戏界面让我从 ...

  5. cron,linux定时脚本

    Linux的cron和crontab Cron定时执行工具详解 Linux下的crontab定时执行任务命令详解 Linux上启动Cron任务 [linux]解析crontab cron表达式详解 c ...

  6. Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'zoneId' in 'class java.lang.String'

    本文为博主原创,未经允许不得而转载: 异常展示: dao层定义的接口为: public int getClientTotal(); 在mybatis中的sql为: <select id=&quo ...

  7. 接口自动化python

    !/usr/bin/env python coding=utf-8 Todo:接口自动化测试 Author:归根落叶 Blog:http://this.ispenn.com import json i ...

  8. 【Python】【进程&线程】

    #[[进程 和 线程 ]] """ # [多进程]'''import os print ('Process (%s) start...' % os.getpid()) # ...

  9. 读书笔记《Spring Boot实战 —— Java EE 开发的颠覆者》

    Spring框架是轻量级的企业级开发一站式解决方案 Spring使用简单的POJO Plain Old Java Object 无限制的普通Java对象 Spring Framework Runtim ...

  10. Eclispe中编辑xml配置文件时不会提示也不能自动调整格式

    创建了一个xml文件后,发现编辑起来和原来的那些有所不同,不会提示补全.也不能自动调整格式???woc? 哈哈哈哈哈,“我最恨你像个石头一样” 后来发现是编辑器被改了!!! 右键xml文件然后open ...