Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Nginx reverse proxy to build Tomcat

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

The steps of the experiment:

First, install the compressed package

Tar zxvf nginx-1.6.0.tar.gz-C / opt

Second, install the compilation environment

Yum install gcc gcc-c++ pcre-devel zlib-devel

Third, create administrative users

Useadd-M-s / sbin/nologin www

Note: / bin/false is the most strictly prohibited login option, all services are not available

/ sbin/nologin just does not allow system login, you can use other services such as ftp

IV. Compilation and installation

. / configure\

-- prefix=/usr/local/nginx\

-- user=www\

-- group=www\

-- with-file-aio\

-- with-http_stub_status_module\

-- with-http_gzip_static_module\

-- with-http_flv_module\

-- with-http_ssl_module

Make & & make install

-add tomcat service pool-

Vim / usr/local/nginx/conf/nginx.conf

# keepalive_timeout 0

Keepalive_timeout 65

# gzip on

Upstream tomcat_server {/ / scheduling pool

Server 192.168.218.128:8080 weight=1

Server 192.168.218.129:8080 weight=1

}

Server {

Listen 80

. Omit

Location / {

Root html

Index index.html index.htm

Proxy_pass http://tomcat_server; / / scheduling address

}

/ usr/local/nginx/sbin/nginx-t / / verify the configuration

V. start the service

/ usr/local/nginx/sbin/nginx

Service iptables stop

Setenforce 0

Content of the experiment:

First, install the compressed package

Second, install the compilation environment

Third, create administrative users

IV. Compilation and installation

-add tomcat service pool-

V. start the service

VI. Verification testing

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report