How to configure Jenkins to run on port 80

后端 未结 13 2210
走了就别回头了
走了就别回头了 2020-12-12 21:45

I\'m running Ubuntu 11.10 and have run sudo apt-get install jenkins to install Jenkins on this system.

I\'ve seen some tutorials on how to setup a rever

13条回答
  •  盖世英雄少女心
    2020-12-12 22:22

    Give a try to 'authbind':

    sudo apt-get install authbind
    sudo touch /etc/authbind/byport/80
    sudo chmod 500 /etc/authbind/byport/80 
    sudo chown jenkins /etc/authbind/byport/80
    

    Then modify the script above to have (add authbind before the $JAVA_HOME/bin/java part):

    exec daemon --name=jenkins --inherit --output=$JENKINS_LOG/jenkins.log \
    --user=$USER -- authbind $JAVA_HOME/bin/java $JAVA_OPTS \
    -jar $JENKINS_ROOT/jenkins.war $JENKINS_ARGS \
    --preferredClassLoader=java.net.URLClassLoader
    

    For newer Jenkins installations (1.598) on newer Ubuntu installations (14.04) edit /etc/init.d/jenkins and add authbind before $JAVA

    $SU -l $JENKINS_USER --shell=/bin/bash -c "$DAEMON $DAEMON_ARGS -- authbind $JAVA $JAVA_ARGS -jar $JENKINS_WAR $JENKINS_ARGS" || return 2
    

    As mentioned by Alan (see comment below) if you need IPv6 and your system is lower than Quantal you can instead of using apt-get to install authbind download a higher version. Make sure you have libc6 and libc6-udeb installed. Here is authbind version 2.1.1 from Ubuntu:

    • amd64
    • i386

    Then execute:

    sudo dpkg -i authbind_2.1.1_amd64.deb
    # or sudo dpkg -i authbind_2.1.1_i386.deb
    
    sudo touch /etc/authbind/byport/80
    sudo chmod 500 /etc/authbind/byport/80 
    sudo chown jenkins /etc/authbind/byport/80
    

提交回复
热议问题