文章目录
- 一、软件安装验证
- 1. Linux安装nginx
- 2. Tomcat10 下载和配置 Linux 环境
- 3. 服务器部署
- 二、软件安装验证
- 2.1. 启动tomcat
- 2.2. nginx配置
- 2.3. 关键配置
- 2.4. 启动nginx
- 2.5. 测试验证
一、软件安装验证
1. Linux安装nginx
https://blog.csdn.net/weixin_40816738/article/details/119536779
2. Tomcat10 下载和配置 Linux 环境
https://blog.csdn.net/weixin_40816738/article/details/90391526
3. 服务器部署
系统版本 | ip | 部署应用 | 应用版本 |
---|---|---|---|
centos7.7 | 192.168.159.101 | nginx | 1.9.9 |
centos7.7 | 192.168.159.102 | tomcat | 10 |
centos7.7 | 192.168.159.103 | tomcat | 10 |
centos7.7 | 192.168.159.104 | tomcat | 10 |
二、软件安装验证
2.1. 启动tomcat
2.2. nginx配置
worker_processes 1;
events {worker_connections 1024;
}http {include mime.types;default_type application/octet-stream;sendfile on;keepalive_timeout 65;upstream tomcat-cluster {server 192.168.159.102:8080; server 192.168.159.103:8080; server 192.168.159.104:8080; }
server {listen 80;server_name 192.168.159.101;location / {proxy_pass http://tomcat-cluster; }error_page 500 502 503 504 /50x.html;location = /50x.html {root html;}}
}
2.3. 关键配置
upstream tomcat-cluster {server 192.168.159.102:8080; server 192.168.159.103:8080; server 192.168.159.104:8080; }
server {listen 80;server_name 192.168.159.101;location / {proxy_pass http://tomcat-cluster; }
2.4. 启动nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf