HOWTO: Jenkins + nginx, FreeBSD

rodrigc@

Developer
The following HOWTO describes step-by-step how to set up Jenkins under FreeBSD.

INSTALL NGINX WEB PROXY

  1. install nginx for a web proxy

    # pkg install www/nginx

  2. create a /usr/local/etc/nginx/nginx.conf which redirects all web requests from port 80 to port 8180 (where we will run jenkins

    Code:
                server {
                    listen       80;
    
                    # Redirect all port 80 requests to Jenkins on
                    # port 8180
                    return 301 http://$host:8180/jenkins/$request_uri;
                }

    add to /etc/rc.conf

    Code:
              nginx_enable="YES"


INSTALL JENKINS

  1. Install jenkins with:

    # pkg install devel/jenkins
  2. Add the following to /etc/rc.conf:

    Code:
           jenkins_enable="YES"
           jenkins_home="/usr/local/jenkins"
           jenkins_user="jenkins"
           jenkins_args="--webroot=${jenkins_home}/war --httpListenAddress=0.0.0.0 --httpPort=8180 --ajp13ListenAddress=0.0.0.0 --ajp13Port=8009 --prefix=/jenkins"

START JENKINS AND NGINX

  1. Start Jenkins:
    # service start jenkins
  2. Start nginx:
    # service start nginx


CONFIGURING JENKINS

  • If your hostname is myhost1.example.net, then open a web browser at http://myhost1.example.net.
  • Configure Jenkins via the web interface.
  • Jenkins will place its configuration files under /usr/local/jenkins, as specified in
    jenkins_home variable in /etc.rc.conf.

FURTHER REFERENCES

 
Back
Top