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进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
数据库国产化替代深化:DBA的机遇与挑战
代晓磊
1276次阅读
2025-04-27 16:53:22
2025年4月国产数据库中标情况一览:4个千万元级项目,GaussDB与OceanBase大放异彩!
通讯员
753次阅读
2025-04-30 15:24:06
国产数据库需要扩大场景覆盖面才能在竞争中更有优势
白鳝的洞穴
620次阅读
2025-04-14 09:40:20
【活动】分享你的压箱底干货文档,三篇解锁进阶奖励!
墨天轮编辑部
524次阅读
2025-04-17 17:02:24
一页概览:Oracle GoldenGate
甲骨文云技术
486次阅读
2025-04-30 12:17:56
GoldenDB数据库v7.2焕新发布,助力全行业数据库平滑替代
GoldenDB分布式数据库
476次阅读
2025-04-30 12:17:50
优炫数据库成功入围新疆维吾尔自治区行政事业单位数据库2025年框架协议采购!
优炫软件
365次阅读
2025-04-18 10:01:22
给准备学习国产数据库的朋友几点建议
白鳝的洞穴
337次阅读
2025-05-07 10:06:14
XCOPS广州站:从开源自研之争到AI驱动的下一代数据库架构探索
韩锋频道
301次阅读
2025-04-29 10:35:54
国产数据库图谱又上新|82篇精选内容全览达梦数据库
墨天轮编辑部
282次阅读
2025-04-23 12:04:21