[DEPRECATED] Take a look at H2O webserver.
Features of ngx_wizard
:
- Optimized nginx ;
- Tweaked settings ;
- Bleading Edge ;
- Self Contained Package ;
- Compiled from scratch ;
- Based on shared libraries ;
- LibreSSL as SSL library ;
- PCRE Jit as RegEx library ;
- Brotli compression dynamic module ;
- Atomic & Jemalloc for internal purpose ;
- Gold linker ;
Simple wizard for compiling nginx from scratch, independently from distros.
This script is provided AS IS & comes with ABSOLUTELY NO WARRANTY.
You need to install git
, curl
, make
and gcc
(or clang
).
Then, run this command:
bash <(curl -s https://gist.githubusercontent.com/concatime/36d58b967c7ef7f66e7acee91aea973c/raw/.sh)
And…, that's it!
To install dependencies on Fedora 26 (where curl
& make
are preinstalled), run:
dnf check-update || sudo dnf upgrade-minimal --assumeyes
sudo dnf install -by gcc git --setopt=install_weak_deps=False
sudo dnf clean all
Note #0: You could specify which c compiler will be use by typing CC=gcc-X
or CC=clang
, followed by the command.
Note #1: You may need to configure FireWall/SELinux appropriately for nginx.
Why I used shared version of nginx?
- Inside builded Makefile are really crap. See this as a concrete example.
- Following the same vibe, nginx makefile requires a c++ compiler for PCRE. I tried
--with-pcre-opt=--disable-cpp
, in vain. - Upgrading parts seamlessly, without recompiling everything.
I may need help to tweak with-cc-opt
& with-ld-opt
.
This script was even run on Vultr 2.50$ server's edition (Fedora 26) , and worked perfectly.
- Brotli module needs a release.
- Jemalloc with pkgconfig.
- Libatomic without docs.
Those are warnings I get usnig gcc-7.1.1
:
- FIXED in master, but I'm waiting for a final release
atomic_ops/sysdeps/standard_ao_double_t.h:35:37: warning: ‘-pedantic’ is not an option that controls warnings [-Wpragmas]
# pragma GCC diagnostic ignored "-pedantic"
^~~~~~~~~~~
CC asn1/libcrypto_la-a_bitstr.lo
asn1/a_bitstr.c: In function 'i2c_ASN1_BIT_STRING':
asn1/a_bitstr.c:121:2: warning: 'memcpy': specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
memcpy(p, d, len);
^~~~~~~~~~~~~~~~~
[…]
Making install in ssl
[…]
CC d1_both.lo
d1_both.c: In function 'dtls1_retransmit_message':
d1_both.c:1147:3: warning: 'save_write_sequence' may be used uninitialized in this function [-Wmaybe-uninitialized]
memcpy(S3I(s)->write_sequence, save_write_sequence,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sizeof(S3I(s)->write_sequence));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[…]
netcat.o: In function `main':
/tmp/tmp.wnEntS1dZt/libressl-2.6.2/apps/nc/netcat.c:441: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
- PENDING - Brotli module not using Brotli 0.6.0 API.
../ngx_brotli/src/ngx_http_brotli_filter_module.c:272:9: warning: ‘BrotliEncoderInputBlockSize’ is deprecated [-Wdeprecated-declarations]
ctx->brotli_ring = BrotliEncoderInputBlockSize(ctx->encoder);
^~~
In file included from ../ngx_brotli/src/ngx_http_brotli_filter_module.c:16:0:
../ngx_brotli/deps/brotli/include/brotli/encode.h:220:41: note: declared here
BROTLI_DEPRECATED BROTLI_ENC_API size_t BrotliEncoderInputBlockSize(
^~~~~~~~~~~~~~~~~~~~~~~~~~~
../ngx_brotli/src/ngx_http_brotli_filter_module.c: In function ‘ngx_http_brotli_filter_create_encoder’:
../ngx_brotli/src/ngx_http_brotli_filter_module.c:427:16: warning: ‘kBrotliMinWindowBits’ is deprecated [-Wdeprecated-declarations]
&& wbits > kBrotliMinWindowBits)
^~
In file included from ../ngx_brotli/src/ngx_http_brotli_filter_module.c:16:0:
../ngx_brotli/deps/brotli/include/brotli/encode.h:39:36: note: declared here
BROTLI_DEPRECATED static const int kBrotliMinWindowBits =
^~~~~~~~~~~~~~~~~~~~
../ngx_brotli/src/ngx_http_brotli_filter_module.c: In function ‘ngx_http_brotli_filter_add_data’:
../ngx_brotli/src/ngx_http_brotli_filter_module.c:498:5: warning: ‘BrotliEncoderCopyInputToRingBuffer’ is deprecated [-Wdeprecated-declarations]
BrotliEncoderCopyInputToRingBuffer(ctx->encoder, size, b->pos);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../ngx_brotli/src/ngx_http_brotli_filter_module.c:16:0:
../ngx_brotli/deps/brotli/include/brotli/encode.h:224:39: note: declared here
BROTLI_DEPRECATED BROTLI_ENC_API void BrotliEncoderCopyInputToRingBuffer(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../ngx_brotli/src/ngx_http_brotli_filter_module.c: In function ‘ngx_http_brotli_filter_process’:
../ngx_brotli/src/ngx_http_brotli_filter_module.c:534:5: warning: ‘BrotliEncoderWriteData’ is deprecated [-Wdeprecated-declarations]
if (!BrotliEncoderWriteData(ctx->encoder, ctx->last, ctx->flush, &size,
^~
In file included from ../ngx_brotli/src/ngx_http_brotli_filter_module.c:16:0:
../ngx_brotli/deps/brotli/include/brotli/encode.h:229:46: note: declared here
BROTLI_DEPRECATED BROTLI_ENC_API BROTLI_BOOL BrotliEncoderWriteData(
^~~~~~~~~~~~~~~~~~~~~~
../ngx_brotli/src/ngx_http_brotli_filter_module.c: In function ‘ngx_http_brotli_window’:
../ngx_brotli/src/ngx_http_brotli_filter_module.c:903:5: warning: ‘kBrotliMaxWindowBits’ is deprecated [-Wdeprecated-declarations]
wbits = kBrotliMaxWindowBits;
^~~~~
In file included from ../ngx_brotli/src/ngx_http_brotli_filter_module.c:16:0:
../ngx_brotli/deps/brotli/include/brotli/encode.h:41:36: note: declared here
BROTLI_DEPRECATED static const int kBrotliMaxWindowBits =
^~~~~~~~~~~~~~~~~~~~
../ngx_brotli/src/ngx_http_brotli_filter_module.c:904:5: warning: ‘kBrotliMinWindowBits’ is deprecated [-Wdeprecated-declarations]
mbits = kBrotliMinWindowBits;
^~~~~
In file included from ../ngx_brotli/src/ngx_http_brotli_filter_module.c:16:0:
../ngx_brotli/deps/brotli/include/brotli/encode.h:39:36: note: declared here
BROTLI_DEPRECATED static const int kBrotliMinWindowBits =
^~~~~~~~~~~~~~~~~~~~