首先先登录到我们的服务器(连接服务器输入帐号密码省略)
之后查看服务器根目录的文件和文件夹,进入我们的项目所在路径(tomcat中)
cd /usr/local/eleph-recovery-test/webapps
这里就是tomcat 的webapps文件夹内,其中Root文件夹内就是我们的项目,而Root_2017XXXX.zip是之前的版本,我们为了安全先将我们的Root压缩备份一份(压缩的目的现在主要是为了下载传输)
zip -r ROOT_20170922.zip ROOT (这么命名可以知道是什么时候发布的项目)
之后再把我们压缩的项目下载下来
sz -y ROOT_20170922.zip 下载
下载后的下载路径在:
就是在你的我的文档-下载中
或者是从C盘进入
这个Adminisrator是我系统的用户名,这个名字依电脑而不同
之后打开我们就可以看到我们的项目了,一般的项目发布都是改了少部分东西,比如说你改了CSS,改了JS,或者改了HTML,JSP,JAVA ,XML等等,
你改了哪个就可以把哪个文件进行替换,之后再将其打包,这部工作做好之后就准备上传服务器了
rz -y 上传
选择你要上传的文件
上传过后使用 ll命令查看是否已经上传
上传完成后我们需要先关闭Tomcat
bin/shutdown.sh 关闭tomcat
关闭了tomcat 我们的项目可能还没有停止运行,这时我们打开一个新的窗口,
查看我们被占用的端口号
ps -ef|grep tomcat
Last login: Fri Sep 22 09:20:17 2017 from 36.106.129.220
[root@bender ~]# ps -ef|grep tomcat
root 6006 1 1 Sep18 ? 01:06:17 /usr/java/default/bin/java -Djava.util.logging.config.file=/usr/local/eleph-recovery-test/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/eleph-recovery-test/endorsed -classpath /usr/local/eleph-recovery-test/bin/bootstrap.jar:/usr/local/eleph-recovery-test/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/eleph-recovery-test -Dcatalina.home=/usr/local/eleph-recovery-test -Djava.io.tmpdir=/usr/local/eleph-recovery-test/temp org.apache.catalina.startup.Bootstrap start
zcnet 25878 1 0 Apr18 ? 05:05:42 /data/zcnet/jdk1.8.0_121/jre/bin/java -Djava.util.logging.config.file=/data/zcnet/apache-tomcat-8.0.14/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/data/zcnet/apache-tomcat-8.0.14/endorsed -classpath /data/zcnet/apache-tomcat-8.0.14/bin/bootstrap.jar:/data/zcnet/apache-tomcat-8.0.14/bin/tomcat-juli.jar -Dcatalina.base=/data/zcnet/apache-tomcat-8.0.14 -Dcatalina.home=/data/zcnet/apache-tomcat-8.0.14 -Djava.io.tmpdir=/data/zcnet/apache-tomcat-8.0.14/temp org.apache.catalina.startup.Bootstrap start
root 36109 1 0 May25 ? 03:56:12 /usr/java/default/bin/java -Djava.util.logging.config.file=/usr/local/eleph-monitorcenter-tomcat-8.0.24/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/eleph-monitorcenter-tomcat-8.0.24/endorsed -classpath /usr/local/eleph-monitorcenter-tomcat-8.0.24/bin/bootstrap.jar:/usr/local/eleph-monitorcenter-tomcat-8.0.24/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/eleph-monitorcenter-tomcat-8.0.24 -Dcatalina.home=/usr/local/eleph-monitorcenter-tomcat-8.0.24 -Djava.io.tmpdir=/usr/local/eleph-monitorcenter-tomcat-8.0.24/temp org.apache.catalina.startup.Bootstrap start
root 37460 1 1 May25 ? 1-10:17:16 /usr/java/default/bin/java -Djava.util.logging.config.file=/usr/local/eleph-partner-tomcat-8.0.24/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/eleph-partner-tomcat-8.0.24/endorsed -classpath /usr/local/eleph-partner-tomcat-8.0.24/bin/bootstrap.jar:/usr/local/eleph-partner-tomcat-8.0.24/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/eleph-partner-tomcat-8.0.24 -Dcatalina.home=/usr/local/eleph-partner-tomcat-8.0.24 -Djava.io.tmpdir=/usr/local/eleph-partner-tomcat-8.0.24/temp org.apache.catalina.startup.Bootstrap start
root 57476 1 0 Apr07 ? 03:46:37 /usr/java/default/bin/java -Djava.util.logging.config.file=/usr/local/eleph-admin-apache-tomcat-8.0.24/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/eleph-admin-apache-tomcat-8.0.24/endorsed -classpath /usr/local/eleph-admin-apache-tomcat-8.0.24/bin/bootstrap.jar:/usr/local/eleph-admin-apache-tomcat-8.0.24/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/eleph-admin-apache-tomcat-8.0.24 -Dcatalina.home=/usr/local/eleph-admin-apache-tomcat-8.0.24 -Djava.io.tmpdir=/usr/local/eleph-admin-apache-tomcat-8.0.24/temp org.apache.catalina.startup.Bootstrap start
root 68469 1 0 May17 ? 03:06:44 /usr/java/default/bin/java -Djava.util.logging.config.file=/usr/local/gome/bm-apache-tomcat-7.0.57/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/gome/bm-apache-tomcat-7.0.57/endorsed -classpath /usr/local/gome/bm-apache-tomcat-7.0.57/bin/bootstrap.jar:/usr/local/gome/bm-apache-tomcat-7.0.57/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/gome/bm-apache-tomcat-7.0.57 -Dcatalina.home=/usr/local/gome/bm-apache-tomcat-7.0.57 -Djava.io.tmpdir=/usr/local/gome/bm-apache-tomcat-7.0.57/temp org.apache.catalina.startup.Bootstrap start
root 68647 1 0 May17 ? 05:39:33 /usr/java/default/bin/java -Djava.util.logging.config.file=/usr/local/gome/developer-apache/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/gome/developer-apache/endorsed -classpath /usr/local/gome/developer-apache/bin/bootstrap.jar:/usr/local/gome/developer-apache/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/gome/developer-apache -Dcatalina.home=/usr/local/gome/developer-apache -Djava.io.tmpdir=/usr/local/gome/developer-apache/temp org.apache.catalina.startup.Bootstrap start
root 219420 1 0 May10 ? 03:21:48 /usr/java/default/bin/java -Djava.util.logging.config.file=/usr/local/gome/public-api-apache-tomcat-7.0.57/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/gome/public-api-apache-tomcat-7.0.57/endorsed -classpath /usr/local/gome/public-api-apache-tomcat-7.0.57/bin/bootstrap.jar:/usr/local/gome/public-api-apache-tomcat-7.0.57/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/gome/public-api-apache-tomcat-7.0.57 -Dcatalina.home=/usr/local/gome/public-api-apache-tomcat-7.0.57 -Djava.io.tmpdir=/usr/local/gome/public-api-apache-tomcat-7.0.57/temp org.apache.catalina.startup.Bootstrap start
root 224661 224331 0 09:33 pts/4 00:00:00 grep tomcat
看一看我们的项目是否还在运行,我们这里发现我们的项目正在运行,之后找到他对应的端口号
使用
kill -9 端口号 杀死该进程
之后重复刚才的命令,看看该项目是否还在运行,如果没有了那么就可以返回原来的窗口继续执行我们的后续操作
首先我们要删除Root文件夹
rm -rf ROOT
之后我们要解压我们刚才上传上来的zip
unzip ROOT_20170922.zip 解压
最后我们要进入tomcat的bin目录startup我们的tomcat
tail -f logs/catalina.out
这个命令是查看tomcat 的运行情况