部署java项目_部署java新项目

java源码部署总结:

环境:nginx+tomcat

部署方式:源码部署

源码目录

/chroot2/test/schedule 目录下面就是所有源码了

tomcat

位置: /usr/local/tomcat/apache-tomcat-scheduleweb-test

主要配置文件server.xml

directory="logs" prefix="schedule-web-test.cn-access_log." suffix=".log"

pattern="common" resolveHosts="false"/>

主要注意: 的配置

nginx配置

upstream配置:

upstream tomcat_schedule_web_test{

server localhost:8291 weight=10;

}

server配置:

server

{

listen 80;

server_name test.schedule.toys178.com;

index index.jsp index.htm index.php;

root /chroot2/test;

fastcgi_connect_timeout 600;

fastcgi_send_timeout 600;

fastcgi_read_timeout 600;

location /schedule {

proxy_pass http://tomcat_schedule_web_test;

}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|apk|tar.gz)$

{

expires 30d;

}

location ~ .*\.(js|css)?$

{

expires 12h;

}

access_log /chroot/wwwlogs/tomcat_schedule_web_test-access.log access;

}

部署方式:war包部署

war包目录

/chroot2/test/schedule 目录下面放的是war包,如:ScheduleManage.war

tomcat

位置: /usr/local/tomcat/apache-tomcat-scheduleweb-test

主要配置文件server.xml

directory="logs" prefix="schedule-web-test.cn-access_log." suffix=".log"

pattern="common" resolveHosts="false"/>

主要注意: 的配置

nginx配置

upstream配置:

upstream tomcat_schedule_web_test{

server localhost:8291 weight=10;

}

server配置:

server

{

listen 80;

server_name test.schedule.toys178.com;

index index.jsp index.htm index.html;

root /chroot2/test;

location /schedule {

proxy_pass http://tomcat_schedule_web_test;

}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|apk|tar.gz)$

{

expires 30d;

}

location ~ .*\.(js|css)?$

{

expires 12h;

}

access_log /chroot/wwwlogs/tomcat_schedule_web_test-access.log access;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值