In this tutorial we’ll install the Debian Linux 9 (squeeze), Apache 2 with mpm-itk (to run each web as a isolated user),...
Installing nginx from source with mail support
Ástþór IPnginx is a lightweight, high performance web server/reverse proxy and e-mail (SMTP/IMAP/POP3) proxy.
1. Install required packages
apt-get install build-essential autotools-dev debhelper libpcre3-dev zlib1g-dev libssl-dev
2. Receive the nginx source
apt-get source nginx
3. Enable the mail modules
cd nginx-x.x.x
pico debian/rules
Replace nginx-x.x.x with the correct folder created.
Add “–with-mail –with-mail_ssl_module” to the line starting with ./configure so that it looks something like this:
./configure $(CONFIGURE_OPTS) --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-mail --with-mail_ssl_module
4. Build the package
dpkg-buildpackage
5. Install the new nginx package
dpkg -i ../nginx_x.x.x-x.deb
Replace nginx_x.x.x-x.deb with the correct version and platform. In my case the filename is: nginx_0.6.32-3+lenny3_amd64.deb
6. Configure nginx
Next step is to configure the nginx rules. That’s outside the scope of this tutorial.