Download Nginx:wget http://nginx.org/download/nginx-1.8.0.tar.gz
Download Openssl:wget http://www.openssl.org/source/openssl-fips-2.0.9.tar.gz
Download Zlib:wget http://zlib.net/zlib-1.2.8.tar.gz
Download Pcre:wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
HTTP://PAN.BAIDU.COM/S/1QXZDVM0//Baidu network disk after the two URLs error please download the Web disk upload
----------------------------------------------------
Compiling the installation separately
[[email protected]] Tar zxvf openssl-fips-2.0.9.tar.gz
[[email protected]] CD openssl-fips-2.0.9
[[email protected]]./config && make && make install
----------------------------------------------------
[[email protected]] Tar zxvf pcre-8.36.tar.gz
[[email protected]] CD pcre-8.36
[[email protected]]./configure && make && make install
----------------------------------------------------
[Email Protected]]tar zxvf zlib-1.2.8.tar.gz
[[email protected]] CD zlib-1.2.8
[[email protected]]./configure && make && make install
----------------------------------------------------
[Email Protected]]tar zxvf nginx-1.8.0.tar.gz
[[email protected]] CD nginx-1.8.0
[[email protected]]./configure && make && make install
----------------------------------------------------
Start Nginx
[[email protected]]./usr/local/nginx/sbin/nginx
----------------------------------------------------
Simple test Nginx starts a tomcat on native boot
Configuring Nginx Configuration Files
[[email protected]] VI nginx.conf
Upstream mysvr{
#tomcat1 weighted polling Server127.0.0.1:8080weight=1;
#tomcat2 Server127.0.0.1:8081weight=2; } #keepalive_timeout0; Keepalive_timeout $; #gzip on; server {Listen7979; server_name localhost; #charset Koi8-R; #access_log logs/Host.access.log Main; Location/{root HTML; Index index.html index.htm;
#请求转向mysvr the list of servers defined Proxy_pass http://Mysvr;}
#nginx配置其他配置可参考http://www.cnblogs.com/knowledgesea/p/5199046.html
#同时启动俩个tomcat自行百度. To test the Nginx proxy, you can change the two Tomcat home pages to make a difference between which Tomcat.
Installing Nginx under Linux