码迷,mamicode.com
首页 > 其他好文 > 详细

centos7、jdk、tomcat8、jenkins

时间:2019-01-17 14:01:49      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:bundle   run   www   lin   www.   rabl   ted   logs   mask   

1、基础环境介绍
[root@51cto ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[root@51cto ~]# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
1
[root@51cto ~]# cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores : 2
[root@51cto ~]# free -m
total used free shared buff/cache available
Mem: 7822 125 7544 8 152 7474
Swap: 8063 0 8063
[root@51cto ~]#

[root@51cto ~]# cd /etc/sysconfig/network-scripts/

[root@51cto network-scripts]# cat ifcfg-ens32
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
NAME=ens32
UUID=9b451e45-79a3-4e60-b81e-f1d34978943a
DEVICE=ens32
ONBOOT=yes
IPADDR=192.168.8.201
GATEWAY=192.168.8.254
NETMASK=255.255.255.0
DNS1=202.99.160.68
DNS2=202.99.166.4

[root@51cto /]# ping www.baidu.com
PING www.a.shifen.com (61.135.169.125) 56(84) bytes of data.
64 bytes from 61.135.169.125 (61.135.169.125): icmp_seq=1 ttl=54 time=8.95 ms
64 bytes from 61.135.169.125 (61.135.169.125): icmp_seq=2 ttl=54 time=9.43 ms
^C
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 8.952/9.192/9.432/0.240 ms
[root@51cto /]#

[root@51cto /]# systemctl stop firewalld 关闭防火墙
[root@51cto /]# systemctl disable firewalld 禁止防火墙开机启动
[root@51cto /]# vi /etc/selinux/config 禁止selinux开机启动
#This file controls the state of SELinux on the system.
#SELINUX= can take one of these three values:
#enforcing - SELinux security policy is enforced.
#permissive - SELinux prints warnings instead of enforcing.
#disabled - No SELinux policy is loaded.
SELINUX=disabled #修改为disabled

:wq

yum install lrzsz net-tools wget vim 安装常用工具

2、部署JDK
https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz
[root@51cto /]# cd tools/
[root@51cto tools]# pwd
/tools
[root@51cto tools]#
[root@51cto tools]# wget https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz
[root@51cto tools]# rpm -aq | grep java
[root@51cto tools]#
[root@51cto tools]# ls
jdk-8u201-linux-x64.tar.gz
[root@51cto tools]# tar xvf jdk-8u201-linux-x64.tar.gz
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
[root@51cto tools]#
换种方式下载
技术分享图片
技术分享图片
[root@bogon tools]# tar xvf jdk-8u201-linux-x64.tar.gz -C /usr/local/#可以解压了
[root@bogon tools]# cd /usr/local/
[root@bogon local]# ls
bin etc games include jdk1.8.0_201 lib lib64 libexec sbin share src
[root@bogon local]#
[root@bogon local]# mv jdk1.8.0_201/ jdk
[root@bogon local]# ls
bin etc games include jdk lib lib64 libexec sbin share src
[root@bogon local]#
[root@bogon local]# vim /etc/profile#添加环境变量
#jdk配置
export JAVA_HOME=/usr/local/jdk/
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
[root@bogon local]# source /etc/profile#立即生效
[root@bogon local]# java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
[root@bogon local]#
3、部署Tomcat、jenkins.war包
https://tomcat.apache.org/download-80.cgi
https://mirrors.tuna.tsinghua.edu.cn/jenkins/war/2.146/
[root@bogon tools]# ls
jdk-8u201-linux-x64.tar.gz
[root@bogon tools]#
技术分享图片
[root@bogon tools]# ls
apache-tomcat-8.5.37.tar.gz jdk-8u201-linux-x64.tar.gz
[root@bogon tools]#
[root@bogon tools]# tar xvf apache-tomcat-8.5.37.tar.gz -C /usr/local/
[root@bogon tools]# cd /usr/local/
[root@bogon local]# ls
apache-tomcat-8.5.37 bin etc games include jdk lib lib64 libexec sbin share src
[root@bogon local]# mv apache-tomcat-8.5.37/ tomcat
[root@bogon local]# ls
bin etc games include jdk lib lib64 libexec sbin share src tomcat
[root@bogon local]#
[root@bogon local]# cd /usr/local/tomcat/
[root@bogon tomcat]# ls
bin BUILDING.txt conf CONTRIBUTING.md lib LICENSE logs NOTICE README.md RELEASE-NOTES RUNNING.txt temp webapps work
[root@bogon tomcat]# cd conf
[root@bogon conf]# ls
catalina.policy catalina.properties context.xml jaspic-providers.xml jaspic-providers.xsd logging.properties server.xml tomcat-users.xml tomcat-users.xsd web.xml
[root@bogon conf]#
[root@bogon conf]# vim server.xml #把默认的8080改为20030
<Connector port="20030" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
[root@bogon bin]# cd /usr/local/tomcat/bin/
[root@bogon bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk/
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
[root@bogon bin]#
[root@bogon bin]# netstat -nltp | grep 20030
tcp6 0 0 :::20030 :::* LISTEN 1924/java
[root@bogon bin]#

技术分享图片
[root@bogon tomcat]# cp -r webapps/ webapps_backup
[root@bogon tomcat]# ls
bin BUILDING.txt conf CONTRIBUTING.md lib LICENSE logs NOTICE README.md RELEASE-NOTES RUNNING.txt temp webapps webapps_backup work
[root@bogon tomcat]# cd webapps
[root@bogon webapps]# ls
docs examples host-manager manager ROOT
[root@bogon webapps]# rm -rf ./*
[root@bogon webapps]# ls
[root@bogon webapps]# ls
[root@bogon webapps]# mkdir jenkins
[root@bogon webapps]#
[root@bogon webapps]# ls
jenkins ROOT#把ROOT拿回来吧
[root@bogon webapps]#
[root@bogon webapps]# cd jenkins/
[root@bogon jenkins]# ls
[root@bogon jenkins]# ls
技术分享图片
[root@bogon jenkins]# ls
jenkins.war
[root@bogon jenkins]#
[root@bogon jenkins]# jar -xvf jenkins.war
[root@bogon jenkins]# ls
bootstrap css executable help jenkins.war jsbundles LogFileOutputStream$2.class Main.class MainDialog$1.class Main$FileAndDescription.class robots.txt WEB-INF
ColorFormatter.class dc-license.txt favicon.ico images JNLPMain.class LogFileOutputStream$1.class LogFileOutputStream.class MainDialog$1$1.class MainDialog.class META-INF scripts winstone.jar
[root@bogon jenkins]#
[root@bogon jenkins]# vim /etc/profile
#jenkins配置
export JENKINS_HOME=/usr/local/tomcat/webapps/jenkins
[root@bogon jenkins]# source /etc/profile
[root@bogon bin]# pwd
/usr/local/tomcat/bin
[root@bogon bin]# ./shutdown.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk/
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
[root@bogon bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk/
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
[root@bogon bin]#
技术分享图片
根据路径去找口令,拿过来继续
[root@bogon bin]# more /usr/local/tomcat/webapps/jenkins/secrets/initialAdminPassword
438536dcae7f4d2fb908f6dd13d0927d
[root@bogon bin]#
好了根据提示一路走下去就可以
技术分享图片

备注:默认安装包含的插件,同样也可以根据需求选择性的安装
技术分享图片
说明:请忽略主机名字,写作过程中,重启服务器导致

centos7、jdk、tomcat8、jenkins

标签:bundle   run   www   lin   www.   rabl   ted   logs   mask   

原文地址:http://blog.51cto.com/dongdong888/2343706

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!