Commands
shutdown.sh -S
run.sh -b 0.0.0.0 -c default
run.bat –Djboss.server.log.dir=d:/log
Change ports
In jboss 5, in $JBoss\server\default\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml, change the port offset of PortsDefaultBindings.
<bean name="PortsDefaultBindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
<constructor>
<!-- The port offset -->
<parameter>1000</parameter>
<!-- Set of bindings to which the "offset by X" approach can't be applied -->
<parameter><null/></parameter>
</constructor>
</bean>
To use the port assignments defined by the Ports01Bindings bean, set the jboss.service.binding.set system property to ports-01 when starting the application server.
run -c myconfig2 -Djboss.service.binding.set=ports-01
Configuring logging
The log4j configuration file is located at server/xxx/conf/jboss-log4j.xml.
Defining a rolling log appender
<appender name="FILE">
<param name="Append" value="true"/>
<param name="MaxFileSize" value="10MB"/>
<param name="MaxBackupIndex" value="20"/>
<param name="Threshold" value="ERROR"/>
</appender>
Defining logging for your application
You can log your application by adding category entries to the jboss-log4j.xml file.
<appender name="JBIA" ...>
<param name="File" value="${jboss.server.log.dir}/jbia.log"/>
</appender>
<category name="org.jbia">
<priority value="DEBUG"/>
<appender-ref ref="JBIA" />
</category>
Edit the server.xml file. For the default server in the default location, it is ${jboss.home}\server\default\deploy\jbossweb.sar\server.xml.
Uncomment the "Access logger" section. The log file will show up in server/default/log/localhost_access_log.{todays_date}.log
<Valve className="org.apache.catalina.valves.AccessLogValve"
prefix="localhost_access_log." suffix=".log"
pattern="common" directory="${jboss.server.log.dir}"
resolveHosts="false" />
Configuring startup parameters
Rename run.bat for example to run-old.bat.
Create another run.bat file and put this line to it:
set JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx1024m -XX:MaxPermSize=512m
run-old.bat -b 0.0.0.0 -c default
Dump SOAP Messages
For the case that is not easy to model as a simple DFS request, it is useful to enable the SOAP dump.
For client side, set "com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true";
For server side, set "com.sun.xml.ws.transport.http.HttpAdapter.dump=true";
In Jboass, put the following line in newly created run.bat:
set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true
Enable remote debug
In newly created run.bat:
rem set JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=n
Configure apache httpd.conf:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
<Proxy balancer://mycluster>
Order deny,allow
Allow from all
BalancerMember http://node1.mycluster.lan:8080/ route=node1 timeout=15
BalancerMember http://node2.mycluster.lan:8080/ route=node2 timeout=15
ProxySet stickysession=JSESSIONID|jsessionid
# other values: bybusyness|byrequests|bytraffic
ProxySet lbmethod=bytraffic
</Proxy>
ProxyPass /jmx-console balancer://mycluster/jmx-console
ProxyPassReverse /jmx-console http://localhost:9080/jmx-console stickysession=JSESSIONID|jsessionid
Configure JBoss
In jboss, modify {jboss.home}\server\default\deploy\jbossweb.sar\server.xml to configure the jvmRoute for sticky sessions:
<Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1">
Modify {jboss.home}\server\default\deployers\jbossweb.deployer\META-INF\war-deployers-jboss-beans.xml:
<bean name="WebAppClusteringDefaultsDeploye" class="org.jboss.web.tomcat.service.deployers.ClusteringDefaultsDeployer">
<property name="useJK">true</property>
</bean>
Resources: