web工程配置历程脚本
web工程配置过程脚本
web工程配置过程
10.10.72.145
1、cd /opt/cafe/
cp -r tomcat6.0/ tomcat-techreport/
2、vi /opt/cafe/tomcat-techreport/conf/server.xml
<Server port="8105" shutdown="SHUTDOWN">
<Connector connectionTimeout="20000" port="8180" protocol="HTTP/1.1" redirectPort="8143" URIEncoding="UTF-8"/>
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8109" protocol="AJP/1.3" redirectPort="8143"/>
<Context docBase="/data/cafe/webapps/ddshow-techreport" path="" reloadable="true"/>
3、配置nginx
cd /etc/nginx/conf.d/
touch ddshow-techreport.conf
-------------------------------------------
server {
listen 80;
server_name *.lftechreport.com;
location / {
proxy_pass http://www.lftechreport.com:8180/;
}
}
--------------------------------------------
4、创建编译脚本
mkdir /opt/cafe/deploy-techreport/
update.sh,编译构建 启动tomcat
启动命令
update.sh
1107
5、修改vim catalina.sh
CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8181 -Dspring.profiles.active=test"
6、在tomcat下查看Catalina.out的日志
web工程配置过程
10.10.72.145
1、cd /opt/cafe/
cp -r tomcat6.0/ tomcat-techreport/
2、vi /opt/cafe/tomcat-techreport/conf/server.xml
<Server port="8105" shutdown="SHUTDOWN">
<Connector connectionTimeout="20000" port="8180" protocol="HTTP/1.1" redirectPort="8143" URIEncoding="UTF-8"/>
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8109" protocol="AJP/1.3" redirectPort="8143"/>
<Context docBase="/data/cafe/webapps/ddshow-techreport" path="" reloadable="true"/>
3、配置nginx
cd /etc/nginx/conf.d/
touch ddshow-techreport.conf
-------------------------------------------
server {
listen 80;
server_name *.lftechreport.com;
location / {
proxy_pass http://www.lftechreport.com:8180/;
}
}
--------------------------------------------
4、创建编译脚本
mkdir /opt/cafe/deploy-techreport/
update.sh,编译构建 启动tomcat
#!/bin/bash cd /opt/cafe/deploy-techreport/source/ddshow echo "请输入要测试的版本号(dev-xxx),输入xxx部分,不输入默认dev-1103.2:" read STATICNO if [ "$STATICNO"x = ""x ] then STATICNO="dev-1103.2" else STATICNO=dev-${STATICNO} fi git fetch git checkout --track origin/${STATICNO} git checkout ${STATICNO} git pull --rebase && cd /opt/cafe/deploy-techreport/source/ddshow/ddshow-techreport/ && /opt/cafe/maven3.0/bin/mvn -U clean install -Dmaven.test.skip=true if [ $? -ne 0 ];then echo "更新本地代码失败......" exit 1 fi cd /data/cafe/webapps/ddshow-techreport/ rm -fr ./* cp -r /opt/cafe/deploy-techreport/source/ddshow/ddshow-techreport/target/ddshow-techreport-0.0.1-SNAPSHOT/* ./ if [ -f "/opt/cafe/tomcat-techreport/temp/tomcat.pid" ];then kill -9 `cat /opt/cafe/tomcat-techreport/temp/tomcat.pid` rm -f /opt/cafe/tomcat-techreport/temp/tomcat.pid else echo "不存在/opt/cafe/tomcat-techreport/temp/tomcat.pid" exit 1 fi sh /opt/cafe/tomcat-techreport/bin/startup.sh > /dev/null if [ $? -ne 0 ];then echo "tomcat服务器启动失败" exit 1 else echo "服务器启动成功" exit 0 fi
启动命令
update.sh
1107
5、修改vim catalina.sh
CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8181 -Dspring.profiles.active=test"
6、在tomcat下查看Catalina.out的日志