(原)nginx 源码编译

要在nginx上开发,因此先了解下这个是干吗的..百度一下不少html

编译源码须要的组件nginx

1.zlibgit

2.pcregithub

3.openssl正则表达式

使用ubuntu的话.能够直接使用ubuntu

sudo apt-get install zlib安全

sudo apt-get install pcreless

sudo apt-get install opensslspa

这些默认都放在系统目录下.我比较喜欢本身编译.net

------------------------------------

库下载地址:

源码下载地址 zlib 

http://www.zlib.net/

PCRE --支持正则表达式 

http://www.pcre.org/

opensll安装(可选), 支持安全协议的站点

http://www.openssl.org/

nginx 

http://nginx.org/en/download.html

 

1.编译zlib

tar xvf zlib-1.2.8.tar.gz
./configure --static --prefix=/home/charles/flvplay/source/libs/zlib
make
make install

2.编译openssl

tar xvf openssl-1.0.le.tar.gz
./config --prefix=/home/charles/flvplay/source/libs/openssl -L/home/charles/flvplay/source/libs/zlib/lib -I/home/charles/flvplay/source/libs/zlib/include threads zlib enable-static-engine
make
make install

3.编译pcre

tar xvf pcre-8.33.tar.gz
./configure --prefix=/home/charles/flvplay/source/libs/pcre 
make 
make install

4.编译ngnix

tar xvf nginx-1.5.4.tar.gz
./configure --prefix=/home/charles/flvplay/source/libs/nginx --with-debug --with-openssl=/home/charles/flvplay/source/openssl-1.0.le --with-zlib=/home/charles/flvplay/source/zlib-1.2.8 --with-pcre=/home/charles/flvplay/source/pcre-8.33 --with-http_stub_status_module --with-http_gzip_static_module
make 
make install
#备注:--with-openssl --with-zlib --with-pcre这3个路径是他们对应的源码路径..开始我觉得是对应库路径.折腾了很久...

生成的nginx在/home/charles/flvplay/source/libs/nginx/sbin下

./nginx --运行程序
在地址栏输入: http://localhost 若是看到如下效果,说明正确安装了

 

 

也能够直接下载编写好的Makefile

下载地址:

https://github.com/charlessoft/flvplay

相关文章
相关标签/搜索