<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
  <channel>
    <title>不闻不若闻之,闻之不若见之,见之不若知之,知之不若行之!</title>
    <description>技术还凑合，但工资很低！
人品也偶尔爆发，但机遇始终一笔潦倒！</description>
    <link>http://powerntt.javaeye.com</link>
    <language>UTF-8</language>
    <copyright>Copyright 2003-2008, JavaEye.com</copyright>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>JavaEye - 做最棒的软件开发交流社区</generator>
      <item>
        <title>刘翔[因病]退出奥运比赛</title>
        <author>PowerNTT</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://powerntt.javaeye.com">PowerNTT</a>&nbsp;
          链接：<a href="http://powerntt.javaeye.com/blog/229166" style="color:red;">http://powerntt.javaeye.com/blog/229166</a>&nbsp;
          发表时间: 2008年08月18日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          我们想过这次比赛刘翔你可能赢，也可能输，但是我们没有想到会是这样一个结果:<br />"因病"退出比赛！！！<br /><br />这次真的伤了我们的心，13亿中国人民的心！！！<br /><br />妈妈饭菜都不顾及，就一直守候在电视机前；<br />为什么？<br /><br />因为我们内心期待着...<br /><br />以次表示我内心的痛苦和失望！！！
          <br/>
          <span style="color:red;">
            <a href="http://powerntt.javaeye.com/blog/229166#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 18 Aug 2008 13:24:48 +0800</pubDate>
        <link>http://powerntt.javaeye.com/blog/229166</link>
        <guid>http://powerntt.javaeye.com/blog/229166</guid>
      </item>
      <item>
        <title>Auto mount the share folder on windows</title>
        <author>PowerNTT</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://powerntt.javaeye.com">PowerNTT</a>&nbsp;
          链接：<a href="http://powerntt.javaeye.com/blog/228602" style="color:red;">http://powerntt.javaeye.com/blog/228602</a>&nbsp;
          发表时间: 2008年08月16日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          vi /etc/fstab<br /><br />#SMBFS方式<br />//192.168.150.77/Fax /home/public/ smbfs credentials=/etc/.smbpasswd,dmask=777,fmask=777 0 0<br /><br />#CIFS方式<br />//192.168.150.77/Fax /home/public/ cifs credentials=/etc/.smbpasswd,dir_mode=0777,file_mode=0777 0 0<br /><br />Note:<br />SMBFS方式在Redhat上标记为Deprecated,CIFS方式为推荐方式;<br />但在Linux version 2.6.9-55.ELsmp上采用CIFS方式,在umount或者linux 4点02分 做daily cron 时有可能会导致系统kernel panic,此为CIFS1.45[版本号好象是这个]模块的一个Bug,需要升级CIFS组件或者打patch包;<br /><br />配置再加载:<br />vi /etc/rc.local<br />在 touch /var/....下加入:<br />sleep 30<br />mount -a<br /><br />Note:<br />在fstab配置后,理应自动加载成功,但提示信息:[No route to host],分析原因是network 未加载完成;<br /><br />rc.local中如果未添加sleep,则提示同样错误报告;而redhat官方支持测试成功;<br /><img src="/images/smiles/icon_sad.gif"/><img src="/images/smiles/icon_sad.gif"/> <img src="/images/smiles/icon_sad.gif"/><br /><br />这样配置始终感觉不太合理；因为系统第一次加载不成功;而让她小睡小会,再重新加载一次；<br /><img src="/images/smiles/icon_biggrin.gif"/><img src="/images/smiles/icon_biggrin.gif"/><img src="/images/smiles/icon_biggrin.gif"/><br /><br />我会继续测试,以寻找更稳定合理的解决方案;
          <br/>
          <span style="color:red;">
            <a href="http://powerntt.javaeye.com/blog/228602#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 16 Aug 2008 11:12:23 +0800</pubDate>
        <link>http://powerntt.javaeye.com/blog/228602</link>
        <guid>http://powerntt.javaeye.com/blog/228602</guid>
      </item>
      <item>
        <title>Auto reboot the linux server when kernel panic</title>
        <author>PowerNTT</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://powerntt.javaeye.com">PowerNTT</a>&nbsp;
          链接：<a href="http://powerntt.javaeye.com/blog/228584" style="color:red;">http://powerntt.javaeye.com/blog/228584</a>&nbsp;
          发表时间: 2008年08月16日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          设置kernel系统参数:<br />vi /etc/sysctl.conf<br />#增加此行,以保证此设置持续有效;<br />#含义是当系统遇到kernel panic时,系统在30秒后reboot;<br />kernel.panic = 30<br /><br />#修改此参数,,以保证下一次当系统遇到kernel panic后有效;<br />#以后无需再修改,默认从上面的设置中加载;<br />vi /proc/sys/kernel/panic<br />echo 30 > panic<br /><br /><br />另外Redhat提供的可导致kernel panic的方式;<br />执行这几行代码,你的linux 系统就crash了；<br /><img src="/images/smiles/icon_lol.gif"/><img src="/images/smiles/icon_lol.gif"/><img src="/images/smiles/icon_lol.gif"/><br /><br />cd /proc/sys/kernel<br />echo 1 > sysrq<br />cd /proc<br />echo  c > sysrq-trigger
          <br/>
          <span style="color:red;">
            <a href="http://powerntt.javaeye.com/blog/228584#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 16 Aug 2008 10:47:44 +0800</pubDate>
        <link>http://powerntt.javaeye.com/blog/228584</link>
        <guid>http://powerntt.javaeye.com/blog/228584</guid>
      </item>
      <item>
        <title>Jboss default方式下的Cluster配置[四]</title>
        <author>PowerNTT</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://powerntt.javaeye.com">PowerNTT</a>&nbsp;
          链接：<a href="http://powerntt.javaeye.com/blog/226928" style="color:red;">http://powerntt.javaeye.com/blog/226928</a>&nbsp;
          发表时间: 2008年08月12日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <strong>Jgroup & OSCache</strong><br /><br /><u>Import jars:</u><br /><br />jgroups-all.jar [JGroups-2.6.3]<br />oscache-2.4.1.jar<br /><br /><u>Configuration</u><br /><br />oscache.properties<br /><br /><pre name="code" class="java">
# CACHE IN MEMORY
#
# If you want to disable memory caching, just uncomment this line.
#
# cache.memory=false


# CACHE KEY
#
# This is the key that will be used to store the cache in the application
# and session scope.
#
# If you want to set the cache key to anything other than the default
# uncomment this line and change the cache.key
#
# cache.key=__oscache_cache


# USE HOST DOMAIN NAME IN KEY
#
# Servers for multiple host domains may wish to add host name info to
# the generation of the key.  If this is true, then uncomment the
# following line.
#
# cache.use.host.domain.in.key=true


# CACHE LISTENERS
#
# These hook OSCache events and perform various actions such as logging
# cache hits and misses, or broadcasting to other cache instances across a cluster.
# See the documentation for further information.
#
cache.event.listeners= com.opensymphony.oscache.plugins.clustersupport.JavaGroupsBroadcastingListener,\
                      com.opensymphony.oscache.extra.CacheEntryEventListenerImpl,\
                     com.opensymphony.oscache.extra.CacheMapAccessEventListenerImpl,\
                     com.opensymphony.oscache.extra.ScopeEventListenerImpl,\
                     com.opensymphony.oscache.extra.StatisticListenerImpl

# CACHE PERSISTENCE CLASS
#
# Specify the class to use for persistence. If you use the supplied DiskPersistenceListener,
# don't forget to supply the cache.path property to specify the location of the cache
# directory.
# 
# If a persistence class is not specified, OSCache will use memory caching only.
#
cache.persistence.class=com.opensymphony.oscache.plugins.diskpersistence.DiskPersistenceListener
# cache.persistence.class=com.opensymphony.oscache.plugins.diskpersistence.HashDiskPersistenceListener

# CACHE OVERFLOW PERSISTENCE
# Use persistent cache in overflow or not. The default value is false, which means
# the persistent cache will be used at all times for every entry.  true is the recommended setting.
#
cache.persistence.overflow.only=true

# CACHE DIRECTORY
#
# This is the directory on disk where caches will be stored by the DiskPersistenceListener.
# it will be created if it doesn't already exist. Remember that OSCache must have
# write permission to this directory.
#
# Note: for Windows machines, this needs \ to be escaped
# ie Windows:
# cache.path=c:\\myapp\\cache
# or *ix:
cache.path=/opt/cache
#
# cache.path=c:\\app\\cache


# CACHE ALGORITHM
#
# Default cache algorithm to use. Note that in order to use an algorithm
# the cache size must also be specified. If the cache size is not specified,
# the cache algorithm will be Unlimited cache.
#
cache.algorithm=com.opensymphony.oscache.base.algorithm.LRUCache
# cache.algorithm=com.opensymphony.oscache.base.algorithm.FIFOCache
# cache.algorithm=com.opensymphony.oscache.base.algorithm.UnlimitedCache

# THREAD BLOCKING BEHAVIOR
#
# When a request is made for a stale cache entry, it is possible that another thread is already
# in the process of rebuilding that entry. This setting specifies how OSCache handles the
# subsequent 'non-building' threads. The default behaviour (cache.blocking=false) is to serve
# the old content to subsequent threads until the cache entry has been updated. This provides
# the best performance (at the cost of serving slightly stale data). When blocking is enabled,
# threads will instead block until the new cache entry is ready to be served. Once the new entry
# is put in the cache the blocked threads will be restarted and given the new entry.
# Note that even if blocking is disabled, when there is no stale data available to be served
# threads will block until the data is added to the cache by the thread that is responsible
# for building the data.
#
#cache.blocking=true

# CACHE SIZE
#
# Default cache size in number of items. If a size is specified but not
# an algorithm, the cache algorithm used will be LRUCache.
#
cache.capacity=1000


# CACHE UNLIMITED DISK
# Use unlimited disk cache or not. The default value is false, which means
# the disk cache will be limited in size to the value specified by cache.capacity.
#
# cache.unlimited.disk=false


# JMS CLUSTER PROPERTIES
#
# Configuration properties for JMS clustering. See the clustering documentation
# for more information on these settings.
#
#cache.cluster.jms.topic.factory=java:comp/env/jms/TopicConnectionFactory
#cache.cluster.jms.topic.name=java:comp/env/jms/OSCacheTopic
#cache.cluster.jms.node.name=node1


# JAVAGROUPS CLUSTER PROPERTIES
#
# Configuration properites for the JavaGroups clustering. Only one of these
# should be specified. Default values (as shown below) will be used if niether
# property is set. See the clustering documentation and the JavaGroups project
# (www.javagroups.com) for more information on these settings.
#

#Jason Cheng Added
#The default value is 231.12.21.132, however you can use any class D IP address. 
#Class D address fall in the range 224.0.0.0 through 239.255.255.255

# If your cache is binding
# to 127.0.0.1 and not to a network ip. Your cache must be listening on a
# network ip to talk to other servers. You can test the clustered cache by
# running two portals on two machines. Do not attempt to run both portals on
# one machine because the multicast will not know to loopback.

cache.cluster.properties=UDP(mcast_addr=231.12.21.136;mcast_port=45566;ip_ttl=32;\
mcast_send_buf_size=150000;mcast_recv_buf_size=80000):\
PING(timeout=2000;num_initial_members=3):\
MERGE2(min_interval=5000;max_interval=10000):\
FD_SOCK:VERIFY_SUSPECT(timeout=1500):\
pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800;max_xmit_size=8192):\
UNICAST(timeout=300,600,1200,2400):\
pbcast.STABLE(desired_avg_gossip=20000):\
FRAG(frag_size=8096;down_thread=false;up_thread=false):\
pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)
#cache.cluster.multicast.ip=231.12.21.132

</pre><br /><br />web.xml configuraion for the jsp cache:<br /><br /><pre name="code" class="java">
	&lt;!-- OSCache Configuration  -->
	&lt;filter>
		&lt;filter-name>CacheFilterStaticContent&lt;/filter-name>
		&lt;filter-class>
			com.opensymphony.oscache.web.filter.CacheFilter
		&lt;/filter-class>
		&lt;init-param>
			&lt;param-name>expires&lt;/param-name>
			&lt;param-value>time&lt;/param-value>
		&lt;/init-param>
	&lt;/filter>

	&lt;!-- The mapping for the OSCache  -->
	&lt;filter-mapping>
		&lt;filter-name>CacheFilterStaticContent&lt;/filter-name>
		&lt;url-pattern>*.jsp&lt;/url-pattern>
	&lt;/filter-mapping>
</pre>
          <br/>
          <span style="color:red;">
            <a href="http://powerntt.javaeye.com/blog/226928#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Tue, 12 Aug 2008 11:06:36 +0800</pubDate>
        <link>http://powerntt.javaeye.com/blog/226928</link>
        <guid>http://powerntt.javaeye.com/blog/226928</guid>
      </item>
      <item>
        <title>Jboss default方式下的Cluster配置[三]</title>
        <author>PowerNTT</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://powerntt.javaeye.com">PowerNTT</a>&nbsp;
          链接：<a href="http://powerntt.javaeye.com/blog/226916" style="color:red;">http://powerntt.javaeye.com/blog/226916</a>&nbsp;
          发表时间: 2008年08月12日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <strong>Cluster Configuration</strong><br /><br /><br /><pre name="code" class="java">
#vim /server/default/deploy/jboss-web.deployer/server.xml

&lt;Engine name="jboss.web" defaultHost="localhost">

The node<em> must match the JK configrutaion.
&lt;Engine name="jboss.web" defaultHost="localhost" jvmRoute="node[i]">

#vim jboss_home/server/all/deploy/jboss-web.deployer/META-INF/jboss-service.xml
update the value of UseJK attribute as true
</pre><br /><br /><strong>Auto Run Configuration</strong><br /><br /><u>For Jboss</u><br /><br /><pre name="code" class="java"># cp $JBOSS_HOME/bin/jboss_init_redhat.sh  /etc/init.d/jboss
chmod -f 755 /etc/init.d/jboss

# ln -s /etc/init.d/jboss /etc/rc0.d/K20jboss
# ln -s /etc/init.d/jboss /etc/rc3.d/S80jboss
# ln -s /etc/init.d/jboss /etc/rc5.d/S80jboss
# ln -s /etc/init.d/jboss /etc/rc6.d/K20jboss</pre><br /><br /><u>For apache</u><br /><br /><pre name="code" class="java">ln –s /opt/apache2/bin/apachectl /etc/init.d/apache

chmod 755 /etc/init.d/apache
ln –s /etc/init.d/apache /etc/rc3.d/S80apache
ln –s /etc/init.d/apache /etc/rc3.d/K20apache
ln –s /etc/init.d/apache /etc/rc4.d/S80apache
ln –s /etc/init.d/apache /etc/rc4.d/K20apache
ln –s /etc/init.d/apache /etc/rc5.d/S80apache
ln –s /etc/init.d/apache /etc/rc5.d/K20apache</pre><br /><br /><strong>Deployment</strong><br /><br />[i]1. Shutdown the servers</em><br /><br /><pre name="code" class="java">./shutdown.sh -S --server=192.168.150.75 --user=admin --password=***
./shutdown.sh -S --server=192.168.150.76 --user=admin --password=***</pre><br /><br /><em>2. Copy folders</em><br />Copy below folders of the project to the /opt/apache2/htdocs/application/ folder.<br /><br />The folders:<br />images<br />style<br />css<br />js<br />support<br /><br /><em>3. Copy war file</em><br />Copy the application.war to the folder [Two nodes]:<br /><br />/opt/jboss-4.2.2.GA/server/default/deploy<br /><br /><em>4. Start the servers [Two nodes]</em><br /><br />Start apache:<br /><br /><pre name="code" class="java">service apache start</pre><br /><br />jboss start:<br /><br /><pre name="code" class="java">#./jboss_init_redhat.sh start
or
#service jboss start</pre><br /><br /><br /><em>5. Check the jkstatus</em><br /><br />http:// 192.168.150.75/jkstatus
          <br/>
          <span style="color:red;">
            <a href="http://powerntt.javaeye.com/blog/226916#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Tue, 12 Aug 2008 10:59:58 +0800</pubDate>
        <link>http://powerntt.javaeye.com/blog/226916</link>
        <guid>http://powerntt.javaeye.com/blog/226916</guid>
      </item>
      <item>
        <title>Jboss default方式下的Cluster配置[二]</title>
        <author>PowerNTT</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://powerntt.javaeye.com">PowerNTT</a>&nbsp;
          链接：<a href="http://powerntt.javaeye.com/blog/226911" style="color:red;">http://powerntt.javaeye.com/blog/226911</a>&nbsp;
          发表时间: 2008年08月12日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <strong>Install Apache</strong><br /><br /><u>Install</u><br /><br /><pre name="code" class="java">
Unzip
gzip -d httpd-2.2.9.tar.gz
tar xvf httpd-2.2.9.tar

Config
cd httpd-2.2.9
./configure --prefix=/opt/apache2

Complile
make

Install.
make install

</pre><br /><br /><u>Configuraion</u><br /><br />vi /opt/apache2/conf/httpd.conf<br />将User daemon和Group daemon改为User apache和Group apache<br /><br /><pre name="code" class="java">
Listen 192.168.150.75:80
ServerName 192.168.150.75:80</pre><br /><br />Add user and group for apache:<br /><br /><pre name="code" class="java">groupadd apache
useradd apache –g apache</pre><br /><br /><br /><u>Check</u><br /><br /><pre name="code" class="java">./apachectl configtest</pre><br /><br /><strong>Install Mod_JK</strong><br /><br /><u>Install</u><br /><br />Rename mod_jk-1.2.26-httpd-2.2.6.so to mod_jk.so;<br /><br /><pre name="code" class="java">#mv mod_jk-1.2.26-httpd-2.2.6.so mod_jk.so</pre><br /><br />Copy to the folder /opt/apache2/modules.<br /><br /><pre name="code" class="java">#cp /home/tools/mod_jk.so </pre><br /><br /><u>Configuration</u><br /><br />Add the below line in the bottom of /opt/apache2/conf/httpd.conf:<br /><br /><pre name="code" class="java">Include conf/mod_jk.conf</pre><br /><br /><br />Copy the files to the folder:<br /><br /><pre name="code" class="java">/opt/apache2/conf</pre><br /><br />mod_jk.conf<br /><br /><pre name="code" class="java">
# Load mod_jk module
# Specify the filename of the mod_jk lib
loadModule jk_module modules/mod_jk.so

# Where to find workers.properties
JkWorkersFile conf/workers.properties

# Where to put jk logs
JkLogFile logs/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel info

# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

# JkOptions indicates to send SSK KEY SIZE
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat
JkRequestLogFormat "%w %V %T"
JkMountFile conf/uriworkermap.properties
</pre><br /><br />workers.properties<br /><br /><pre name="code" class="java">#Define list of workers that will be used
# for mapping requests
worker.list=loadbalancer,status

# Define Node1
# modify the host as your host IP or DNS name.
worker.node1.port=8009
worker.node1.host=192.168.150.75
worker.node1.type=ajp13
worker.node1.lbfactor=1

# Define prefered failover node for node1
worker.node1.redirect=node2

# Define Node2
# modify the host as your host IP or DNS name.
worker.node2.port=8009
worker.node2.host=192.168.150.76
worker.node2.type=ajp13
worker.node2.lbfactor=2
worker.node2.redirect=node1

# Load-balancing behaviour
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=1

# Status worker for managing load balancer
worker.status.type=status</pre><br /><br />uriworkermap.properties<br /><br /><pre name="code" class="java">
/application/*=loadbalancer
/jkstatus=status
#/*.jsp=loadbalancer
#/*.do=loadbalancer
!/*.gif=loadbalancer
!/*.msi=loadbalancer
!/*.exe=loadbalancer
!/*.jpg=loadbalancer
!/*.png=loadbalancer
!/*.css=loadbalancer
!/js/*.js=loadbalancer
#!/*.htm=loadbalancer
#!/*.html=loadbalancer
</pre>
          <br/>
          <span style="color:red;">
            <a href="http://powerntt.javaeye.com/blog/226911#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Tue, 12 Aug 2008 10:49:02 +0800</pubDate>
        <link>http://powerntt.javaeye.com/blog/226911</link>
        <guid>http://powerntt.javaeye.com/blog/226911</guid>
      </item>
      <item>
        <title>Jboss default方式下的Cluster配置[一]</title>
        <author>PowerNTT</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://powerntt.javaeye.com">PowerNTT</a>&nbsp;
          链接：<a href="http://powerntt.javaeye.com/blog/226904" style="color:red;">http://powerntt.javaeye.com/blog/226904</a>&nbsp;
          发表时间: 2008年08月12日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <strong>Dependent Software:</strong><br /><br />jboss-4.2.2.GA.zip <br />httpd-2.2.9.tar.gz<br />mod_jk-1.2.26-httpd-2.2.6.so<br />jdk-1_5_0_16-linux-i586-rpm.bin<br /><br /><strong>Install JDK</strong><br /><br /><u>Install</u><br /><pre name="code" class="java">
# cd /home/tools
# chmod +x jdk-1_5_0_16-linux-i586-rpm.bin
#./ jdk-1_5_0_16-linux-i586-rpm.bin
</pre><br /><br /><u>Configuration</u><br /><br /><pre name="code" class="java">
# vim /etc/profile
JAVA_HOME=/usr/java/jdk1.5.0_16
CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib
PATH=$PATH:$JAVA_HOME/bin

export JAVA_HOME PATH CLASSPATH

# source /etc/profile
# echo $JAVA_HOME

# cd /usr/bin
# ln -s -f /usr/java/jdk1.5.0_16/bin/java
# ln -s -f /usr/java/jdk1.5.0_16/bin/javac

</pre><br /><br /><u>Check</u><br /><br /># java –version<br /><br />java version "1.5.0_16"<br />Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02)<br />Java HotSpot(TM) Server VM (build 1.5.0_16-b02, mixed mode)<br /><br /><strong>Install Jboss</strong><br /><br /><u>Install</u><br /><pre name="code" class="java"># su jboss
# cd /home/tools
# unzip -d /opt/ jboss-4.2.2.GA.zip</pre><br /><br /><u>Configuration</u><br /><pre name="code" class="java">
# create group - change group id as needed
groupadd -g jboss

# create user - change user id as needed
useradd -g jboss -c "JBoss Admin" jboss


# vim /etc/profile 

JBOSS_HOME=/opt/jboss-4.2.2.GA
PATH=$PATH:$JBOSS_HOME/bin
export JBOSS_HOME PATH

# source /etc/profile
# echo $JBOSS_HOME

# chmod -Rf 755 $JBOSS_HOME


# vim jboss_init_redhat.sh

Add at front:
#JBOSS_HOST=${JBOSS_HOST:-"0.0.0.0"}
JBOSS_HOST=${JBOSS_HOST:-"192.168.150.75"}

Update the attributes:
JBOSS_HOME=${JBOSS_HOME:-"/opt/jboss-4.2.2.GA"} 
JBOSS_USER=${JBOSS_USER:-"jboss"} 
JAVAPTH=${JAVAPTH:-"/usr/java/jdk1.5.0_16/bin"} 
JBOSS_CONF=${JBOSS_CONF:-”default”} 

#if JBOSS_HOST specified, use -b to bind jboss services to that address
JBOSS_BIND_ADDR=${JBOSS_HOST:+"-b $JBOSS_HOST"}

#JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF"}

JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF $JBOSS_BIND_ADDR"}


Config for the shut down
#JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.sh -S -s $JBOSS_HOST"}
JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"cd $JBOSS_HOME/bin; $JBOSSCP"}

# vim run.conf
Update [Xmx can be set as the 80% of the max available memory]:
JAVA_OPTS=-Xms512m –Xmx1024m

</pre><br /><br /><u>Jboss Security</u><br /><br />Security jmx-console:<br /><br /><pre name="code" class="java">#vim deploy/jmx-console.war/WEB-INF/jboss-web.xml

Uncomment this part:
&lt;security-domain>java:/jaas/jmx-console&lt;/security-domain>

#vim deploy/jmx-console.war/WEB-INF/web.xml

Uncomment this part:
&lt;security-constraint>
     &lt;web-resource-collection>
       &lt;web-resource-name>HtmlAdaptor&lt;/web-resource-name>
       &lt;description>An example security config that only allows users with the
         role JBossAdmin to access the HTML JMX console web application
       &lt;/description>
       &lt;url-pattern>/*&lt;/url-pattern>
       &lt;http-method>GET&lt;/http-method>
       &lt;http-method>POST&lt;/http-method>
     &lt;/web-resource-collection>
     &lt;auth-constraint>
       &lt;role-name>JBossAdmin&lt;/role-name>
     &lt;/auth-constraint>
&lt;/security-constraint>

Check the user file path of jmx-console:
#cat conf/login-config.xml

Update the user & password [Format username=password]:
#vim conf/props/jmx-console-users.properties
admin=admin
</pre><br /><br />Security web-console:<br /><br /><pre name="code" class="java">#vim deploy/ management/console-mgr.sar/web-console.war/WEB-INF/jboss-web.xml

Uncomment this part:
&lt;jboss-web> 
&lt;depends>jboss.admin:service=PluginManager&lt;/depends> 
&lt;/jboss-web>

#vim deploy/ management/console-mgr.sar/web-console.war/WEB-INF/web.xml

Uncomment this part:
&lt;security-constraint> 
&lt;web-resource-collection> 
&lt;web-resource-name>HtmlAdaptor&lt;/web-resource-name> 
&lt;description>An example security config that only allows users with the 
role JBossAdmin to access the HTML JMX console web application 
&lt;/description> 
&lt;url-pattern>/*&lt;/url-pattern> 
&lt;http-method>GET&lt;/http-method> 
&lt;http-method>POST&lt;/http-method> 
&lt;/web-resource-collection> 
&lt;auth-constraint> 
&lt;role-name>JBossAdmin&lt;/role-name> 
&lt;/auth-constraint> 
&lt;/security-constraint>

Check the user file path of web-console:
#cat conf/login-config.xml

Update the user & password [Format username=password]:
#vim console-mgr.sar/web-console.war/WEB-INF/classes/web-console-users.properties

admin=admin
</pre><br /><br />Security invoker<br /><br /><pre name="code" class="java">Uncomment this paragraph in the “/deploy/jmx-invoker-service.xml” file.

&lt;!-- Uncomment to require authenticated users
&lt;interceptor code="org.jboss.jmx.connector.invoker.AuthenticationInterceptor"
securityDomain="java:/jaas/jmx-console"/>
-->
</pre><br /><br /><strong>Check</strong><br />Check whether the Jboss is successful:<br /><br />http:// 192.168.150.75/<br />http:// 192.168.150.75/jmx-console/<br />http:// 192.168.150.75/web-console/
          <br/>
          <span style="color:red;">
            <a href="http://powerntt.javaeye.com/blog/226904#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Tue, 12 Aug 2008 10:37:20 +0800</pubDate>
        <link>http://powerntt.javaeye.com/blog/226904</link>
        <guid>http://powerntt.javaeye.com/blog/226904</guid>
      </item>
  </channel>
</rss>