Installing Jenkins on FreeBSD 8.3

Install Jenkins is as easy as downloading the .war or using a port. Just download Jenkins as web archive and start it:

java -jar jenkins.war

Use ports collection

To install Jenkins, just:

root@build4:~ # cd /usr/ports/devel/jenkins
root@build4:/usr/ports/devel/jenkins # make install

Actually JDK 6 is used with Jenkins (see Makefile), just set variable JAVA_VERSION when using make:

root@build4:/usr/ports/devel/jenkins # make package JAVA_VERSION=1.7
===>  Installing for jenkins-1.511
===>   jenkins-1.511 depends on file: /usr/local/openjdk7/bin/java - not found
===>    Verifying install for /usr/local/openjdk7/bin/java in /usr/ports/java/openjdk7
[...]

Start at boot

Edit rc.conf and add these lines to configure parameters when starting Jenkins:

jenkins_enable="YES"
jenkins_home="/usr/local/jenkins"
jenkins_args="--webroot=${jenkins_home}/war --httpListenAddress=127.0.0.1 --httpPort=8180 --ajp13ListenAddress=127.0.0.1 --ajp13Port=8009 --prefix=/jenkins"
jenkins_java_home="/usr/local/openjdk7"
jenkins_user="jenkins"
jenkins_group="jenkins"
jenkins_log_file="/var/log/jenkins.log"

Using Apache httpd as proxy

Last but not least configure Apache as a proxy like this:

<VirtualHost *:80>
    <IfModule mod_proxy.c>
        ProxyRequests Off
        ProxyPreserveHost On
        ProxyVia On
        <IfModule mod_proxy_ajp.c>
            ProxyPass /jenkins ajp://127.0.0.1:8009/jenkins
        </IfModule>
    </IfModule>
</VirtualHost>

or read my other post: Using Apache As Proxy For Java Applications

HTH.

Resources

This entry was posted in Software Development, System Administration and tagged , . Bookmark the permalink.