Skip to content

Instantly share code, notes, and snippets.

@ahmader
Last active October 10, 2020 18:01
Show Gist options
  • Save ahmader/93463bbe0dcca66e97e4fce2905614cf to your computer and use it in GitHub Desktop.
Save ahmader/93463bbe0dcca66e97e4fce2905614cf to your computer and use it in GitHub Desktop.
apt-get install libpcre3 zlib1g zlib1g-dev libxml2-dev libxslt1-dev python-dev libgd-dev libxml2-dev libxslt1-dev python-dev libgd-dev libgeoip-dev libssl-dev libpcre++-dev
nginx -t
cd /usr/src/
git clone https://github.com/vozlt/nginx-module-vts
cd nginx-module-vts/
cd /usr/src/
wget https://nginx.org/download/nginx-1.14.0.tar.gz
tar xf nginx-1.14.0.tar.gz
cd nginx-1.14.0/
nginx -V 2>&1 | egrep "^configure" | cut -d: -f2 > /tmp/nginx_build_options.txt
sh -c "./configure $(cat /tmp/nginx_build_options.txt) --with-compat --add-dynamic-module=../nginx-module-vts/"
make
# sudo cp objs/ngx_http_vhost_traffic_status_module.so /usr/share/nginx/modules/
make install
rm /usr/sbin/nginx && cp objs/nginx /usr/sbin/nginx
echo "load_module modules/ngx_http_vhost_traffic_status_module.so;" > /usr/share/nginx/modules-available/mod-vhost-traffic.conf
ln -s /usr/share/nginx/modules-available/mod-vhost-traffic.conf /etc/nginx/modules-enabled/mod-vhost-traffic.conf
## certbot
sudo snap install --classic certbot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment