Unity-Technologies / nginx-range-cache

Allow range requests to be used to cache large remote files in nginx
BSD 3-Clause "New" or "Revised" License
0 stars 4 forks source link

how to install this patch ? #1

Open nexusofdoom opened 7 years ago

nexusofdoom commented 7 years ago

how to apply this patch ? https://github.com/multiplay/nginx-range-cache

example

Install nginx

curl http://nginx.org/download/nginx-1.10.0.tar.gz | tar zx

where does the patch files go?

cd ngnix-1.10.0

./configure --with-range_cache_size --with-http_ssl_module --with-http_slice_module --with-file-aio --with-threads

make

sudo make install

nexusofdoom commented 7 years ago

install freebsd 10.x

pkg install git pkg install ntp pkg install sudo

Therefore, one way to grant a normal user with superuser privileges is to add the #user to the wheel group. To add a user to the wheel group, use this pw groupmod #command (replace the highlighted username):

sammy would be your username

run from root user

pw groupmod wheel -m "sammy"

after that the su root command should work.

su root

ntpdate -v -b in.pool.ntp.org

git clone https://github.com/multiplay/lancache.git

how to download compile and install nginx can we use the current version ?

how to apply this patch ? https://github.com/multiplay/nginx-range-cache.git

git clone https://github.com/multiplay/nginx-range-cache.git

example

Install nginx

curl -o nginx-1.10.0.tar.gz http://nginx.org/download/nginx-1.10.0.tar.gz tar xvfz nginx-1.10.0.tar.gz

get patch files command ?

where does the patch file go ?

cd ngnix-1.10.0

patch -p1 < ../nginx-range-cache/range_filter.patch

./configure

--with-range_cache_size --with-http_ssl_module --with-http_slice_module --#with-file-aio --with-threads

make

make install

nexusofdoom commented 7 years ago

1patch patched

nexusofdoom commented 7 years ago

did it patch correct ?

what is the correct ./configure command ? thanks

nexusofdoom commented 7 years ago

ok applied the zip that was sent now I am getting this

===> License BSD2CLAUSE accepted by the user ===> nginx-1.12.1_4,2 depends on file: /usr/local/sbin/pkg - found => nginx-1.12.1.tar.gz doesn't seem to exist in /usr/ports/distfiles/. => Attempting to fetch http://nginx.org/download/nginx-1.12.1.tar.gz nginx-1.12.1.tar.gz 100% of 958 kB 679 kBps 00m02s => ngx_cache_purge-2.3.tar.gz doesn't seem to exist in /usr/ports/distfiles/. => Attempting to fetch http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz ngx_cache_purge-2.3.tar.gz 100% of 11 kB 10 MBps 00m00s => openresty-headers-more-nginx-module-84241e4_GH0.tar.gz doesn't seem to exist in /usr/ports/distfiles/. => Attempting to fetch https://codeload.github.com/openresty/headers-more-nginx-module/tar.gz/84241e4?dummy=/openresty-headers-more-nginx-module-84241e4_GH0.tar.gz fetch: https://codeload.github.com/openresty/headers-more-nginx-module/tar.gz/84241e4?dummy=/openresty-headers-more-nginx-module-84241e4_GH0.tar.gz: size unknown fetch: https://codeload.github.com/openresty/headers-more-nginx-module/tar.gz/84241e4?dummy=/openresty-headers-more-nginx-module-84241e4_GH0.tar.gz: size of remote file is not known openresty-headers-more-nginx-module-84241e4_GH 27 kB 634 kBps 00m00s => wandenberg-nginx-push-stream-module-0.5.1_GH0.tar.gz doesn't seem to exist in /usr/ports/distfiles/. => Attempting to fetch https://codeload.github.com/wandenberg/nginx-push-stream-module/tar.gz/0.5.1?dummy=/wandenberg-nginx-push-stream-module-0.5.1_GH0.tar.gz fetch: https://codeload.github.com/wandenberg/nginx-push-stream-module/tar.gz/0.5.1?dummy=/wandenberg-nginx-push-stream-module-0.5.1_GH0.tar.gz: size unknown fetch: https://codeload.github.com/wandenberg/nginx-push-stream-module/tar.gz/0.5.1?dummy=/wandenberg-nginx-push-stream-module-0.5.1_GH0.tar.gz: size of remote file is not known wandenberg-nginx-push-stream-module-0.5.1_GH0. 171 kB 834 kBps 00m00s => multiplay-nginx-range-cache-0.2_GH0.tar.gz doesn't seem to exist in /usr/ports/distfiles/. => Attempting to fetch https://codeload.github.com/multiplay/nginx-range-cache/tar.gz/0.2?dummy=/multiplay-nginx-range-cache-0.2_GH0.tar.gz fetch: https://codeload.github.com/multiplay/nginx-range-cache/tar.gz/0.2?dummy=/multiplay-nginx-range-cache-0.2_GH0.tar.gz: size unknown fetch: https://codeload.github.com/multiplay/nginx-range-cache/tar.gz/0.2?dummy=/multiplay-nginx-range-cache-0.2_GH0.tar.gz: size of remote file is not known multiplay-nginx-range-cache-0.2_GH0.tar.gz 7598 B 21 MBps 00m00s => Fetched file size mismatch (expected 44559, actual 7598) => Trying next site => Attempting to fetch http://distcache.FreeBSD.org/ports-distfiles/multiplay-nginx-range-cache-0.2_GH0.tar.gz fetch: http://distcache.FreeBSD.org/ports-distfiles/multiplay-nginx-range-cache-0.2_GH0.tar.gz: Not Found => Couldn't fetch it - please try to retrieve this => port manually into /usr/ports/distfiles/ and try again. *** Error code 1

Stop. make[1]: stopped in /usr/ports/www/nginx *** Error code 1

Stop. make: stopped in /usr/ports/www/nginx

nexusofdoom commented 7 years ago

===> License BSD2CLAUSE accepted by the user ===> nginx-1.12.1_4,2 depends on file: /usr/local/sbin/pkg - found => multiplay-nginx-range-cache-0.2_GH0.tar.gz doesn't seem to exist in /usr/ports/distfiles/. => Attempting to fetch https://codeload.github.com/multiplay/nginx-range-cache/tar.gz/0.2?dummy=/multiplay-nginx-range-cache-0.2_GH0.tar.gz fetch: https://codeload.github.com/multiplay/nginx-range-cache/tar.gz/0.2?dummy=/multiplay-nginx-range-cache-0.2_GH0.tar.gz: size mismatch: expected 44559, actual 7598 => Attempting to fetch http://distcache.FreeBSD.org/ports-distfiles/multiplay-nginx-range-cache-0.2_GH0.tar.gz fetch: http://distcache.FreeBSD.org/ports-distfiles/multiplay-nginx-range-cache-0.2_GH0.tar.gz: Not Found => Couldn't fetch it - please try to retrieve this => port manually into /usr/ports/distfiles/ and try again. *** Error code 1

nexusofdoom commented 7 years ago

mkdir /usr/portbuild/ mkdir /usr/portbuild/www/ mkdir /usr/portbuild/www/nginx/ mkdir /usr/portbuild/www/nginx/work

cd /usr/portbuild/www/nginx/work

wget "https://codeload.github.com/wandenberg/nginx-push-stream-module/tar.gz/0.5.1?dummy=/wandenberg-nginx-push-stream-module-0.5.1_GH0.tar.gz" tar zxvf "0.5.1?dummy=%2Fwandenberg-nginx-push-stream-module-0.5.1_GH0.tar.gz"

wget "http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz" tar zxvf "ngx_cache_purge-2.3.tar.gz"

wget "https://codeload.github.com/multiplay/nginx-range-cache/tar.gz/0.2?dummy=/multiplay-nginx-range-cache-0.2_GH0.tar.gz" tar zxvf "0.2?dummy=%2Fmultiplay-nginx-range-cache-0.2_GH0.tar.gz"

./configure --add-module=/usr/portbuild/www/nginx/work/nginx-push-stream-module-0.5.1

./configure --add-module=/usr/portbuild/www/nginx/work/ngx_cache_purge-2.3

./configure --add-module=/usr/portbuild/www/nginx/work/nginx-range-cache-0.2

cd to src location then run

./configure --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --user=www --group=www --modules-path=/usr/local/libexec/nginx --with-file-aio --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx/access.log --add-module=/usr/portbuild/www/nginx/work/ngx_cache_purge-2.3 --with-http_flv_module --with-http_geoip_module=dynamic --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --add-module=/usr/portbuild/www/nginx/work/nginx-range-cache-0.2 --with-http_realip_module --with-http_slice_module --with-http_stub_status_module --with-pcre --with-http_v2_module --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_ssl_module

but getting this error about GD Library ./configure: error: the HTTP image filter module requires the GD library.

nexusofdoom commented 7 years ago

fixed the GD library with wget "https://github.com/libgd/libgd/releases/download/gd-2.2.5/libgd-2.2.5.tar.gz" tar zxvf "gd-2.2.5/libgd-2.2.5.tar.gz" cd libgd-2.2.5 ./configure make make install

now on to this error ./configure: error: the GeoIP module requires the GeoIP library.

nexusofdoom commented 7 years ago

to fix the GeoIP library

pkg install GeoIP /usr/local/bin/geoipupdate.sh

looking good

nexusofdoom commented 7 years ago

getting this error now nginx: [alert] setsockopt(SO_ACCEPTFILTER, "httpready") for 10.0.4.53:80 failed, ignored (2: No such file or directory)

nexusofdoom commented 7 years ago

ok looking good still testing

this is what I have so far

pkg install GeoIP /usr/local/bin/geoipupdate.sh pkg install libgd

mkdir "/usr/portbuild/www/nginx/work"

mkdir "/data/www/cache/installs" mkdir"/data/www/logs/"

cd /usr/portbuild/www/nginx/work

nano /boot/defaults/loader.conf

add to end of file

accf_http_load = "YES"

wget "https://codeload.github.com/wandenberg/nginx-push-stream-module/tar.gz/0.5.1?dummy=/wandenberg-nginx-push-stream-module-0.5.1_GH0.tar.gz"

tar zxvf "0.5.1?dummy=%2Fwandenberg-nginx-push-stream-module-0.5.1_GH0.tar.gz"

wget "http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz"

tar zxvf "ngx_cache_purge-2.3.tar.gz"

wget "https://codeload.github.com/multiplay/nginx-range-cache/tar.gz/0.2?dummy=/multiplay-nginx-range-cache-0.2_GH0.tar.gz"

tar zxvf "0.2?dummy=%2Fmultiplay-nginx-range-cache-0.2_GH0.tar.gz"

./configure --add-module=/usr/portbuild/www/nginx/work/nginx-push-stream-module-0.5.1

./configure --add-module=/usr/portbuild/www/nginx/work/ngx_cache_purge-2.3

./configure --add-module=/usr/portbuild/www/nginx/work/nginx-range-cache-0.2

./configure: error: the HTTP image filter module requires the GD library.

wget "https://github.com/libgd/libgd/releases/download/gd-2.2.5/libgd-2.2.5.tar.gz"

tar zxvf "gd-2.2.5/libgd-2.2.5.tar.gz"

cd libgd-2.2.5

./configure

make

make install

or

pkg install libgd

cd to src location then run

./configure --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --user=www --group=www --modules-path=/usr/local/libexec/nginx --with-file-aio --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx/access.log --add-module=/usr/portbuild/www/nginx/work/ngx_cache_purge-2.3 --with-http_flv_module --with-http_geoip_module=dynamic --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --add-module=/usr/portbuild/www/nginx/work/nginx-range-cache-0.2 --with-http_realip_module --with-http_slice_module --with-http_stub_status_module --with-pcre --with-http_v2_module --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_ssl_module

make

make install