源码包管理
来源:互联网 发布:如何选择网络机顶盒 编辑:程序博客网 时间:2024/06/14 19:46
源码包安装以nginx为例
一、获得源码包途径
1. 官方网站,可以获得最新的软件包 例如Apache www.apache.org Nginx www.nginx.org2. www.google.com ( pcre cacti ) //rpm包 —— http://rpmfind.net
二、安装源码包
源码包安装一般情况下分三步:配置(configure)、编译(make)、安装(make install)
命令 # make && make install
环境准备1. 编译环境如gcc编译器、make,安装软件包组 开发工具(生产环境中不建议装)
2. 准备软件
nginx-1.4.4.tar.gz
部署Nginx
1. nginx
# useradd www //为nginx进程准备运行的用户
# tar xvf nginx-1.4.4.tar.gz -C /usr/src/
# cd nginx-1.4.4
# ./configure --help
# ./configure \
> --user=www \
> --group=www \
> --prefix=/usr/local/nginx \
> --with-http_stub_status_module \
> --with-http_sub_module \
> --with-http_ssl_module \
> --with-pcre
注:
--user指定进程运行的用户
--with-http_stub_status_module启用状态模块功能
--with-http_sub_module启用子模块功能
--with-http_ssl_module启用加密模块
--with-pcre支持正则表达式
pcre: 支持正则表达式,地址重写rewrite
# yum -y install pcre pcre-devel
# make
# make install
# /usr/local/nginx/sbin/nginx //启动nginx服务器
三、详解源码安装三步曲:
# ./configure
a. 指定安装路径,例如--prefix=/usr/local/nginx
157/335
b. 启用或禁用某项功能, 例如 --with-http_ssl_module
c. 和其它软件关联,例如--with-pcre
d. 检查安装环境,例如是否有编译器gcc,是否满足软件的依赖需求
最终生成:Makefile
# make clean //用于反复添加或者删除功能清理掉编译后产生的 *.o目标文件
# make //按Makefile文件编译,可以使用-j 2指定两颗CPU编译
# make install //安装,将相应的文件拷贝到指定的目录下
源码安装错误示例:
error1:
checking for PCRE JIT support ... found
checking for system md library ... not found
checking for system md5 library ... not found
checking for OpenSSL md5 crypto library ... not found
checking for sha1 in system md library ... not found
checking for OpenSSL sha1 crypto library ... not found
checking for zlib library ... not found
./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.
解决方案:
# yum -y install zlib-devel
error2:
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
解决方案:
# yum -y install openssl-devel
error3:
# ./configure --prefix=/usr/local/pcre-8.31
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/root/pcre-8.31':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
158/335
解决方案:
# LANG=C yum -y groupinstall "Development tools"
注:
如机器上所需要的工具包都齐全的话,一步到位 不报这些需要这包那包的错误。
0 0
- UBUNTU管理源码包
- Linux源码包管理
- 源码包管理
- 源码包管理
- 9、源码包管理
- 源码包服务管理
- Linux服务管理-源码包的管理
- android包管理服务(PackageManagerService)源码分析
- linux软件包管理--yum源码包
- Linux学习笔记-----RPM包管理----源码包安装
- 3-8·Linux源码包管理、脚本安装包
- Linux学习之软件包管理--源码包管理
- 第六章: 6.4.1 源码包管理-源码包与RPM包的区
- 第六章:6.4.2 源码包管理-源码包安装过程
- debian源码包管理的几个有用的命令
- RedHat系列软件管理(第二版) --源码包安装
- 第十二章:12.3 源码包服务的管理
- 22、软件管理之源码包安装与脚本安装
- structs 2 从初学者心中的伤 mapped for namespace [/]
- Maven探究一:mirror和repository 区别
- 538. Convert BST to Greater Tree | 二叉排序树转换成Greater树
- Android4.4及以上实现透明状态栏
- 七、ASCII
- 源码包管理
- 堆模板
- 第四次也不知道0 0诶 这次好像看不太懂
- int 与 string 之间的转换
- T440s 的 Hardware Password Manager是干嘛的
- Git Quick Guide
- 动态代理
- 缓存淘汰算法--LRU算法(java代码实现)
- C++之局部对象(自动对象和静态局部对象)