1、安装jdk
比如我们存放路径/backup/jdk-6u12-linux-i586.bin
Chmod +x jdk-6u12-linux-i586.bin
执行以下命令:./ jdk-6u12-linux-i586.bin
解压后得到jdk1.6.0_12
Mv jdk1.6.0_12 /usr/local/jdk1.6.0_12
设置环境变量:vi /etc/profile
#---------------------------------jboss jdk start-----------------------
JAVA_HOME=/usr/local/jdk1.6.0_12
JBOSS_HOME=/usr/local/jboss
JBOSS_HOST=0.0.0.0
JBOSS_USER=root
CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export JBOSS_HOME JAVA_HOME JBOSS_HOST JBOSS_USER CLASSPATH PATH
#---------------------------------jboss jdk end-------------------------
2、安装jboss
Cd /backup
Unzip jboss-4.2.3.GA-jdk6.zip
Mv jboss-4.2.3.GA /usr/local/jboss
操作source /etc/profile使环境变量生效
Java –version如果出现:
java version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) Server VM (build 11.2-b01, mixed mode)
表示安装生效。
3、启动jboss
Cd /usr/local/jboss/bin
Cp jboss_init_redhat.sh jboss.sh
Vi jboss.sh
修改JBOSS_HOME=${JBOSS_HOME:-“/usr/local/jboss”}
JBOSS_USER=${JBOSS_USER:-“root”}
JAVAPATH=${JAVAPATH:-“/usr/local/jdk1.6.0_12/bin”}
JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF $JBOSS_BIND_ADDR}
然后启动./jboss.sh start
停止./jboss.sh stop
控制台修改
1、修改jmx-console的控制
Cd /usr/local/jboss/server/default/deploy/jmx-console.war/WEB-INF
vi jboss-web.xml
把<security-domain>java:/jaas/web-console</security-domain>这一行的注释去掉。
Vi web.xml
把<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>
这几行的注释也去掉。
然后cd /usr/local/jboss/server/default/conf/props
Vi jmx-console-roles.properties
# A sample roles.properties file for use with the UserRolesLoginModule
Admin=JBossAdmin,HttpInvoker
Vi jmx-console-users.properties
# A sample users.properties file for use with the UsersRolesLoginModule
Admin=admin
2、修改web-console控制台
Cd /usr/local/jboss/server/default/deploy/management/console-mgr.sar/web-console.war/WEB-INF
Vi jboss-web.xml
把<security-domain>java:/jaas/web-console</security-domain>这一行的注释去掉。
Vi web.xml
把<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>
这几行的注释也去掉。
然后cd /usr/local/jboss/server/default/conf
新建web-console-roles.properties
Web-console-users.properties
Vi web-console-roles.properties
# A sample roles.properties file for use with the UserRolesLoginModule
Admin=JBossAdmin
Vi web-console-users.properties
# A sample users.properties file for use with the UsersRolesLoginModule
Admin=admin
修改完后直接就能看到控制台了。
3、在jboss做虚拟站点
Cd /usr/local/jboss/server/default/deploy/jboss-web.deployer
Vi server.xml
找到
在和之间添加一段
deployOnStartup="false" deployXML="false">
ic.test.com
prefix="ic" suffix=".log" pattern="common"
directory="${jboss.server.home.dir}/log"/>
并在站点下的WEB-INF文件中创建jboss-web.xml文件,并添加如下:
/
ic.test.com