don't dream your life, live your dreams !
I assume that you have a Centos installation.
You can copy/paste this script and use it to configure automatically your server.
#!/bin/bash echo "import repository jenkins" sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key echo "install java and jenkins" dnf -y install java-1.8.0-openjdk jenkins echo "configure httpd (create /etc/httpd/conf.d/jenkins.conf)" cat > /etc/httpd/conf.d/jenkins.conf << "EOF" ProxyPreserveHost On Proxypass /jenkins http://localhost:8080/jenkins Proxypassreverse /jenkins http://localhost:8080/jenkins ProxyRequests Off EOF echo "configure jenkins" #change home directory mkdir -p /opt/jenkins_home chown jenkins:jenkins /opt/jenkins_home -R sed -i "s/^\(JENKINS_HOME=\).*/\1\"\/opt\/jenkins_home\"/" /etc/sysconfig/jenkins #configure jenkins prefix tu run begin apache: sed -i "s/^\(JENKINS_ARGS=\).*/\1\"--prefix=\/jenkins\"/" /etc/sysconfig/jenkins #Security-Enhanced Linux (SE-Linux) setsebool -P httpd_can_network_connect true echo "start jenkins" systemctl restart httpd.service systemctl start jenkins.service myip=`hostname -I` echo "Now meet you here: http://$myip/jenkins"
That’s all 🙂
Copyright © 2024 My linux world - by Marc RABAHI
Design by Marc RABAHI and encelades.
admin