Jenkins+tomcat+jdk setup

Jenkins download: http://jenkins-ci.org/

jdk version:jdk-7u45-linux-x64.tar.gz

tomcat version:apache-tomcat-7.0.62.tar.gz

OS: rhel7.0_x64

1. install jdk:

1.1.
    # cp jdk-7u45-linux-x64.tar.gz  /usr/lib/jvm
    # tar zxvf jdk-7u45-linux-x64.tar.gz
    # vi /root/.bashrc
add the following content:
    #jdk

        export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_45
        export JRE_HOME=${JAVA_HOME}/jre

        export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib

        #environmental variable

        export PATH=.:${JAVA_HOME}/bin:$PATH  
1.2.
    #source /root/.bashrc  #take effect
1.3.
    #echo $JAVA_HOME #to check

2. install tomcat and jenkins

2.1 unzip the tar

tar zxvf apache-tomcat-7.0.62.tar.gz

2.2 add following content in /opt/apache-tomcat-7.0.62/bin/startup.sh

TOMCAT_HOME=/opt/apache-tomcat-7.0.62

2.3 copy jenkins.war under /opt/apache-tomcat-7.0.62/webapps/. Then it will be unzip automatically.

[root@songnan05 jenkins]# ls
ColorFormatter.class   help                           jobs                         MainDialog$1.class             plugins                   updates
css                    hudson.model.UpdateCenter.xml  LogFileOutputStream$1.class  MainDialog.class               robots.txt                userContent
dc-license.txt         identity.key.enc               LogFileOutputStream$2.class  Main$FileAndDescription.class  scripts                   war
Download metadata.log  images                         LogFileOutputStream.class    META-INF                       secret.key                WEB-INF
Main.class                   nodeMonitors.xml               secret.key.not-so-secret  winstone.jar
favicon.ico            JNLPMain.class                 MainDialog$1$1.class         nodes                          secrets
[root@songnan05 jenkins]# pwd
/opt/apache-tomcat-7.0.62/webapps/jenkins

2.4 visit http://url:8080/jenkins/

posted @ 2017-07-24 18:55  zsychanpin  阅读(234)  评论(0编辑  收藏  举报