Jenkins Behind An Apache Proxy

When I actually upgrade this site from WordPress 4.4.2 to WordPress 4.5, I think it would be pretty cool to automate as much of the process as possible. To try it out, I’m going to install a Jenkins server, and to make it a little more interesting, I’m going to try to set up access to the Jenkins server through my Apache server so I have a more unified experience access resources on my server (i.e,. I don’t have to type in any ports).

Installing Jenkins

The official documentation is here, but for brevity, here are the commands I ran to get Jenkins installed:

  1. Add the Jenkins apt key
    wget -q -O - http://pkg.jenkins-ci.org/debian-stable/jenkins-ci.org.key | sudo apt-key add -
  2. Add the stable apt repository
    sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
  3. Update
    sudo apt-get update
  4. Install
    sudo apt-get install jenkins

Configuring Jenkins To Sit Behind Apache

I wanted to access the Jenkins server via a subdirectory of my website (e.g., http://www.example.com/jenkins), so the only interface it needed to listen on was localhost. The server also had to have a context root configured since it would be behind an Apache proxy.

The PREFIX variable was already set in /etc/default/jenkins, so all I had to do was add these two parameters to JENKINS_ARGS:

  1. Listen only on localhost
    --httpListenAddress=localhost
  2. Serve the application from a context root
    --prefix=$PREFIX

I also removed the AJP connector.

Configuring Apache As A Proxy

To configure Apache as a proxy, I had to enable mod_proxy and mod_http and configure the proxy by adding the following to my virtual host:

ProxyPass         /jenkins  http://localhost:8080/jenkins nocanon
ProxyPassReverse  /jenkins  http://localhost:8080/jenkins
ProxyRequests     Off
AllowEncodedSlashes NoDecode
<Proxy http://localhost:8080/jenkins*>
    Order deny,allow   Allow from all
</Proxy>

Note that the proxy location matches the context root of the Jenkins server.

Restart

After restarting Jenkins and Apache to pick up the configuration changes, everything worked beautifully!

Burning an OS X Lion Install DVD

I have a 3rd generation MacBook Air running Snow Leopard that I wanted to upgrade to Lion via a clean install.  To do this, I wanted to burn a DVD that I would be able to use on my other MacBook as well.  There are many guides online (here’s a good one from Lifehacker: http://lifehacker.com/5823096/how-to-burn-your-own-lion-install-dvd-or-flash-drive), but I couldn’t get the DVD I burned to boot!  I also found an InstallESD.dmg inside the InstallESD.dmg the guide says to burn, but this did not work for me as well.  In the end, I ended up having to use the flash drive method.  Good luck!

Here are the md5sums of the files I tried to burn:

InstallESD.dmg (external) 5a8bc4c636f35c855250c7b5508ae7a5
InstallESD.dmg (inside dmg above) 412cee9c4c77c04c9c8489c363a7e2e4