Jboss default方式下的Cluster配置[一]

[b]Dependent Software:[/b]

jboss-4.2.2.GA.zip
httpd-2.2.9.tar.gz
mod_jk-1.2.26-httpd-2.2.6.so
jdk-1_5_0_16-linux-i586-rpm.bin

[b]Install JDK[/b]

[u]Install[/u]

# cd /home/tools
# chmod +x jdk-1_5_0_16-linux-i586-rpm.bin
#./ jdk-1_5_0_16-linux-i586-rpm.bin


[u]Configuration[/u]


# 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



[u]Check[/u]

# java –version

java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02)
Java HotSpot(TM) Server VM (build 1.5.0_16-b02, mixed mode)

[b]Install Jboss[/b]

[u]Install[/u]
# su jboss
# cd /home/tools
# unzip -d /opt/ jboss-4.2.2.GA.zip


[u]Configuration[/u]

# 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



[u]Jboss Security[/u]

Security jmx-console:

#vim deploy/jmx-console.war/WEB-INF/jboss-web.xml

Uncomment this part:
<security-domain>java:/jaas/jmx-console</security-domain>

#vim deploy/jmx-console.war/WEB-INF/web.xml

Uncomment this part:
<security-constraint>
<web-resource-collection>
<web-resource-name>HtmlAdaptor</web-resource-name>
<description>An example security config that only allows users with the
role JBossAdmin to access the HTML JMX console web application
</description>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>JBossAdmin</role-name>
</auth-constraint>
</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


Security web-console:

#vim deploy/ management/console-mgr.sar/web-console.war/WEB-INF/jboss-web.xml

Uncomment this part:
<jboss-web>
<depends>jboss.admin:service=PluginManager</depends>
</jboss-web>

#vim deploy/ management/console-mgr.sar/web-console.war/WEB-INF/web.xml

Uncomment this part:
<security-constraint>
<web-resource-collection>
<web-resource-name>HtmlAdaptor</web-resource-name>
<description>An example security config that only allows users with the
role JBossAdmin to access the HTML JMX console web application
</description>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>JBossAdmin</role-name>
</auth-constraint>
</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


Security invoker

Uncomment this paragraph in the “/deploy/jmx-invoker-service.xml” file.

<!-- Uncomment to require authenticated users
<interceptor code="org.jboss.jmx.connector.invoker.AuthenticationInterceptor"
securityDomain="java:/jaas/jmx-console"/>
-->


[b]Check[/b]
Check whether the Jboss is successful:

http:// 192.168.150.75/
http:// 192.168.150.75/jmx-console/
http:// 192.168.150.75/web-console/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值