Installing Nginx under Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.