一、编译安装的整体步骤
1、在官网下载源码,并解压
2、切换到其目录中
3、执行./configure
4、编译
二、编译中及安装后配置常见的参数及其说明
编译中配置
1)指定安装路径 --prefix=/usr/local/Pacakage_name 指定安装路径
--sysconfigdir=/etc/Package_name 指定配置文件存放路径 2)指定启用/禁用的特性 --enbale-feature --disable-feature 3)指定所依赖的功能、程序或文件 --with-funciton --without-function 不同的程序其configure脚本功能不同,要获取帮助, ./configure --help|less ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 安装后配置: 1.二进制程序目录导入之PATH环境变量 编辑配置文件/etc/profile.d/NAME.sh
2.导入文件路径 编辑/etc/ld.so.conf.d/NAME.conf添加新库至文件中让系统重新生成缓存 ldconfig [-v] 3.导入头文件,创建软连接即可 ln -sv 4.导入帮助手册 编辑/etc/man.conf|man_db.conf文件,添加MANPATH即可 5.configure参数 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥
演示(本文采用httpd-2.2.27.tar.gz,centos6.x)
‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥
1)在安装之前最好先将开发工具组包及其pcre/pcre-devel/zlib/zlib-devel安装防止报错
yum -y groupinstall "Development tools"
yum -y install pcre pcre-devel zlib zlib-devel
2)解压及其安装
tar xf httpd-2.2.27.tar.gz
cd httpd-2.2.27
./configure --prefix=/usr/local/httpd2.2.27 --sysconfdir=/etc/httpd/
make && make install
‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥
截图演示:
在上诉步骤没报错的情况下执行如下:
由于编译前保留了版本号为以后升级方便,为此做软连接
‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥
三、测试及其导入帮助、库文件、头文件、添加至环境变量
1)启动服务测试是否安装成功
2)添加至环境变量
PATH:$PATH=/usr/local/httpd/bin/
export PATH
3)头文件导入
1
2
3
4
5
6
7
8
9
| [iyunv@centos6 local]# ls
bin etc games httpd httpd2.2.27 include lib lib64 libexec sbin share src
[iyunv@centos6 local]# pwd
/usr/local
[iyunv@centos6 local]# ln -s /usr/local/httpd/include/ /usr/include/httpd/
[iyunv@centos6 local]# ll /usr/include/httpd/
总用量 0
lrwxrwxrwx. 1 root root 25 8月 22 05:22 include -> /usr/local/httpd/include/
[iyunv@centos6 local]#
|
4)导入库文件
5)导入man手册
|