prism

2013-08-16

Install nginx-push-stream-module

要在 Debian 上面安裝,標準官方的 nginx 加上 https://github.com/wandenberg/nginx-push-stream-module 模組

做個筆記,這裡的 nginx 並不是 Debian 官方的 deb,是由 nginx 官方釋出的 deb

裝 官方 nginx ,加個 sources.list 先


# nginx
# wget http://nginx.org/keys/nginx_signing.key
# sudo apt-key add nginx_signing.key
#
deb http://nginx.org/packages/debian/ wheezy nginx
deb-src http://nginx.org/packages/debian/ wheezy nginx



#裝 build depend package

apt-get build-dep nginx

#下載 source
apt-get source nginx

#git clone nginx module ,照官方文件設定環境

git clone https://github.com/wandenberg/nginx-push-stream-module
NGINX_PUSH_STREAM_MODULE_PATH=$PWD/nginx-push-stream-module

# 這時候資料夾,應該有 nginx-1.4.2 的資料夾,看現在新的套件版本

cd nginx-1.4.2

# 編輯一下 vim debian/rules


override_dh_auto_build:
dh_auto_build
mv objs/nginx objs/nginx.debug
./configure \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-mail \
--with-mail_ssl_module \
--with-file-aio \
$(WITH_SPDY) \
--with-cc-opt="$(CFLAGS)" \
--with-ld-opt="$(LDFLAGS)" \
--add-module=../nginx-push-stream-module \ # 就加這一行而已
--with-ipv6
dh_auto_build


#執行

dpkg-buildpackage -b

這樣就包好,可以安裝測試了,不想要更新的話,就把他版本 hold 住


最近試了, socket.iosockjs 還是都沒有讓人覺得很滿意

看看國外 disqus 推荐的 https://github.com/wandenberg/nginx-push-stream-module

還蠻簡單用的,而且複雜性低,不用多加掛一個 socket server ,就交給 nginx 負責 pub 及 sub 的部份,架構算乾淨,自己的下一個玩具,就用他了

沒有留言: