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. Spring-Cache 注解 @Cacheable,@CachePut , @CacheEvict

    1.自动生成key @Bean public KeyGenerator keyGenerator() { return new KeyGenerator() { @Override public Ob ...

  2. 【做题】Codeforces Round #429 (Div. 2) E. On the Bench——组合问题+dp

    题目大意是给你n个数,求相邻两数相乘不是完全平方数的排列数. 一开始看到这题的时候,本人便想给相乘为完全平方数的数对建边,然后就写萎了... 后来通过集体智慧发现这个重要性质:对于自然数a,b,c,若 ...

  3. 【系列教程1】Gradle入门系列一:简介

    Gradle是一种构建工具,它抛弃了基于XML的构建脚本,取而代之的是采用一种基于Groovy的内部领域特定语言.近期,Gradle获得了极大的关注. 这篇文章是Gradle教程的第一篇,我们有两个目 ...

  4. SSM到Spring Boot从零开发校园商铺平台

    项目目的 特别 由于准备春招,所以希望各位看客方便的话,能去github上面帮我Star一下项目 https://github.com/Draymonders/Campus-Shop emmm, 已经 ...

  5. WSL及Linux入门

    win10内置linux子系统(Windows Subsystem for Linux),可以不用安装Vmware等虚拟机学习linux啦. wsl开启方式 设置打开开发人员模式. 控制面板-程序和功 ...

  6. JavaI/O(输入/输出)

    File类 通过File类可以在程序中操作文件和目录,File能新建.删除.重命名文件和目录,但是不能访问文件内容本身. 理解I/O流 流(stream)是从起源(source)到接收(sink)的有 ...

  7. 第五个神奇的电梯(代码抢先看<1>)

    关于一些自认为比较独特的设计思路,也不知道是好还是坏,放在这里让大家一起看一下. 关于mian函数:因为采用了注册机制所以主函数比较简单. #include "stdafx.h" ...

  8. Latex: 使 tabular 居中

    参考: How to center the table in Latex Latex: 使 tabular 居中 解决方法1: { \centering \begin{tabular} ... \en ...

  9. Ubuntu14.04下 安装p4c

    参考: Github p4c README Ubuntu14.04下 安装p4c 这里提供一个直接安装p4c的脚本:install_p4c.sh. 1.git clone下来p4c: $ git cl ...

  10. HDU 1403 Longest Common Substring(最长公共子串)

    http://acm.hdu.edu.cn/showproblem.php?pid=1403 题意:给出两个字符串,求最长公共子串的长度. 思路: 刚开始学后缀数组,确实感觉很难,但是这东西很强大,所 ...