Beruflich Dokumente
Kultur Dokumente
Projects
About
Follow
Subscribe
So you may decide to leave them enabled on the JBoss production server. But the problem
is that these can be accessed by anyone through Internet and is unprotected. When you run
JBoss with production settings you obviously want to protect these applications.
You can protect these applications using JAAS or by limiting access to these applications
only from the local machine (server machine). Of course the easiest way to secure them is
to remove them as I have shown in the previous section. In order to enable access only from
local machine,
Add the following in server.xml (default/deploy/jbossweb.sar) just before "Engine" closing
tag.
<Host name="loopback" autoDeploy="false" deployOnStartup="false"
deployXML="false">
</Host>
Then add the following in jboss-web.xml in WEB-INF of the following admin applications.
<virtual-host>loopback</virtual-host>
For JMX Console use deploy/jmx-console.war and for Web Console use
deploy/management folder. Now these monitoring apps can be accessed only from
http://loopback address.
Step 9 Configuring Log4J Logging for Production
The default logging configuration in JBoss is not suitable for production deployment. In
production, you only want the errors to be logged. Open jboss-log4j.xml file in default/conf
folder.
First change the root category located at the end of the file jboss-log4j.xml to contain only
FILE appender. This ensures that there is logging to the screen (CONSOLE) and all errors
are only logged to a file.
<root>
<appender-ref ref="FILE"/>
</root>
Then add the following limiting categories.
<category name="org">
<priority value="ERROR"/>
</category>
<category name="com">
<priority value="ERROR"/>
</category>
<category name="net">
<priority value="ERROR"/>
</category>
Remove the following entries. Please note that the following list is not exhaustive. You can
remove all categories and then add the three categories given above. This ensures that only
errors are logged. Also the changes to the logging configuration is hot deployed within a
minute and hence you dont need to restart the server.
<category name="org.apache">
<priority value="INFO"/>
</category>
<category name="org.quartz">
<priority value="INFO"/>
</category>
<category name="org.jboss.management">
<priority value="INFO"/>
</category>
<category name="org.jboss.serial">
<priority value="INFO"/>
</category>
Another simpler way to control logging is to change the priority attribute of the root logger.
Set it to ERROR as shown below.
<root>
<priority value="ERROR"/>
<appender-ref ref="FILE"/>
</root>
Click here to get latest site updates delivered to your email.
[...] options Here are some links to look at: http://java.dzone.com/articles/javaperformance-tuning http://www.jaysonjc.com/programming/ning-tips.html
http://java.sun.com/developer/techni/jconsole.html <= Pay particular attention to
#/threads, [...]
2. Raja Says:
May 19th, 2011 at 5:26 am
Excellent. Very useful for basic level setup and having a nice information.
Leave a Comment
Name (required)
Website
Featured Projects
o
o
Main Categories
o
o
o
o
o
o
Twitter Updates
o
o
o
o
o
DIY (4)
Opinion (11)
Photo Stories (1)
Programming (10)
Technology Tips (2)
Travel Reviews (8)
Recent Articles
o
o
o
o
o
New article - Essentials for a happy life non violence & tolerance
http://goo.gl/fb/5dmBA - 1 week ago
New article - Kulathupuzha River on the Trivandrum Thenmala Route
http://goo.gl/fb/2qDbc - 1 week ago
New article - A story on happiness and possessions http://goo.gl/fb/jbdiN - 2
weeks ago
New article - Story of the two frogs http://goo.gl/fb/QcyvX - 2 weeks ago
New article - Charity paradox give more and get more
http://goo.gl/fb/cAgdn - 3 weeks ago
My Photography