编译安装httpd-2.2.31
2017-03-27 12:04
169 查看
一. 预备环境:
# 编译安装apache之前需要确认:apr(apache虚拟机),apr-util,apr-util-ldap的版本, 不同的版本所依赖的apr版本不同.
# httpd-2.2.*只需依赖于apr-1.3.9即可
# httpd-2.4.*需要依赖于apr-1.4.*或以上的版本
# 如需下载相应的版本: http://apr.apache.org/
# 查看apr的版本
[root@caiya ~]# rpm -qa apr*
apr-1.3.9-5.el6_2.i686
apr-util-ldap-1.3.9-3.el6_0.1.i686
apr-util-1.3.9-3.el6_0.1.i686
[root@caiya ~]#
# centos 6.X 版本自带的apr基本都是 apr-1.3.X, 满足httpd-2.2.x的要求. 直接安装即可
二. 安装apache(httpd)
# 下载httpd安装包(就近选择的下载地址, 搜狐镜像站点)
[root@caiya software]# wget http://mirrors.sohu.com/apache/httpd-2.2.31.tar.gz [root@caiya software]# tar zxvf httpd-2.2.31.tar.gz
[root@caiya software]# cd httpd-2.2.31
# httpd的模块解释:
# 指定安装路径
# --prefix=/usr/local/apache
# 指定配置文件的路径
# --sysconfdir=/etc/httpd
# 装载核心模块,支持动态共享模块,以模块的方式加载PHP, 如果不开启, 无法使用PHP
# --enable-so
# 支持URL重写
# --enable-rewrite
# 支持ssl的功能, 否则无法使用https
# --enable-ssl
# 启动压缩机会, 将文本信息压缩后回复给客户端, 浏览器自动解压, 很常用的一种压缩机制
# --enable-deflate
# 让PHP以FastCGI的模式工作, 必须要开启此项
# --enable-proxy-fcgi
# 配置
[root@caiya httpd-2.2.31]# ./configure \
--prefix=/usr/local/httpd-2.2.31 \
--sysconfdir=/etc/httpd \
--enable-so \
--enable-rewirte \
--enable-ssl \
--enable-cgi \
--enable-cgid \
--enable-modules=most \
--enable-mods-shared=most \
--enable-mpms-shared=all
# 如果报如下错误:
checking for pcre-config... false
configure: error: pcre-config for libpcre not found.
PCRE is required and available from http://pcre.org/
# 解决办法
[root@caiya httpd-2.2.31]# yum install pcre-devel -y
# 编译, 安装
[root@caiya httpd-2.2.31]# make
[root@caiya httpd-2.2.31]# make install
# 注意: httpd受selinux控制, 如果selinux为运行状态, 有可能导致httpd无法启动
# 此时为关闭状态, 如果不是关闭状态, 修改selinux配置文件 vim /etc/selinux/config 修改为: SELINUX=disabled
[root@caiya local]# getenforce
Disabled
[root@caiya local]#
# 至此apache已经安装完毕
三. 配置apache
# 启动apache
# 编译安装的启动脚本在: /usr/local/httpd-2.2.31/bin/apachectl
[root@caiya bin]# /usr/local/httpd-2.2.31/bin/apachectl start
# 如果报如下错误:
AH00557: httpd: apr_sockaddr_info_get() failed for caiya.localdomain
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
# 解决办法:
[root@caiya httpd]# vim /etc/httpd/httpd.conf
找到"#ServerName www.example.com:80" 去掉前面的注释
# 检测是否正常启动(当前为正常状态)
[root@caiya bin]# /usr/local/httpd-2.2.31/bin/apachectl start
[root@caiya bin]# netstat -tnlp | grep 80
5:tcp 0 0 :::80 :::* LISTEN 41862/httpd
[root@caiya bin]# ps -ef | grep httpd
65:root 1397 1 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
66:daemon 1398 1397 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
67:daemon 1399 1397 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
68:daemon 1400 1397 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
69:daemon 1401 1397 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
70:daemon 1402 1397 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
71:daemon 1403 1397 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
73:root 1405 1778 0 15:14 pts/1 00:00:00 grep --color -n httpd
[root@caiya bin]#
# 编译安装apache之前需要确认:apr(apache虚拟机),apr-util,apr-util-ldap的版本, 不同的版本所依赖的apr版本不同.
# httpd-2.2.*只需依赖于apr-1.3.9即可
# httpd-2.4.*需要依赖于apr-1.4.*或以上的版本
# 如需下载相应的版本: http://apr.apache.org/
# 查看apr的版本
[root@caiya ~]# rpm -qa apr*
apr-1.3.9-5.el6_2.i686
apr-util-ldap-1.3.9-3.el6_0.1.i686
apr-util-1.3.9-3.el6_0.1.i686
[root@caiya ~]#
# centos 6.X 版本自带的apr基本都是 apr-1.3.X, 满足httpd-2.2.x的要求. 直接安装即可
二. 安装apache(httpd)
# 下载httpd安装包(就近选择的下载地址, 搜狐镜像站点)
[root@caiya software]# wget http://mirrors.sohu.com/apache/httpd-2.2.31.tar.gz [root@caiya software]# tar zxvf httpd-2.2.31.tar.gz
[root@caiya software]# cd httpd-2.2.31
# httpd的模块解释:
# 指定安装路径
# --prefix=/usr/local/apache
# 指定配置文件的路径
# --sysconfdir=/etc/httpd
# 装载核心模块,支持动态共享模块,以模块的方式加载PHP, 如果不开启, 无法使用PHP
# --enable-so
# 支持URL重写
# --enable-rewrite
# 支持ssl的功能, 否则无法使用https
# --enable-ssl
# 启动压缩机会, 将文本信息压缩后回复给客户端, 浏览器自动解压, 很常用的一种压缩机制
# --enable-deflate
# 让PHP以FastCGI的模式工作, 必须要开启此项
# --enable-proxy-fcgi
# 配置
[root@caiya httpd-2.2.31]# ./configure \
--prefix=/usr/local/httpd-2.2.31 \
--sysconfdir=/etc/httpd \
--enable-so \
--enable-rewirte \
--enable-ssl \
--enable-cgi \
--enable-cgid \
--enable-modules=most \
--enable-mods-shared=most \
--enable-mpms-shared=all
# 如果报如下错误:
checking for pcre-config... false
configure: error: pcre-config for libpcre not found.
PCRE is required and available from http://pcre.org/
# 解决办法
[root@caiya httpd-2.2.31]# yum install pcre-devel -y
# 编译, 安装
[root@caiya httpd-2.2.31]# make
[root@caiya httpd-2.2.31]# make install
# 注意: httpd受selinux控制, 如果selinux为运行状态, 有可能导致httpd无法启动
# 此时为关闭状态, 如果不是关闭状态, 修改selinux配置文件 vim /etc/selinux/config 修改为: SELINUX=disabled
[root@caiya local]# getenforce
Disabled
[root@caiya local]#
# 至此apache已经安装完毕
三. 配置apache
# 启动apache
# 编译安装的启动脚本在: /usr/local/httpd-2.2.31/bin/apachectl
[root@caiya bin]# /usr/local/httpd-2.2.31/bin/apachectl start
# 如果报如下错误:
AH00557: httpd: apr_sockaddr_info_get() failed for caiya.localdomain
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
# 解决办法:
[root@caiya httpd]# vim /etc/httpd/httpd.conf
找到"#ServerName www.example.com:80" 去掉前面的注释
# 检测是否正常启动(当前为正常状态)
[root@caiya bin]# /usr/local/httpd-2.2.31/bin/apachectl start
[root@caiya bin]# netstat -tnlp | grep 80
5:tcp 0 0 :::80 :::* LISTEN 41862/httpd
[root@caiya bin]# ps -ef | grep httpd
65:root 1397 1 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
66:daemon 1398 1397 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
67:daemon 1399 1397 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
68:daemon 1400 1397 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
69:daemon 1401 1397 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
70:daemon 1402 1397 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
71:daemon 1403 1397 0 15:14 ? 00:00:00 /usr/local/httpd-2.2.31/bin/httpd -k start
73:root 1405 1778 0 15:14 pts/1 00:00:00 grep --color -n httpd
[root@caiya bin]#
相关文章推荐
- Linux下编译安装httpd-2.2.31
- LAMP(httpd 2.4.1 + mysql-5.5.19 + php-5.3.10)编译安装
- ubuntu下编译安装httpd-2.4.3
- CentOS 6.4 编译安装httpd-2.2.25源码包
- Web服务其三编译安装httpd-2.4.9
- 源码编译安装httpd2.4.9
- 安装httpd-2.2.15.tat.gz碰到的编译问题
- httpd2.4之编译安装及配置参数详细说明
- linux 编译安装过程之httpd
- CentOS 下编译安装httpd
- 编译安装httpd
- 手把手教你httpd + mysql+ php 编译安装过程
- Linux下源码httpd编译安装
- 编译安装httpd源码包
- 编译安装httpd,并启动之
- 为编译安装的httpd提供基于ssl的安全会话
- 编译安装httpd并启动之
- httpd之编译安装详解
- 编译安装httpd并启动之
- 编译安装最新版httpd-2.4