Skip to content

Instantly share code, notes, and snippets.

@cokebar
Last active September 12, 2024 13:03
Show Gist options
  • Save cokebar/ac792ed732aca80d460c7eb28fc90237 to your computer and use it in GitHub Desktop.
Save cokebar/ac792ed732aca80d460c7eb28fc90237 to your computer and use it in GitHub Desktop.
A example script to build and install nginx with libressl instead of openssl
#!/bin/bash
set -e -o pipefail
latest_nginx=$(curl -L http://nginx.org/en/download.html | egrep -o "nginx\-[0-9.]+\.tar[.a-z]*" | head -n 1)
latest_libressl=$(curl -L http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ | egrep -o "libressl\-[0-9.]+\.tar\.gz" | tail -n 1)
(curl -fLRO "http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${latest_libressl}" && tar -xaf "${latest_libressl}") &
(curl -fLRO "http://nginx.org/download/${latest_nginx}" && tar -xaf "${latest_nginx}") &
wait
cd "${latest_nginx//.tar*}"
./configure \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-http_auth_request_module \
--with-threads \
--with-stream \
--with-stream_ssl_module \
--with-http_slice_module \
--with-mail \
--with-mail_ssl_module \
--with-file-aio \
--with-http_v2_module \
--with-openssl=../${latest_libressl//.tar*} \
--with-ld-opt=-lrt
make && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment