Browser to Http://nginx.org/en/download.html
Download stable version of Nginx, such as nginx-1.10.1.tar.gz, which is an nginx source package, need to be compiled and installed to use.
Decompression command: TAR–ZXVF nginx-1.10.1.tar.gz
CD Nginx Extract directory:./configure command
Issue one: gcc and gcc++ compilers are not installed
./configure:error:c compiler cc is not found
FIX: Install gc++
sudo apt-get install gcc
sudo apt-get install gcc++
Issue two: HTTP module missing prce regular expression library
./configure:error:the HTTP Rewrite module requires the PCRE library.
You can either disable the module by using--without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
Statically from the source with Nginx by using--with-pcre=<path> option.
Workaround: Install the Pcre library
sudo apt-get install libpcre3 Libpcre3-dev
Issue three: HTTP gzip module missing zlib Library
./configure:error:the HTTP gzip module requires the Zlib library.
You can either disable the module by using--without-http_gzip_module
option, or install the Zlib library into the system, or build the Zlib library
Statically from the source with Nginx by using--with-zlib=<path> option.
Workaround: Install the zlib library
$ sudo apt-get install zlib1g
$ sudo apt-get install Zlib1g.dev
Again:./configure
Compiling make
Install make install
Enter the Nginx installation directory
cd/usr/local/
LS can see nginx, it means that Nginx installed on Ubuntu successfully
Enter Cd/usr/local/nginx/sbin
sudo./nginx start Nginx
If Nginx does not start successfully, it is likely that 80 port is occupied, replace the port (edit conf/nginx.conf file 80 to 81)
http://localhost
ubuntu15.10_x64 Installing Nginx