大家好,又见面了,我是全栈君。
方法一:
1、下载jenkins的war包,路径 https://jenkins.io/index.html
2、需要JDK,我这里用的JDK都是编译好的,用的可以使用的jdk1.7.0_75,由于网上有的下载了不能使用,就直接用了自己已经有的。省事。嘿嘿。
3、启动Jenkins
在jenkins所在路径下执行
java -jar jenkins.war
方法二:
1、下载tomacat的安装包,我这里也是用的现有的,网上下载没找到合适的,t同时也需要JDK
2、把jenkins.war包放在/opt/apache-tomcat-7.0.32/webapps这个路径下
[root@localhost webapps]# ll
total 64988
drwxr-xr-x. 13 root root 4096 May 10 10:47 docs
drwxr-xr-x. 6 root root 4096 May 10 10:47 examples
drwxr-xr-x. 5 root root 4096 May 10 10:47 host-manager
drwxr-xr-x. 10 root root 4096 May 10 22:54 jenkins
-rw-r–r–. 1 root root 66519999 May 10 22:53 jenkins.war
drwxr-xr-x. 5 root root 4096 May 10 10:47 manager
drwxr-xr-x. 3 root root 4096 May 10 10:47 ROOT
[root@localhost webapps]# pwd
/opt/apache-tomcat-7.0.32/webapps
3、/opt/apache-tomcat-7.0.32/bin到这个路径下,把所有的脚本给执行权限,执行startup.sh
[root@localhost bin]# ll
total 668
-rw-r–r–. 1 root root 28900 May 10 10:08 bootstrap.jar
-rw-r–r–. 1 root root 13217 May 10 10:08 catalina.bat
-rwxr-xr-x. 1 root root 19222 May 10 10:08 catalina.sh
-rw-r–r–. 1 root root 2121 May 10 10:08 catalina-tasks.xml
-rw-r–r–. 1 root root 24242 May 10 10:08 commons-daemon.jar
-rw-r–r–. 1 root root 202519 May 10 10:08 commons-daemon-native.tar.gz
-rw-r–r–. 1 root root 2131 May 10 10:08 configtest.bat
-rwxr-xr-x. 1 root root 1982 May 10 10:08 configtest.sh
-rw-r–r–. 1 root root 1342 May 10 10:08 cpappend.bat
-rwxr-xr-x. 1 root root 7492 May 10 10:08 daemon.sh
-rw-r–r–. 1 root root 2178 May 10 10:08 digest.bat
-rwxr-xr-x. 1 root root 2021 May 10 10:08 digest.sh
-rw-r–r–. 1 root root 3264 May 10 10:08 setclasspath.bat
-rwxr-xr-x. 1 root root 3403 May 10 10:08 setclasspath.sh
-rw-r–r–. 1 root root 2111 May 10 10:08 shutdown.bat
-rwxr-xr-x. 1 root root 1960 May 10 10:08 shutdown.sh
-rw-r–r–. 1 root root 2112 May 10 10:08 startup.bat
-rwxr-xr-x. 1 root root 1961 May 10 10:08 startup.sh
-rw-r–r–. 1 root root 38129 May 10 10:08 tomcat-juli.jar
-rw-r–r–. 1 root root 261742 May 10 10:08 tomcat-native.tar.gz
-rw-r–r–. 1 root root 4114 May 10 10:08 tool-wrapper.bat
-rwxr-xr-x. 1 root root 5086 May 10 10:08 tool-wrapper.sh
-rw-r–r–. 1 root root 2116 May 10 10:08 version.bat
-rwxr-xr-x. 1 root root 1965 May 10 10:08 version.sh
[root@localhost bin]# pwd
/opt/apache-tomcat-7.0.32/bin
[root@localhost bin]# sh startup.sh
查看是否启动成功
[root@localhost bin]# ps -ef | grep tomcat
root 39886 1 3 May10 pts/1 00:04:22 /usr/bin/java -Djava.util.logging.config.file=/opt/apache-tomcat-7.0.32/conf/logging.properties -Xms2048m -Xmx6144m -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/apache-tomcat-7.0.32/endorsed -classpath /opt/apache-tomcat-7.0.32/bin/bootstrap.jar:/opt/apache-tomcat-7.0.32/bin/tomcat-juli.jar -Dcatalina.base=/opt/apache-tomcat-7.0.32 -Dcatalina.home=/opt/apache-tomcat-7.0.32 -Djava.io.tmpdir=/opt/apache-tomcat-7.0.32/temp org.apache.catalina.startup.Bootstrap start
root 40339 10237 0 01:03 pts/1 00:00:00 grep tomcat
[root@localhost bin]# netstat -antlp | grep 8080
tcp 0 0 :::8080 :::* LISTEN 39886/java
4、登录验证
http://192.168.211.128:8080/jenkins/
[root@localhost secrets]# ll
total 40
drwxr-xr-x. 2 root root 4096 May 10 01:40 filepath-filters.d
-rw-r–r–. 1 root root 272 May 10 01:40 hudson.util.Secret
-rw-r—–. 1 root root 33 May 10 01:40 initialAdminPassword
-rw-r–r–. 1 root root 32 May 10 01:40 jenkins.model.Jenkins.crumbSalt
-rw-r–r–. 1 root root 48 May 10 01:40 jenkins.security.ApiTokenProperty.seed
-rw-r–r–. 1 root root 256 May 10 01:40 master.key
-rw-r–r–. 1 root root 48 May 10 22:56 org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices.mac
-rw-r–r–. 1 root root 272 May 10 01:40 org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
-rw-r–r–. 1 root root 5 May 10 01:40 slave-to-master-security-kill-switch
drwxr-xr-x. 2 root root 4096 May 10 01:40 whitelisted-callables.d
[root@localhost secrets]# cat initialAdminPassword
3fd1f53713af4d89b75b0728fd32562b
[root@localhost secrets]# pwd
/root/.jenkins/secrets
3fd1f53713af4d89b75b0728fd32562b就是admin用户登录的密码
本文转自aaa超超aaa 51CTO博客,原文链接:http://blog.51cto.com/10983441/1772048
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/107989.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...