Apache2 & Jenkins & SSL

Posted on Sat 15 December 2012 in Linux • 1 min read

$JAVA_HOME/bin/java -DJENKINS_HOME=/var/lib/jenkins -Xms=512m -Djava.awt.headless=true \
  -server -jar /var/lib/jenkins.war --httpPort=8080 --httpListenAddress=127.0.0.1 \
  --ajp13Port=-1 --logfile=/var/log/jenkins.log

apache vhost config

  ServerAdmin admin@example.com
  DocumentRoot "/srv/www/"
  ServerName jenkins.example.com

  SSLEngine On
  SSLVerifyClient none
  SSLVerifyDepth 3
  SSLCertificateFile /etc/ssl/example.crt
  SSLCertificateKeyFile /etc/ssl/example.key

  ProxyRequests Off
  ProxyPreserveHost On


    Order deny,allow
    Allow from all


  ProxyPass / http://127.0.0.1:8080/
  ProxyPassReverse / http://127.0.0.1:8080/


    Order allow,deny
    Allow from all
    AuthType basic
    AuthName Build
    AuthUserFile /etc/apache2/jenkins-http.user
    Require vaild-user


  Header edit Location ^http://jenkins.server/ https://jenkins.server/

Note: Jenkins with AJP and SSL via Apache was not working...maybe a bug?