- 环境安装
- tomcat
- 启动
- nginx
- 配置
- 启动
- 访问
tomcat7+jdk1.8+ngnix1.13.7虚拟机centos测试 环境安装
| 项目 | 安装路径 | |
|---|---|---|
| nginx-1.13.7.tar.gz | /usr/local/nginx/ | |
| tomcat7 | /home/max/application/apache-tomcat-jtperson/ | tomcat 内配置jre {tomcat_home}/bin/catalina.sh JRE_HOME=“/home/application/jre1.8.0_271” |
| jre1.8 | /home/max/application/jre1.8.0_271/ |
链接:https://pan.baidu.com/s/11exp41MVAjZnOtwGX6CDFg
提取码:8888
将app(编译后的应用)解压 放到{tomcat_home} /webapps/里,访问:http://ip:端口/项目名/
# 启动tomcat
[root@maxvpc ]#{tomcat_home}/bin/startup.sh
# 查询进程
[root@maxvpc ]# ps -ef |grep tomcat
# 关闭tomcat
[root@maxvpc ]# /{tomcat_home}/bin/shutdown.sh
nginx
配置
{nginx_home}/conf/nginx.conf 配置负载均衡、动静分离
#gzip on;
upstream test {
server localhost:8585;
server localhost:8586;
}
server {
listen 80;
server_name localhost;
#client_max_body_size 1024M;
location / {
//负载均衡
proxy_pass http://test;
#proxy_set_header Host $host:$server_port;
}
# 图片访问
location ~ .(gif|jpg|png|svg)$ {
root data/images;
}
}
启动
# 启动
[root@maxvpc ]#{ngnix_home}/start nginx
# 刷新重启
[root@maxvpc ]#{ngnix_home}/nginx -s reload
# 关闭
[root@maxvpc ]#{ngnix_home}/nginx -s stop
# liunx查看进程
[root@maxvpc nginx]# ps -ef |grep nginx
# windows 查看进程
[root@maxvpc ]#{ngnix_home}/tasklist /fi "imagename eq nginx.exe"
# windows 杀死进程
[root@maxvpc ]#{ngnix_home}/tskill nginx
访问
| nginx | 默认启动访问 http://10.10.32.22:8089/ | |
| 影像件存放位置 | {nginx_home}/data/images/xerox/EasyScan/aa.png | 启动访问图片 http://10.10.32.22/xerox/EasyScan/aa.png |



