Chinaunix首页 | 论坛 | 博客
  • 博客访问: 308376
  • 博文数量: 63
  • 博客积分: 1997
  • 博客等级: 上尉
  • 技术积分: 690
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-29 11:17
文章分类

全部博文(63)

文章存档

2010年(26)

2009年(37)

我的朋友

分类: LINUX

2009-07-09 17:14:30

jboss+jdk安装配置

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-domainjava:/jaas/web-console/security-domain>这一行的注释去掉。

Vi web.xml

把<security-constraint
             
web-resource-collection
                    
web-resource-nameHtmlAdaptor/web-resource-name
                    
descriptionAn 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-methodGET/http-method
                    
http-methodPOST/http-method
             
/web-resource-collection
             
auth-constraint
                    
role-nameJBossAdmin/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-domainjava:/jaas/web-console/security-domain>这一行的注释去掉。

Vi web.xml

把<security-constraint
             
web-resource-collection
                    
web-resource-nameHtmlAdaptor/web-resource-name
                    
descriptionAn 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-methodGET/http-method
                    
http-methodPOST/http-method
             
/web-resource-collection
             
auth-constraint
                    
role-nameJBossAdmin/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

阅读(2762) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~