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?

“No Java compiler available” on SLES11SP1 and tomcat6

On one of my two sle11 machines i had a java exception which i could not explain.

java.lang.IllegalStateException: No Java compiler available
	org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:229)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:581)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.mule.galaxy.web.ThreadLocalCacheFilter.doFilter(ThreadLocalCacheFilter.java:27)
[...]
# rpm -qa tomcat6
tomcat6-6.0.18-20.35.36.1

Oracle Java JDK 1.6.0_27

After i compared both, i’ve found some missing links on the second one.

# ln -s /usr/share/java/commons-collections-tomcat5.jar /usr/share/tomcat6/lib/
# ln -s /usr/share/java/commons-dbcp-tomcat5.jar /usr/share/tomcat6/lib/
# ln -s /usr/share/java/commons-pool-tomcat5.jar /usr/share/tomcat6/lib/
# ln -s /usr/share/java/ecj.jar /usr/share/tomcat6/lib/

Restart the tomcat and be happy 🙂

jstat – jvm memory stats

/usr/java/jdk1.5.0_22/bin/jstat -gcutil 18703 1s 10

gcutil = Summary of Garbage Collection Statistics (mandatory)
18703 = process id (mandatory)
1s = refresh interval (optional)
10 = counter (optional)

$ /usr/java/jdk1.5.0_22/bin/jstat -gcutil 25532 1s 10
  S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT   
  0.00   0.00  71.36  35.59  72.25     39    6.195     1    0.440    6.635
  0.00   0.00  72.22  35.59  72.25     39    6.195     1    0.440    6.635
  0.00   0.00  78.39  35.59  72.25     39    6.195     1    0.440    6.635
  0.00   0.00  88.32  35.59  72.25     39    6.195     1    0.440    6.635
  0.00   0.00  93.77  35.59  72.25     39    6.195     1    0.440    6.635
  0.00   0.00  97.66  35.59  72.25     39    6.195     1    0.440    6.635
  0.00   0.00   1.90  36.45  72.25     40    6.357     1    0.440    6.797
  0.00   0.00   6.94  36.45  72.25     40    6.357     1    0.440    6.797
  0.00   0.00   9.40  36.45  72.25     40    6.357     1    0.440    6.797
  0.00   0.00   9.57  36.45  72.25     40    6.357     1    0.440    6.797

event during the 6th and the 7th sample
collection took 0.162s (6.357s-6.195s)
increasing utilization (0.86%) of old space