Table of contents
InstallInstall JBoss Application server 4.2 or EAP 4.2Download from here. Install in the usual way. For the zip distribution simply unzip in a directory of your choice.
Set HUDSON_HOMEJust export HUDSON_HOME=<some dir> (UNIX) or set HUDSON_HOME=<some dir> (Windows) before starting JBoss Server. Deploy hudson.warCopy hudson war to "$JBOSS_HOME/server/<your server>/deploy". <your server> will most probably be "default" but could be "production" if you have installed JBoss EAP and have more than 2G RAM. Start JBoss Servercd $JBOSS_HOME
Access Hudson GUIOpen in a browser http://<machine name>:8080/hudson Additional ConfigurationJBoss startupI would recommend setting at least 2 options when starting jboss as a container for hudson- "-Djava.awt.headless=true" and "-Xmx<some reasonable value>". To pass these options you can set the environment variable JAVA_OPTS: Linux: export JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Xmx<some reasonable value>" Windows: set JAVA_OPTS=%JAVA_OPTS% -Djava.awt.headless=true -Xmx<some reasonable value> As well you can modify run.sh/bat to avoid having that environment variable set for the child processes (jobs are one of them) you run. I use the following ugly bash script to avoid modifying that:
#!/bin/bash if [[ `dirname "$0"` != "." ]]; then cd `dirname "$0"` || exit 2 exec $SHELL -- `basename "$0"` "$@" fi ( JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true $MAX_JAVA_MEM" cd $JBOSS_HOME/bin . run.sh -c default -b 0.0.0.0 -u $MCAST_ADDR -g Hudson ) &> ~/hudson.log < /dev/null & Make sure to have JBOSS_HOME and MAX_JAVA_MEM set. Securing HudsonConfigure login when delegating auth to containerFOR MORE COMPLETE DOCUMENTATION SEE http://www.jboss.org/community/docs/DOC-12188 I'll describe one easy way to do. It's most suitable for local installations or where you have the jboss server hudson dedicated. You could ofcource implement whatever authentication mechanism you need. Refer to the JBoss manual pages for more information. User forums and mailing lists are the best place to get help.
<jboss-web> Configure JBoss AS to do auth and secure
Secure jmx and web console:
Secure jmx-invoker:
Secure HTTP-invoker:
You did twice the same so now you might be able to setup a different security domain for your hudson installation and not "jmx-console" what I suggest above (see creating jboss-web.xml). See links below for more. Configure login redirect to SSL First you need to configure a SSL connector. Please refer to http://www.jboss.org/community/docs/DOC-11989 which is a thorough resource if you cannot get it going with the commented out example configuration. <security-constraint> <web-resource-collection> <web-resource-name>Hudson</web-resource-name> <url-pattern>/loginEntry</url-pattern> <url-pattern>/login</url-pattern> <!--http-method>GET</http-method--> </web-resource-collection> <auth-constraint> <role-name>*</role-name> </auth-constraint> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint> Hudson (JBoss) HTTP listening portEdit $JBOSS_HOME/server/<your server>/deploy/jboss-web.deployer/server.xml and change `<Connector port="8080"' to `<Connector port="<some port>"'. Context root and Virtual hostIf you want to have hudson on "/" instead of "/hudson" by modifying jboss-web.xml. <context-root>/</context-root> <!-- deploy to context root - not recommended - see below -->
<virtual-host>host.example.com</virtual-host> <!-- if you want a specific virtual host -->
You'd better leave it be deployed under "/hudson", otherwise some locations get inaccessible. To have both - convenience and usability you can use a simple redirection. To do that create the following files under server deploy directory: redirect-hudson.war/redirect.jsp redirect-hudson.war/WEB-INF/jboss-web.xml redirect-hudson.war/WEB-INF/web.xml redirect.jsp should contain: <%
response.sendRedirect("/hudson");
%>
jboss-web.xml should contain: <jboss-web>
<context-root>/</context-root>
<!-- <virtual-host>hudson.example.com</virtual-host> -->
</jboss-web>
web.xml could be something like: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <display-name>Redirecting to Hudson</display-name> <description> Redirecting to Hudson. </description> <welcome-file-list> <welcome-file>redirect.jsp</welcome-file> </welcome-file-list> </web-app> Links |