Apache2 & Jenkins & SSL

$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
<VirtualHost *:443>
  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

  <Proxy http://127.0.0.1:8080/*>
    Order deny,allow
    Allow from all
  </Proxy>

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

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

  Header edit Location ^http://jenkins.server/ https://jenkins.server/
</VirtualHost>

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

Leave a Reply

Your email address will not be published. Required fields are marked *