Modify the jenkins port number in Ubuntu

Source: Internet
Author: User

Modify the jenkins port number in Ubuntu and you will soon be able to use it. In addition, this method can be easily upgraded to the latest version. However, the port number is 8080, and another program of mine uses 8080. How can this problem be modified? Some methods on the Internet are introduced to map port 80 to port 8080 through nginx or apache, and some people say that iptables is used, which is indirect. I just don't want jenkins to use port 8080. Check/etc/init. d/jenkins script. The following two steps are required: 1. modify the check_tcp_port command of the do_start Function. Change the port number from 8080 to 8082 [plain] # Function that starts the daemon/service # do_start () {# the default location is/var/run/jenkins. pid but the parent directory needs to be created mkdir 'dirname $ pidfile'>/dev/null 2> & 1 | true chown $ JENKINS_USER 'dirname $ pidfile' # Return #0 if daemon has been started #1 if daemon was al Ready running #2 if daemon cocould not be started $ DAEMON $ DAEMON_ARGS -- running & return 1 # Verify that the jenkins port is not already in use, winstone does not exit # even for BindException check_tcp_port "http" "$ HTTP_PORT" "8082" | return 1 # If the var MAXOPENFILES is enabled in/etc/default/jenkins then set max open files to the # proper value if [-n "$ MAXOPENFILES"]; then ["$ VERBO SE "! = No] & echo Setting up max open files limit to $ MAXOPENFILES ulimit-n $ MAXOPENFILES fi # -- user in daemon doesn' t prepare environment variables like HOME, USER, LOGNAME or USERNAME, # so we let su do so for us now $ SU-l $ JENKINS_USER -- shell =/bin/bash-c "$ DAEMON $ DAEMON_ARGS -- $ JAVA $ JAVA_ARGS-jar $ JENKINS_WAR $ JENKINS_ARGS "| return 2} 2. modify the/etc/default/jenkins file, change port 8080 to 8082, and restart jenki. Ns, check: [plain] ps-def | grep java jenkins 7234 7233 99? 00:00:04/usr/bin/java-jar/usr/share/jenkins. war -- webroot =/var/cache/jenkins/war -- httpPort = 8082 -- ajp13Port =-1 modified successfully.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.