Jenkins 部署项目到远端的TOMCAT下
1. 首先检查LINUX的版本是86还是64位的,使用命令:getconf LONG_BIT
2. 然后是下载JDK1.7的版本安装到LINUX上,下载地址:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
3. 其次是安装到Linux上面
1)找到/etc/profile.d/java.sh 看JAVA_HOME的路径
2)解压缩tar zxvf jdk-7u25-linux-x64.gz -C /usr/java/(路径自己决定)
3)修改/etc/profile.d/java.sh正确的JAVA_HOME路径
4)执行. /etc/profile使之生效。(我用了reboot)
4. 安装tomcat,我是放在/opt下面,并修改权限
tar zxvf apache-tomcat-7.0.8.tar.gz -C /opt/
chown -R root apache-tomcat-7.0.8
chgrp -R root apache-tomcat-7.0.8
5. 增加tomcat manager user,在 conf/tomcat-users.xml
<role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="manager-jmx"/> <role rolename="manager-status"/> <user username="tomcat" password="tomcat" roles="manager-gui,manager-script,manager-jmx,manager-status"/>
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.0</version> <configuration> <url>http://ip:8080/manager/text</url> <server>test-gui</server> <path>/test-gui</path> </configuration> </plugin>
<server> <id>test-gui</id> <username>tomcat</username> <password>tomcat</password></server>