CentOS 6.5编译安装httpd-2.4.7
CentOS 6.5编译安装httpd-2.4.7
CentOS 编译安装 Apache 2.4 准备:
[root@NFSServer ~]# yum groupinstall "Development tools"
从http://httpd.apache.org下载最新的httpd、apr、apr-util,然后解压缩
[root@NFSServer ~]# tar zxvf apr-1.5.0.tar.gz
[root@NFSServer ~]# tar zxvf apr-util-1.5.3.tar.gz
[root@NFSServer ~]# tar zxvf httpd-2.4.7.tar.gz
由于现在最新的httpd-2.4都需要apr、apr-util。
1.插入方法安装
[root@NFSServer ~]# mv apr-1.5.0 httpd-2.4.7/srclib/apr
[root@NFSServer ~]# mv apr-util-1.5.3 httpd-2.4.7/srclib/apr-util
[root@NFSServer ~]# cd httpd-2.4.7
[root@NFSServer httpd-2.4.7]# ./configure --prefix=/webserver/httpd --sysconfdir=/webserver/httpd/conf/ --with-inculded-apr --enable-so --enable-rewirte --enable-ssl --enable-cgi --enable-cgid --enable-modules=most --enable-mpms-shared=all
如果在编译中出现
1 configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
则是因为rewirte需要pcre-devel支持
[root@NFSServer httpd-2.4.7]# yum -y install pcre pcre-devel
再编译一下即可
编译完成后
[root@NFSServer httpd-2.4.7]# make && make install
2.一步一步安装
a.编译安装apr
[root@NFSServer ~]# cd apr-1.5.0
[root@NFSServer apr-1.5.0]# ./configure --prefix=/webserver/apr
[root@NFSServer apr-1.5.0]# make && make install
b.编译安装apr-util
[root@NFSServer ~]# apr-util-1.5.3
[root@NFSServer apr-util-1.5.3]# ./configure --prefix=/webserver/apr-util --with-apr=/webserver/apr
[root@NFSServer apr-util-1.5.3]# make && make install
c.编译安装httpd
[root@NFSServer ~]# cd httpd-2.4.7
[root@NFSServer httpd-2.4.7]# ./configure \
>--prefix=/webserver/httpd \
>--sysconfdir=/webserver/httpd/conf \
>--enable-so \
>--enable-rewirte \
>--enable-ssl \
>--enable-cgi \
>--enable-cgid \
>--enable-modules=most \
>--enable-modules-shared=most \
>--enable-mpms-shared=all \
>--with-apr=/webserver/apr \
>--with-apr-util=/webserver/apr-util
--prefix=/webserver/httpd :指定安装目标路径
--sysconfdir=/webserver/httpd/conf :指定配置文件安装位置
--enable-so :支持动态共享模块,如果没有这个模块PHP将无法与apache结合工作
--enable-rewirte :支持URL重写
--enable-ssl :启用支持ssl
--enable-cgi :启用支持cgi
--enable-cgid :启用支持带线状图形的CGI脚本 MPMs
--enable-modules=most :安装大多数模块
--enable-modules-shared=most :安装大多数共享模块
--enable-mpms-shared=all :支持全部多道处理方式
--with-apr=/webserver/apr :指定apr路径
--with-apr-util=/webserver/apr-util :指定apr-util路径
编译完成后
[root@NFSServer httpd-2.4.7]# make && make install
配置启动脚本:
[root@NFSServer httpd-2.4.7]# cp build/rpm/httpd.init /etc/init.d/httpd //使用init脚本管理httpd
[root@NFSServer httpd-2.4.7]# vim /etc/init.d/httpd
httpd=${HTTPD-/usr/sbin/httpd} 修改成 httpd=${HTTPD-/webserver/httpd/bin/httpd}
pidfile=${PIDFILE-/var/run/${prog}.pid} 修改成pidfile=${PIDFILE-/webserver/httpd/logs/${prog}.pid}
lockfile=${LOCKFILE-/var/lock/subsys/${prog}}
RETVAL=0
# check for 1.3 configuration
check13 () {
CONFFILE=/etc/httpd/conf/httpd.conf 修改成CONFFILE=/webserver/httpd/conf/httpd.conf
[root@NFSServer httpd-2.4.7]# chmod 755 /etc/init.d/httpd //增加执行权限
[root@NFSServer httpd-2.4.7]# chkconfig --add httpd //添加httpd到服务开机启动
root@NFSServer httpd-2.4.7]# cd /usr/sbin/
[root@NFSServer sbin]# ln -s /webserver/httpd/bin/* .
为日志文件创建软链接
[root@NFSServer sbin]# ln -s /webserver/httpd/logs /var/log/httpd
如果启动httpd的时候出现
Starting httpd: AH00557: httpd: apr_sockaddr_info_get() failed for NFSServer
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[ OK ]
则需要修改2处:
1.修改/etc/hosts,增加一行
127.0.0.1 NFServer
2.修改 /webserver/httpd/conf/httpd.conf,增加一行
ServerName NFSServer
注意:NFSServer为机器名称
更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14

CentOS 6.5编译安装httpd-2.4.7的更多相关文章
- CentOS 6.4源码编译安装httpd并启动测试
今天来总结一下在Linux中软件安装,通常我们应该知道,安装软件有两种方法:一种是软件包的安装,也就是rpm包的安装,就是指这些软件包都是 已经编译好的二进制rpm包,我们通过rpm安装工具和yum安 ...
- (转)CentOS 7.6 上编译安装httpd 2.4.38
原文:https://www.s4lm0x.com/archives/40.html https://www.cnblogs.com/sunshine-H/p/8110608.html----超详细 ...
- CentOS 6.8编译安装httpd2.2.31+MySQL5.6.31+PHP5.3.27
CentOS 6.8编译安装httpd2.2.31+MySQL5.6.31+PHP5.3.27 说明: 操作系统:CentOS 6.8 32位 准备篇: 一.系统约定 软件源代码包存放位 ...
- apache编译安装 httpd 2.2 httpd 2.4
#apache编译安装#httpd 2.2 , httpd 2.4 #!/bin/sh #apache编译安装 #httpd 2.2 , httpd 2.4 #centos #rpm -e httpd ...
- CentOS 6.4编译安装和部署Zabbix 2.0版本监控(中文)
[一].zabbix简介 zabbix是一个基于web界面的提供分布式系统监视以及网络监视功能的企业级开元解决方案 zabbix由2部分构成,zabbix_server和可选组件zabbix_agen ...
- CentOS 6.5 编译安装Apache2.4
一. httpd 2.4的新特 1) MPM支持运行时装载 --enable-mpms-shared=all --with-mpm=prefork|worker|event2) 支持event MPM ...
- CentOS 7.0编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14
准备篇: CentOS 7.0系统安装配置图解教程 http://www.osyunwei.com/archives/7829.html 一.配置防火墙,开启80端口.3306端口 CentOS 7. ...
- centos 7.0 编译安装php 7.0.3
php下载页面 http://cn2.php.net/downloads.php 7.0.3多地区下载页面 http://cn2.php.net/get/php-7.0.3.tar.gz/from/a ...
- CentOS 6.6编译安装Nginx1.6.2+MySQL5.6.21+PHP5.6.3
http://www.osyunwei.com/archives/8867.html 一.配置防火墙,开启80端口.3306端口 vi /etc/sysconfig/iptables #编辑防火墙配置 ...
- CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13
CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.132013-10-24 15:31:12标签:服务器 防火墙 file 配置文件 written 一.配置好I ...
随机推荐
- hbase报错ERROR: org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet 采坑记
1.错误异常信息: Exception in thread "main" java.lang.IllegalArgumentException: Failed to find me ...
- 开源短信项目 platform-sms 发布了新版本 0.5.0
Github : https://github.com/makemyownlife/platform-sms 短信服务 platform-sms 0.5.0 发布 ,新的版本做了非常多的优化和改进. ...
- C++ //常用查找算法 find //自定义类型需要重载 ==
1 //常用查找算法 find 2 #include<iostream> 3 #include<algorithm> 4 #include<functional> ...
- 从 HPC 到 AI:探索文件系统的发展及性能评估
随着 AI 技术的迅速发展,模型规模和复杂度以及待处理数据量都在急剧上升,这些趋势使得高性能计算(HPC)变得越来越必要.HPC 通过集成强大的计算资源,比如 GPU 和 CPU 集群,提供了处理和分 ...
- XAF Blazor FilterPanel 布局样式
从上一篇关于ListView布局样式的文章中,我们知道XAFBlazor是移动优先的,如果想在PC端有更好的用户体验,我们需要对布局样式进行修改.这篇介绍在之前文章中提到的FilterPanel,它的 ...
- Java中枚举配合switch语句用法-2022新项目
一.业务场景 项目开发中经常会遇到多条件判断的情况,如果判断条件少的话使用if/elseif/else还比较好处理,如果判断条件多的话,则在使用这种语句就不太合适. 如果是自定义的一些内容,比如不同的 ...
- shell脚本中将 IFS (Internal Field Separator 内部字段分隔符)替换为换行符
将 IFS 中的空白符(换行.制表符.空格)修改为仅包含换行 IFS 是shell中的内部变量,在使用 for var in var_list;do use $var do something don ...
- github无法访问?vscode 无法使用github登录同步? 改 hosts 吧
一.无法访问 github.com ? 想要去 github.com 上拿来主义,结果访问不了,或者 npm 时一直失败? 是什么原因不用问,直接使用 https://tool.lu/ip/ 查询到 ...
- 使用maven和gradle命令打jar包
参考:https://blog.csdn.net/qq_27525611/article/details/123487255 https://blog.csdn.net/qq_35860138/art ...
- 使用JdbcTemplate
1.使用JdbcTemplate的execute()方法执行SQL语句 Java代码 收藏代码 jdbcTemplate.execute("CREATE TABLE USER (user_ ...