注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Computer Science

I Pressed My Words Here. Will You Read ?

 
 
 

日志

 
 

tomcat 动态指定启动端口  

2013-09-05 11:01:55|  分类: Tips |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

基于此文:tomcat 中启动/停止 指定项目配置 http://computerscience.blog.163.com/blog/static/1749623432012102894736137/
中脚本升级。
startupmy.sh
#!/bin/sh

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# -----------------------------------------------------------------------------
# Start script for the startup script of CATALINA Server
#
# $Id: startupmy.sh 000000 2013-1-7 11:30:17 $
# -----------------------------------------------------------------------------
PRG="$0"
PRGDIR=`dirname "$PRG"`
SERVERNAME="$1"
SERVERCONFIGDIR="$PRGDIR"/".."/"conf"/"server-$SERVERNAME.xml"
case "$2" in
	"") echo "use default port" ;;
	*) 
		STARTUPPORT=$2 ;
		SHUTDOWNPORT=`expr $STARTUPPORT - 75` ;
		AJPPORT=`expr $SHUTDOWNPORT + 40` ;
		sed -i "s/\(Server\ port=\"\).*\(\"\ shutdown=\"SHUTDOWN\"\)/\1$SHUTDOWNPORT\2/g" $SERVERCONFIGDIR ;
		sed -i "s/\(Connector\ port=\"\).*\(\"\ protocol=\"HTTP\/1.1\"\)/\1$STARTUPPORT\2/g" $SERVERCONFIGDIR ;
		sed -i "s/\(Connector\ port=\"\).*\(\"\ protocol=\"AJP\/1.3\"\)/\1$AJPPORT\2/g" $SERVERCONFIGDIR ;;
esac
exec "$PRGDIR"/"startup.sh" start "-config" $SERVERCONFIGDIR

END
  评论这张
 
阅读(275)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017