在一台服务器上安装linux系统,并配置好IP和防火墙。
在刚才装好的linux系统上,安装jdk并配置环境。
[root@mz-01 ~]# yum install git
[root@mz-01 ~]# git version
git version 1.8.3.1
设置用户名和Email:
[root@mz-01 ~]# git config --global user.name "mazhen"
[root@mz-01 ~]# git config --global user.name "[email protected]"
设置授信证书并查看:
[root@mz-01 ~]# ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
3e:f9:2b:97:a3:9d:fa:00:89:30:cf:ba:79:3f:f4:a7 [email protected]
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| o |
| = . . |
| + o S |
| . .o . |
| . . .= . |
| o. . o==. |
| o. ...EO*o |
+-----------------+
[root@mz-01 ~]# cd ~/ .ssh/
[root@mz-01 ~]# cd ~/.ssh/
[root@mz-01 .ssh]# ls
id_rsa id_rsa.pub
2.3.3将git证书配置到github上,保证Linux服务器与github之间可联通
Title可以按自己的意愿输入,Key的输入需要回到linux系统中,输入如下命令:
[root@mz-01 ~]# cd ~/ .ssh/
[root@mz-01 ~]# cd ~/.ssh/
[root@mz-01 .ssh]# ls
id_rsa id_rsa.pub
[root@mz-01 .ssh]# vim id_rsa.pub
将获取到的公钥复制粘贴到上面的Key输入框中,点击“Add SSH key”,出现如下截图:
然后到linux系统中查看git的配置是否正确:
[root@mz-01 .ssh]# ssh [email protected]
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
PTY allocation request failed on channel 0
Hi mameng1992! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
到此git的安装配置就完成了。
进入Linux系统中,并在自己喜欢的目录下输入如下命令:
[root@mz-01 applications]# wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.zip
然后对刚才下载的maven压缩包解压并重命名:
[root@mz-01 applications]# unzip apache-maven-3.5.4-bin.zip
[root@mz-01 applications]# mv apache-maven-3.5.4 maven3.5.4
[root@mz-01 maven3.5.4]# pwd
/opt/applications/maven3.5.4
配置maven:
[root@mz-01 applications]# vim /etc/profile
export MAVEN_HOME=/opt/applications/maven3.5.4
export PATH=$MAVEN_HOME/bin:$PATH
[root@mz-01 applications]# mvn -version
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00)
Maven home: /opt/applications/maven3.5.4
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: /opt/applications/jdk8/jdk1.8.0_181/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-514.el7.x86_64", arch: "amd64", family: "unix"
到此,maven就配置成功。
tomcat的下载解压、安装并配置过程省略,我们进入到tomcat的目录下:
[root@mz-01 tomcat-test]# chmod a+x -R *
[root@mz-01 tomcat-test]#
进入到jenkins的管理页面,点击“系统管理”--->“节点管理”--->“新建节点”--->"节点名称"处输入--->选择“固定节点”---"确定":
最后启动代理即可。