Build Nginx on Ubuntu - Adding SPDY, Updating Nginx, OpenSSL, PCRE
Keeping up with server updates can be complicated and time consuming, but its importance can't be overstated. Recent attacks against OpenSSL have necessitated emergency patches from the OpenSSL team. The latest OpenSSL version, 1.0.1j, patches recently discovered vulnerabilities, so we are updating to the latest version of OpenSSL. Note that the latest version of Nginx also supports building with BoringSSL and LibreSSL if you prefer those libraries.
The latest version of Nginx (1.7.7) fixes many bugs since our last refresh (1.5.6) and also adds support for SPDY v 3.1, which we will add with the --with-http_spdy_module switch on the command line.
Here is a simple set of instructions for building the latest Nginx from source on Ubuntu.
1. Download the following source files:
2. Verify file checksums.
3. Copy the files to your Ubuntu server and extract the source code from the tarballs.
4. Follow the commands below:
$ cd nginx-1.7.7 $ sudo ./configure --with-openssl=/home/<user>/openssl-1.0.1j --with-pcre=/home/<user>/pcre-8.36 --with-pcre-jit --with-zlib=/home/<user>/zlib-1.2.8 --with-http_ssl_module --with-http_gzip_static_module --with-http_spdy_module $ sudo make $ sudo make install
The build will take a few minutes to complete, depending on your hardware. The resulting Nginx install will have support for SSL, gzip, regular expressions, and SPDY, giving you a fast and secure web server installation.