All Projects → jaygooby → build-nginx

jaygooby / build-nginx

Licence: MIT license
Fetches nginx and any optional third-party modules and dependencies you specify, such as openssl and PCRE and then configures and builds.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to build-nginx

cacheify
Browserify transform wrapper that caches the transforms between runs to improve performance
Stars: ✭ 30 (-37.5%)
Mutual labels:  build-tool
next-boilerplate
☶ The easiest way to create a Next app by running one command.
Stars: ✭ 65 (+35.42%)
Mutual labels:  build-tool
Flex-AntiCheat
Flex AntiCheat - Optimized Configs For Multiple AntiCheats
Stars: ✭ 37 (-22.92%)
Mutual labels:  configuration
aseprite-macos-buildsh
Automated script to create latest release app (either beta, or release whichever is newer) of Aseprite for macOS
Stars: ✭ 143 (+197.92%)
Mutual labels:  build-tool
sitri
Sitri - powerful settings & configs for python
Stars: ✭ 20 (-58.33%)
Mutual labels:  configuration
goreleaser-xx
Cross compilation helper for GoReleaser
Stars: ✭ 34 (-29.17%)
Mutual labels:  build-tool
millw
Mill Wrapper Script
Stars: ✭ 40 (-16.67%)
Mutual labels:  build-tool
runtime-config-loader
This is an Angular library that provides an easy way to load a configuration JSON file for runtime configuration.
Stars: ✭ 32 (-33.33%)
Mutual labels:  configuration
dotfiles
Linux configuration files (dotfiles) and some useful scripts
Stars: ✭ 22 (-54.17%)
Mutual labels:  configuration
GN-demo
Demonstrate building a C++ program with GN
Stars: ✭ 33 (-31.25%)
Mutual labels:  build-tool
rush-cli
⚡ A new and improved way of building MIT AI2 extensions.
Stars: ✭ 31 (-35.42%)
Mutual labels:  build-tool
cmake-d
cmake for D2
Stars: ✭ 57 (+18.75%)
Mutual labels:  build-tool
swift-declarative-configuration
Declarative configuration for your objects
Stars: ✭ 46 (-4.17%)
Mutual labels:  configuration
craftr
The core framework for the Craftr build system.
Stars: ✭ 1 (-97.92%)
Mutual labels:  build-tool
konfsave
Easy saving and switching between multiple KDE configurations.
Stars: ✭ 42 (-12.5%)
Mutual labels:  configuration
makeme
Embedthis MakeMe
Stars: ✭ 26 (-45.83%)
Mutual labels:  build-tool
leaflet-map-builder
gherardovarando.github.io/leaflet-map-builder/
Stars: ✭ 16 (-66.67%)
Mutual labels:  configuration
millwright
The easiest build tool you'll ever use.
Stars: ✭ 27 (-43.75%)
Mutual labels:  build-tool
config-webpack-plugin
💫 Merge one or more configuration files together with environment variables too.
Stars: ✭ 18 (-62.5%)
Mutual labels:  configuration
Dark Souls Config Utility
All-in-one installer and configuration UI for various mods/fixes for Dark Souls™: Prepare to Die Edition.
Stars: ✭ 27 (-43.75%)
Mutual labels:  configuration

About build-nginx

An nginx build tool to really simplify downloading and building specific versions of nginx with different core and 3rd-party modules.

Build Status

ngx_http_hello_world_module courtesy of perusio and kolesar-andras

TODO

  • Work with git urls
  • Work with archive urls (gzip & zipped tar releases)
  • Use PCRE2 (you can also still use PCRE 1) build-nginx will do the right thing based on the dependency url you provide:
  • build-nginx -d https://ftp.exim.org/pub/pcre/pcre-8.44.tar.gz will use the old PCRE library

  • build-nginx -d https://github.com/PCRE2Project/pcre2.git will use the official PCRE2 github repo

  • build-nginx -d https://github.com/PCRE2Project/[email protected] will build the PCRE2 release tagged pcre2-10.40

  • build-nginx -d https://sourceforge.net/projects/pcre/files/pcre2/10.37/pcre2-10.37.zip will use the 10.37 zip at the unofficial sourceforge mirror

  • Handle dynamic nginx modules
  • Provide different example configurations
  • Update README with notes about:
    • 64 bit MacOS Openssl builds
    • Use non-static Openssl on MacOS
    • How certain modules might implicitly enable the --with-http_ssl_module option
    • what takes precedence when you specify the same commandline option in a -k options file and on the commandline

Usage

Basic usage:

./build-nginx

Will git --depth 1 --single-branch clone the nginx master branch, configure and build it. Not so very useful...

Specific nginx version and OpenSSL dependency, with non-core module

How about getting nginx stable version 1.12.2 built with OpenSSL version 1.0.2l and HTTP/2 support?

./build-nginx \
-n https://github.com/nginx/[email protected] \
-d https://github.com/openssl/openssl.git@OpenSSL_1_0_2l \
-o --with-http_v2_module

Because you've specified OpenSSL as a dependency (-d) the nginx configure script automatically gets set with the --with-openssl= path.

The @ syntax lets you specify a release/tag/branch (or even specific commit - any tree-ish reference should work).

Here we're building nginx master with PCRE2 tagged at pcre2-10.40

build-nginx -d https://github.com/PCRE2Project/[email protected]

Building OpenSSL on 64bit macos

You'll need to export KERNEL_BITS=64 or call build-nginx like this:

KERNEL_BITS=64 ./build-nginx \
-n https://github.com/nginx/[email protected] \
-d https://github.com/openssl/openssl.git@OpenSSL_1_0_2l

Archive URLs as well as git repos

If you don't want to use a git repo, you can also use a source archive:

./build-nginx -n http://nginx.org/download/nginx-1.13.6.tar.gz \
              -d https://sourceforge.net/projects/pcre/files/pcre2/10.37/pcre2-10.37.zip \
              -d https://www.openssl.org/source/openssl-1.0.2l.tar.gz

3rd party modules

You can also specify 3rd party modules using the same git repo url @ version/tag/branch string or archive url format. In the following example we haven't specifed an nginx version, so we clone from master, but we do clone a forked version of the nginx-upstream-fair module at version 0.1.3

./build-nginx \
-m https://github.com/itoffshore/[email protected]

Because we've specified a module (-m) the nginx configure script is automatically called with the --add-module= option, pointing to where the module was cloned.

You could also use the official release archive URL:

./build-nginx \
-m https://github.com/itoffshore/nginx-upstream-fair/archive/0.1.3.zip

3rd party modules with a different config folder

Some nginx modules don't have the config file in their root, and in these cases you need to let the nginx configure script know where to find it. Do this with an optional folder name after the version; in the example below we're using the NAXSI project repository, specifying version 0.55.3 and letting the configure script know it needs to look in the NAXSI naxsi_src folder for the config file.

./build-nginx \
-n https://github.com/nginx/[email protected] \
-m https://github.com/nbs-system/[email protected],naxsi_src

Configuration files

As well as specifying the options to build-nginx on the command line, you can save them into a configuration file, and pass this to the script instead:

./build-nginx -k my-special-nginx-config

The config file is just a set of command-line options separated by newlines. Comments are permitted. Your my-special-nginx-config file might look like:

# nginx version 1.0
-n https://github.com/nginx/[email protected]
# it all lives in /opt/nginx
-o --prefix=/opt/nginx
-o --with-http_ssl_module # HTTPS
-o --with-debug # helps us debug location directive errors
# Use the OpenSSL in /opt
-o --with-cc-opt=-I/opt/openssl/include
-o --with-ld-opt=-L/opt/openssl/lib

Other options

Call with -h to see the full set of options you can use. Currently these are:

-b If you want to build from an existing source repo

-c If you only want to clone (download) and not build

-d <dependencies> Specify a git url and branch/tag/version for e.g. pcre

-h Help

-i Install. This will install to nginx's `configure` default location. To change,
pass the nginx `--prefix` option like this:

   build-nginx -i -o --prefix=/usr/local/nginx

-k <file> Specify which config file to read this script's arguments from.
          The config file is a text file in which command line arguments
          can be written which then will be used as if they were written
          on the actual command line.

-m <additional modules> Specify either an archive (.tar.gz, .tgz or .zip)
                        URL or a git url, branch/tag/version and optional src
                        folder where nginx looks for the module config file

-n <url> Optional nginx archive (.tar.gz, .tgz or .zip) URL or git repo url
         and/or optional branch/tag/version. Defaults to
         https://github.com/nginx/nginx.git@master. To specify just a
         branch/tag/version use @branch. To specify both, use git-url@branch

-o <options> To pass additional options to the nginx configure script

-s <build directory> The directory where this script will git clone
                     nginx and any modules and dependencies it needs
                     to build. Defaults to ~/.build-nginx
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].