Set up on a remote Linux jenkins

installation

  1. View java version

jenkins is a java-based references, needs tomcat server

java -version

If you do not

sudo yum install java

2. Add jenkins source

sudo wget -O /etc/yum.repos.d/jenkins.repo http://jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key

3. Install jenkins

During installation, download the source file is too slow, speed is a high probability the problem, try switching network.

yum install jenkins

The error due to the installation, / usr / local / Jenkins IS Not A Directory . If during the installation process, you see this error, create a new directory these

mkdir /usr/local/jenkins

4. Start jenkins

sudo service jenkins start

5. Port conflict

jenkins default port 8080, modify the port configuration jenkins

修改 do_start 函数的 check_tcp_port 命令,端口号从 8080 换成 9000(你指定的端口)
vim /etc/init.d/jenkins

修改为HTTP_PORT = 9000
vim  /etc/default/jenkins

重启jenkins
sudo service jenkins start

6. detect whether a successful start

curl localhost:8080

或者查看端口启动情况
netstat -tunlp

After the curl detection of a successful start, but does not have access to an external browser. Modify the firewall:

添加对外的8080端口
firewall-cmd –zone=public –add-port=8080/tcp –permanent 

重启防火墙设置
firewall-cmd –reload

7. Installation Steps skipped successfully entered page ~

u8kjd1.png

OK,lets create new jobs。

Reproduced in: https://zhuanlan.zhihu.com/p/42802874

Guess you like

Origin www.cnblogs.com/x1you/p/12068472.html