暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Nginx+tomcat部署

毫末之木 2017-07-25
446
java源码部署总结:
环境:nginx+tomcat
部署方式:源码部署

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

2 tomcat  位置: /usr/local/tomcat/apache-tomcat-test  主要配置文件server.xml  <Host name="localhost" appBase="/test/schedule" deployOnStartup ="false" autoDeploy="false" unpackWARs="true"> <Context path="/schedule" docBase="."/> <Valve className="org.apache.catalina.valves.AccessLogValve"                   directory="logs" prefix="schedule-web-test.cn-access_log." suffix=".log"                   pattern="common" resolveHosts="false"/> </Host>   主要注意: <Context path="/schedule" docBase="."/>的配置

3 nginx配置  upstream配置:  upstream tomcat_schedule_test{      server localhost:8090 weight=10;  }  server配置:        server        {                listen       80;                server_name test.schedule.com;                index index.jsp index.htm;                root /test;                fastcgi_connect_timeout 600;                fastcgi_send_timeout 600;                fastcgi_read_timeout 600;                location /schedule {                          proxy_pass http://tomcat_schedule_test;                }                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|apk|tar.gz)$                {                                expires      30d;                }                location ~ .*\.(js|css)?$                {                                expires      12h;                }                access_log  /chroot/wwwlogs/tomcat_schedule_test-access.log  access;        } 部署方式:war包部署
 
1 war包目录  /test/schedule 目录下面放的是war包,如:ScheduleManage.war

2 tomcat
位置
: /usr/local/tomcat/apache-tomcat-test 主要配置文件server.xml  

<Host name="localhost" appBase="/test/schedule" deployOnStartup ="false" autoDeploy="false" unpackWARs="true"> <Context path="/schedule" docBase="ScheduleManage.war"/> <Valve className="org.apache.catalina.valves.AccessLogValve"                directory="logs" prefix="schedule-web-test.cn-access_log." suffix=".log"                   pattern="common" resolveHosts="false"/> </Host>   主要注意: <Context path="/schedule" docBase="ScheduleManage.war"/>的配置

3 nginx配置  upstream配置:  upstream tomcat_schedule_test{      server localhost:8090 weight=10;  }  server配置:  server  {    listen       80;    server_name test.schedule.com;    index index.jsp index.htm index.html;    root /chroot2/test;    location /schedule {              proxy_pass http://tomcat_schedule_test;    }    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|apk|tar.gz)$    {          expires      30d;    }    location ~ .*\.(js|css)?$    {          expires      12h;    }    access_log  /chroot/wwwlogs/tomcat_schedule_test-access.log  access;  }
复制


文章转载自毫末之木,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论