要在nginx上開發,所以先了解下這個是幹嘛的..百度一下很多
編譯源碼需要的組件
1.zlib
2.pcre
3.openssl
使用ubuntu的話.可以直接使用
sudo apt-get install zlib
sudo apt-get install pcre
sudo apt-get install openssl
這些默認都放在系統目錄下.我比較喜歡自己編譯
------------------------------------
庫下載地址:
源碼下載地址 zlib
PCRE --支持正則表達式
opensll安裝(可選), 支持安全協議的站點
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
下載地址: