linux6.5 apache安装,基于centos6.5环境的apache 2.4版本二进制源码安装

首先先编译安装apache可移植运行库apr apr-util

[root@localhost src]# wget

[root@localhost src]# tar zxvf apr-1.5.2.tar.gz

[root@localhost apr-1.5.2]# ./configure --prefix=/usr/local/apr

[root@localhost apr-1.5.2]# make && make install

[root@localhost src]# wget

[root@localhost src]# tar zxvf apr-util-1.5.4.tar.gz

[root@localhost apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/

[root@localhost apr-util-1.5.4]# make && make install

1、下载

[root@localhost mysql]# cd /usr/local/src/

[root@localhost src]# wget

2、解压

[root@localhost httpd-2.4.18]# tar zxvf httpd-2.4.18.tar.gz

3、配置编译参数:

[root@localhost httpd-2.4.18]# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so \

--enable-ssl --enable-cgi --enable-rewrite --enable-deflate --with-z --with-zlib --with-pcre --with-apr=/usr/local/apr \

--with-apr-util=/usr/local/apr-util/ \

--enable-modules=most --enable-mpms-shared=all --with-mpm=event

# 各编译参数详解

--prefix:#安装路径

--sysconfdir:#指定配置文件路径

--enable-so:#DSO兼容,DSO=Dynamic Shared Object,动态共享对象,可实现模块动态生效

--enable-ssl:#支持SSL/TLS,可以实现https访问

--enable-cgi:#支持CGI脚本(默认对非线程的MPM模式开启)

--enable-rewrite:#启用Rewrite功能

--enable-deflate:#支持压缩

--with-z:#使用指定的zlib库,不指定路径会自动寻找

--with-pcre:#使用指定的PCRE库,不指定路径会自动寻找

--with-apr:#指定apr安装路径

--with-apr-util:#指定apr-util安装路径

--enable-modules:#支持动态启用的模块,可选参数有“all”,“most”,“few”,“reallyall”

--enable-mpms-shared:#支持动态加载的MPM模块,可选“all”

--with-mpm:#设置默认启用的MPM模式

为了避免在make的时候出现错误,所以最好是提前先安装好一些库文件:

yum install -y pcre pcre-devel

[root@localhost ~]# cp /usr/local/apache/bin/apachectl /etc/init.d/httpd

[root@localhost ~]# vim /etc/init.d/httpd

需要编辑/etc/rc.d/init.d/httpd,添加以下注释信息:

# chkconfig: 345 85 15

# description: Activates/Deactivates Apache Web Server

第一行3个数字参数意义分别为:哪些Linux级别需要启动httpd(3,4,5);启动序号(85);关闭序号(15)

[root@localhost ~]# ln -s /etc/init.d/httpd /etc/rc.d/rc5.d/S85httpd

[root@localhost rc5.d]# chkconfig httpd on

查看编译参数

cat /usr/local/apache2/build/config.nice

3、编译

[root@localhost httpd-2.2.24]# make

4、安装:

[root@localhost httpd-2.2.24]# make install

5、启动程序

[root@localhost httpd-2.2.24]# service httpd start

阅读(1027) | 评论(0) | 转发(0) |

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值