配置java环境
1
2
3
|
rpm –aq |
grep
jdk
rpm -e --nodeps java-1.7.0-openjdk-1.7.0.65-2.5.1.2.el6_5.x86_64
rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-11.1.13.4.el6.x86_64
|
下载:http://download.oracle.com/otn-pub/java/jdk/
1
2
|
tar
zxvf jdk-7u76-linux-x64.gz
mv
jdk1.7.0_76/
/usr/local/java
|
配置java环境变量
1
|
vi
/etc/profile
|
1
2
3
4
5
6
7
|
JAVA_HOME=
/usr/local/java
CLASSPATH=.:$JAVA_HOME
/lib
:$JAVA_HOME
/lib/dt
.jar:$JAVA_HOME
/lib/tools
.jar
PATH=$PATH:$JAVA_HOME
/bin
JRE_HOME=$JAVA_HOME
/jre
export
JAVA_HOME
export
PATH
export
CLASSPATH
|
1
|
source
/etc/profile
|
安装Tomcat
1
2
|
wget http:
//mirrors
.hust.edu.cn
/apache/tomcat/tomcat-8/v8
.0.21
/bin/apache-tomcat-8
.0.21.
tar
.gz
tar
zxvf apache-tomcat-8.0.21.
tar
.gz &&
mv
apache-tomcat-7.0.59
/usr/local/tomcat
|
启动Tomcat
1
|
/usr/local/tomcat/bin/startup
.sh
|
下载安装Maven
1
2
|
wget http:
//mirrors
.cnnic.cn
/apache/maven/maven-3/3
.3.1
/binaries/apache-maven-3
.3.1-bin.
tar
.gz
tar
zxvf apache-maven-3.3.1-bin.
tar
.gz &&
mv
apache-maven-3.3.1
/usr/local/maven
|
配置maven环境变量
1
|
vi
/etc/profile
|
1
2
3
4
5
|
MAVEN_HOME=
/usr/local/maven
export
PATH=${PATH}:${MAVEN_HOME}
/bin
export
JAVA_HOME CLASSPATH PATH MAVEN_HOME USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
CATALINA_HOME=
/usr/local/tomcat
export
CATALINA_HOME
|
使环境变量生效
1
|
source
/etc/profile
|
验证maven 是否安装成功
1
|
mvn -
v
|
Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; 2015-03-13T16:10:27-04:00)
Maven home: /usr/local/maven
Java version: 1.8.0_20, vendor: Oracle Corporation
Java home: /usr/local/java/jdk1.8.0_20/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-504.el6.i686", arch: "i386", family: "unix"
安装Jenkins
1
2
|
wget http:
//mirrors
.jenkins-ci.org
/war/latest/jenkins
.war
mv
Jenkins.war
/usr/local/tomcat/webapps/
|
添加环境变量
1
|
vi
/etc/profile
|
1
2
|
JENKINS_HOME=
/usr/local/tomcat/webapps/Jenkins
export
JENKINS_HOME
|
使环境变量生效
1
|
source
/etc/profile
|
启动Tomcat
访问web管理页面 http://ip:8080/jenkins
本文转自 youerning 51CTO博客,原文链接:http://blog.51cto.com/youerning/1714601