项目打包 tomcat部署

IDE: IDEA

1、项目maven管理先执行 clean,再执行 compile
2、如果编译compile不成功,则将 C:UsersAdministrator.m2 epositorycncommsoftsmartcity 目录下的所有文件删除,然后执行install
3、web项目打包,注意,在此之前要先修改配置文件
4、打开Linux连接工具
5、点击连接按钮
6、输入地址,用户名密码:bmsoft
7、打开命令界面
8、输入对应Linux命令
Last login: Tue Jun 21 11:51:20 2016 from 192.168.25.53
[bmsoft@localhost ~]$ pwd
/home/bmsoft
[bmsoft@localhost ~]$ ls
app  database  logs
[bmsoft@localhost ~]$ cd /home/bmsoft/app/apache-tomcat-survey/webapps
[bmsoft@localhost webapps]$ cd ..
[bmsoft@localhost apache-tomcat-survey]$ cd bin
[bmsoft@localhost bin]$ sh startup.sh
Using CATALINA_BASE:   /home/bmsoft/app/apache-tomcat-survey
Using CATALINA_HOME:   /home/bmsoft/app/apache-tomcat-survey
Using CATALINA_TMPDIR: /home/bmsoft/app/apache-tomcat-survey/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /home/bmsoft/app/apache-tomcat-survey/bin/bootstrap.jar:/home/bmsoft/app/apache-tomcat-survey/bin/tomcat-juli.jar
Tomcat started.
[bmsoft@localhost bin]$ sh shutdown.sh
Using CATALINA_BASE:   /home/bmsoft/app/apache-tomcat-survey
Using CATALINA_HOME:   /home/bmsoft/app/apache-tomcat-survey
Using CATALINA_TMPDIR: /home/bmsoft/app/apache-tomcat-survey/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /home/bmsoft/app/apache-tomcat-survey/bin/bootstrap.jar:/home/bmsoft/app/apache-tomcat-survey/bin/tomcat-juli.jar
[bmsoft@localhost bin]$ tail -f ../logs/catalina.out
?                      org.apache.catalina.loader.WebappClas
sLoa: The web application [/survey] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassFactory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@4cd01018]) and a value of type [java.util.WeakHashMap] (value [{class cn.com.bmsoft.smartcity.services.privileges.priv.jaxws_asm.GetPrivilegesByUserResponse=java.lang.ref.WeakReference@3b4e83b4, class cn.com.bmsoft.smartcity.services.privileges.priv.Privilege=java.lang.ref.WeakReference@1fa8bcd7, class java.util.ArrayList=java.lang.ref.WeakReference@7f05d77d}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
?                      org.apache.coyote.AbstractProtocol stop 21, 2016 4:51:57 涓?
淇℃? Stopping ProtocolHandler ["http-bio-8082"]
?                      org.apache.coyote.AbstractProtocol stop 21, 2016 4:51:57 涓?
淇℃? Stopping ProtocolHandler ["ajp-bio-8029"]
?                      org.apache.coyote.AbstractProtocol destroy, 2016 4:51:57 涓?
淇℃? Destroying ProtocolHandler ["http-bio-8082"]
?                      org.apache.coyote.AbstractProtocol destroy, 2016 4:51:57 涓?
淇℃? Destroying ProtocolHandler ["ajp-bio-8029"]
 
[bmsoft@localhost bin]$ rm -rf ../webapps/survey
[bmsoft@localhost bin]$ rm -rf ../work/Catalina/localhost/survey
[bmsoft@localhost bin]$ pwd
/home/bmsoft/app/apache-tomcat-survey/bin
[bmsoft@localhost bin]$ sh startup.sh
Using CATALINA_BASE:   /home/bmsoft/app/apache-tomcat-survey
Using CATALINA_HOME:   /home/bmsoft/app/apache-tomcat-survey
Using CATALINA_TMPDIR: /home/bmsoft/app/apache-tomcat-survey/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /home/bmsoft/app/apache-tomcat-survey/bin/bootstrap.jar:/home/bmsoft/app/apache-tomcat-survey/bin/tomcat-juli.jar
Tomcat started.
[bmsoft@localhost bin]$ tail -f ../logs/catalina.out
Jun 21, 2016 4:58:36 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/bmsoft/app/apache-tomcat-survey/webapps/examples
Jun 21, 2016 4:58:36 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /home/bmsoft/app/apache-tomcat-survey/webapps/examples has finished in 119 ms
Jun 21, 2016 4:58:36 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8082"]
Jun 21, 2016 4:58:36 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8029"]
Jun 21, 2016 4:58:36 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 28810 ms
 
pwd 查看当前目录
ls 查看当前文件
。。。。。
ps -aux | grep apache-tomcat-survey 查看所有关键字“apache-tomcat-survey”进程
kill -9  13985
 
/home/bmsoft/app/apache-tomcat-survey/logs 的catalina.out(系统日志)
ssh下载文件位置:
C:UsersAdministratorAppDataRoamingSSH emp
 
.代表当前目录下执行sh命令
./bin/startup.sh &  tail -f logs/catalina.out
 
9、发送邮件通知测试组
 





原文地址:https://www.cnblogs.com/samwang88/p/3b9739e2249dc2b9a9aff863db7f1da0.html