Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save blikenoother/7785364 to your computer and use it in GitHub Desktop.
Save blikenoother/7785364 to your computer and use it in GitHub Desktop.
Install 3rd party module and build NGINX debian (.deb) package. Following is guide for nginx_upstream_check_module
#Install dpkg-dev and package dependencies
sudo apt-get install dpkg-dev
sudo apt-get install software-properties-common
sudo apt-get install python-software-properties
sudo apt-get install init-system-helpers
#Add repository:
sudo add-apt-repository ppa:nginx/stable
#Edit /etc/apt/sources.list.d/nginx-stable-lucid.list, add dpkg-src (no need if ubuntu verson >= 12.04):
deb http://ppa.launchpad.net/nginx/stable/ubuntu lucid main
deb-src http://ppa.launchpad.net/nginx/stable/ubuntu lucid main
#Resynchronize the package index files:
sudo apt-get update
#Get sources:
apt-get source nginx
#Build dependencies (https://launchpad.net/ubuntu/precise/+source/nginx):
sudo apt-get build-dep nginx
sudo apt-get install libgd2-noxpm-dev
#Compile module:
#download module from here https://github.com/yaoweibin/nginx_upstream_check_module
cd /path/to/NGINX
patch -p1 < /root/nginx_upstream_check_module/check_1.2.6+.patch
./configure --add-module=/root/nginx_upstream_check_module
make
make install
#add following line to rules file (/path/to/NGINX/debian/rules)
config.status.full: config.env.full
...
--add-module=path/to/nginx_uploadprogress_module #copy space from other module path and add \ at end like other module path
#Build package:
cd /path/to/NGINX
dpkg-buildpackage -b
#Packages(.deb) files will be created at / location (not in the NGINX source directory)
#Install packages:
dpkg --install nginx-common_*.deb
dpkg --install nginx-full_*.deb
#Check list of installed module
nginx -V
@phpony
Copy link

phpony commented Aug 31, 2024

Why there's make install here in the middle? If we're building and installing deb, shouldn't we skip this manual install step?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment