Skip to content

Instantly share code, notes, and snippets.

@beatfactor
Last active February 6, 2025 14:20
Show Gist options
  • Save beatfactor/a093e872824f770a2a0174345cacf171 to your computer and use it in GitHub Desktop.
Save beatfactor/a093e872824f770a2a0174345cacf171 to your computer and use it in GitHub Desktop.

Revisions

  1. beatfactor revised this gist Feb 16, 2021. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions install_nginx_macos_source.md
    Original file line number Diff line number Diff line change
    @@ -33,15 +33,15 @@ $ ./configure --with-pcre=../pcre-8.41/
    Download OpenSSL sources and extract:

    ```bash
    $ curl -OL https://www.openssl.org/source/openssl-1.1.0g.tar.gz
    $ tar xvzf openssl-1.1.0g.tar.gz && rm openssl-1.1.0g.tar.gz
    $ curl -OL https://www.openssl.org/source/openssl-1.1.0.tar.gz
    $ tar xvzf openssl-1.1.0.tar.gz && rm openssl-1.1.0.tar.gz
    ```

    Compile Nginx:

    ```sh
    $ cd ../nginx-1.12.2/
    $ ./configure --with-pcre=../pcre-8.41/ --with-http_ssl_module --with-openssl=/usr/local/src/openssl-1.1.0g
    $ ./configure --with-pcre=../pcre-8.41/ --with-http_ssl_module --with-openssl=/usr/local/src/openssl-1.1.0
    ```

    ## 4. Install Nginx
  2. beatfactor revised this gist Feb 22, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_nginx_macos_source.md
    Original file line number Diff line number Diff line change
    @@ -47,7 +47,7 @@ $ ./configure --with-pcre=../pcre-8.41/ --with-http_ssl_module --with-openssl=/u
    ## 4. Install Nginx

    ```bash
    $ make && make install
    $ [sudo] make && make install
    ```

    Add the nginx binary to `$PATH`:
  3. beatfactor revised this gist Feb 22, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion install_nginx_macos_source.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    # Install Nginx on Mac OS from source
    _no Homebrew required_

    ## 1. Download Nginx
    ```bash
    @@ -21,7 +22,7 @@ See the full list of `./configure` options: http://nginx.org/en/docs/configure.h
    $ cd nginx-1.12.2/
    ```

    ### Compile nginx without SSL support.
    ### Compile nginx without SSL support

    ```bash
    $ ./configure --with-pcre=../pcre-8.41/
  4. beatfactor revised this gist Feb 22, 2018. 1 changed file with 47 additions and 2 deletions.
    49 changes: 47 additions & 2 deletions install_nginx_macos_source.md
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,56 @@
    # Install Nginx on Mac OS from source

    ## 1. Download Nginx
    ```sh
    ```bash
    $ cd /usr/local/src
    $ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
    $ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
    ```

    ## 2. Download the PCRE library
    The PCRE library is required for the [http_rewrite_module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html):
    The PCRE library distribution (version 4.4 — 8.41) needs to be downloaded from the PCRE site and extracted. The rest is done by nginx’s ./configure and make. PCRE is required for the [http_rewrite_module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html), and also for regular expressions support in the location directive.

    ```bash
    $ curl -OL https://ftp.pcre.org/pub/pcre/pcre-8.41.tar.gz
    $ tar xvzf pcre-8.41.tar.gz && rm pcre-8.41.tar.gz
    ```
    ## 3. Configure Nginx
    See the full list of `./configure` options: http://nginx.org/en/docs/configure.html.

    ```sh
    $ cd nginx-1.12.2/
    ```

    ### Compile nginx without SSL support.

    ```bash
    $ ./configure --with-pcre=../pcre-8.41/
    ```

    ### with SSL support

    Download OpenSSL sources and extract:

    ```bash
    $ curl -OL https://www.openssl.org/source/openssl-1.1.0g.tar.gz
    $ tar xvzf openssl-1.1.0g.tar.gz && rm openssl-1.1.0g.tar.gz
    ```

    Compile Nginx:

    ```sh
    $ cd ../nginx-1.12.2/
    $ ./configure --with-pcre=../pcre-8.41/ --with-http_ssl_module --with-openssl=/usr/local/src/openssl-1.1.0g
    ```

    ## 4. Install Nginx

    ```bash
    $ make && make install
    ```

    Add the nginx binary to `$PATH`:

    ```bash
    export PATH="/usr/local/nginx/sbin:$PATH"
    ```
  5. beatfactor revised this gist Feb 22, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_nginx_macos_source.md
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,4 @@ $ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
    ```

    ## 2. Download the PCRE library
    The PCRE library is required for the (http://nginx.org/en/docs/http/ngx_http_rewrite_module.html)[http_rewrite_module]:
    The PCRE library is required for the [http_rewrite_module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html):
  6. beatfactor revised this gist Feb 22, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_nginx_macos_source.md
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,4 @@ $ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
    ```

    ## 2. Download the PCRE library
    The PCRE library is required for the `(http://nginx.org/en/docs/http/ngx_http_rewrite_module.html)[http_rewrite_module]`:
    The PCRE library is required for the (http://nginx.org/en/docs/http/ngx_http_rewrite_module.html)[http_rewrite_module]:
  7. beatfactor revised this gist Feb 22, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_nginx_macos_source.md
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,4 @@ $ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
    ```

    ## 2. Download the PCRE library
    The PCRE library is required for the `[http_rewrite_module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html)`:
    The PCRE library is required for the `(http://nginx.org/en/docs/http/ngx_http_rewrite_module.html)[http_rewrite_module]`:
  8. beatfactor revised this gist Feb 22, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion install_nginx_macos_source.md
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,7 @@
    $ cd /usr/local/src
    $ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
    $ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
    ```

    ## 2. Download the PCRE library
    The PCRE library is required for the `http_rewrite_module`:
    The PCRE library is required for the `[http_rewrite_module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html)`:
  9. beatfactor revised this gist Feb 22, 2018. 2 changed files with 10 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,3 +0,0 @@
    # Install Nginx on Mac OS from source

    ## 1. Download
    10 changes: 10 additions & 0 deletions install_nginx_macos_source.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    # Install Nginx on Mac OS from source

    ## 1. Download Nginx
    ```sh
    $ cd /usr/local/src
    $ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
    $ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz

    ## 2. Download the PCRE library
    The PCRE library is required for the `http_rewrite_module`:
  10. beatfactor created this gist Feb 22, 2018.
    3 changes: 3 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    # Install Nginx on Mac OS from source

    ## 1. Download