:: installing nginx with h264 streaming
:: download and extract package
# wget //nginx.org/download/nginx-1.0.0.tar.gz # tar xzf nginx-1.0.0.tar.gz
# wget //h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz # tar -zxvf nginx_mod_h264_streaming-2.2.7.tar.gz
# wget //www.openssl.org/source/openssl-0.9.8o.tar.gz # tar xzf openssl-0.9.8o.tar.gz
:: create file patch (for h264)
# vi nginxpatch.diff --- ../nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c.orig 2010-05-24 18:04:43.000000000 +0400 +++ ../nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c 2010-05-24 18:05:02.000000000 +0400 @@ -155,10 +155,6 @@ } /* TODO: Win32 */ - if (r->zero_in_uri) - { - return NGX_DECLINED; - } rc = ngx_http_discard_request_body(r);
:: patching
# patch -p1 < nginxpatch.diff
:: compiling nginx
# cd nginx-1.0.0 # ./configure --add-module=/root/nginx_mod_h264_streaming-2.2.7 --sbin-path=/usr/local/sbin --with-http_ssl_module --with-openssl=/root/openssl-0.9.8o --with-http_flv_module --user=daemon --group=daemon # make && make install
:: setup nginx.conf
### add this line on location section
location ~ .mp4$ { mp4; }
# vi /usr/local/nginx/conf/nginx.conf ### like this location / { root html; index index.html index.htm; location ~ .mp4$ { mp4; } }
:: running daemon
### testing configure
# /usr/local/sbin/nginx -t
### reload / restart
# /usr/local/sbin/nginx -s reload
### starting nginx
# /usr/local/sbin/nginx
:: testing video
# cd /usr/local/nginx/html # wget //h264.code-shop.com:8080/workers_world_co64_box64.mp4 -O testing.mp4
open your video using web browser:
//hostname/testing.mp4
:: links
+ google
+ h264.shop.code
+ freebsd
on attempting to patch, i get a fail for some reason:
patching file nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c
Hunk #1 FAILED at 155.
1 out of 1 hunk FAILED — saving rejects to file nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c.rej
root@ks369419:/usr/local/src/nginx-1.0.4#
any clue?
please try run patching on /usr/local/src/