在OEL6下安装JBOSS 和 JDK1.7
1、 JDK1.7安装
[root@heliy /home/fukeyun]#rpm -ivh ./Desktop/download/jdk-7-linux-i586.rpm
Preparing... ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
plugin.jar...
javaws.jar...
deploy.jar...
[root@heliy /home/fukeyun]#ls /usr/java/
default jdk1.7.0 latest
JDK 环境变量配置(全局)
JDK 包含Java运行时(JRE)和虚拟机(JVM)等 JRE=Java Runtime Environment JVM=Java Virtual Machine
建议不要在/etc/profile添加,在/etc/profile.d下添加一个脚本即可
我配置如下:/etc/profile.d/heliy.sh
[fukeyun@heliy ~]$cat /etc/profile.d/heliy.sh
# /etc/profile.d/heliy.sh
# extended PATH environment varibary
export JAVA_HOME=/usr/java/jdk1.7.0/
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
其实jboss能用到的全局变量只有JAVA_HOME一个,剩下两个是设置而已,jboss没有用到。jboss会自动创建的变量为:
JBoss Bootstrap Environment
JBOSS_HOME: /work/jboss-as-7.0.0.Final ##存放jboss的路径
JAVA: /usr/java/jdk1.7.0/bin/java
JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true
-Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
-Djboss.modules.system.pkgs=org.jboss.byteman
重启计算机 或 source /etc/profile.d/heliy.sh
注:如果安装的是JDK,则环境变量:JAVA_HOME /usr/local/java/jdk6.0.
如果安装的是JRE,则环境变量:JRE_HOME /usr/local/java/jre6.0
#env
JAVA_HOME=/usr/java/jdk1.7.0/
CLASSPATH=:/usr/java/jdk1.7.0//lib:/usr/java/jdk1.7.0//jre/lib:/usr/java/jdk1.7.0//lib:/usr/java/jdk1.7.0//jre/lib
等
顺便说下firefox的java runtime environment的问题,我琢磨两天后才解决,而且还是看网上别人的教程才搞定的,汗啊,水平不行!
# cd /home/fukeyun/.mozilla/plugins/
[root@heliy plugins]# ln -s /usr/java/jdk1.7.0_01/jre/lib/i386/libnpjp2.so
[root@heliy plugins]# ls
libnpjp2.so
关闭所有firefox,再打开即可。
2、Jboss 安装配置
由于Jboss还在开发阶段,无需安装,解压配置启动即可。
详细介绍,请查看URL:
http://jbosscn.iteye.com/blog/1045347
由于我也是刚接触JBOSS不久,谈不上很精通,所以只能是服务能启动就OK,过些时日理解透了,再来补充。
解压后目录说明:
bin Start up scripts and start up configuration files available for Unix and Windows environments
bundles Location of OSGi bundles
docs/schema XML schema definition files
domain Configuration files, deployment content, and writable areas used by the domain mode processes run from this installation.
modules AS 7 is based on a modular classloading architecture. The various modules used in the server are stored here.
standalone Configuration files, deployment content, and writable areas used by the single standalone server run from this installation.
welcome-content Default Welcome Page content
用standalone模式启动
默认配置文件 standalone.xml (default) 和 standalone.conf
standalone.conf 在standalone.sh 脚步启动时首先加载,大部分都被注释掉了,只有JAVA_OPTS设置。
默认启动standalone.sh,如果想用具体的配置文件启动,用如下格式:
./standalone.sh --server-config= /path.../standalone.xml
[root@heliy /home/fukeyun/Desktop/download/jboss-as-web-7.0.2.Final]#./bin/standalone.sh &
[1] 3193
[root@heliy /home/fukeyun/Desktop/download/jboss-as-web-7.0.2.Final]#=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /home/fukeyun/Desktop/download/jboss-as-web-7.0.2.Final
JAVA: /usr/java/jdk1.7.0//bin/java
JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
=========================================================================
07:57:22,972 INFO [org.jboss.modules] JBoss Modules version 1.0.2.GA
07:57:23,447 INFO [org.jboss.msc] JBoss MSC version 1.0.1.GA
07:57:23,537 INFO [org.jboss.as] JBoss AS 7.0.2.Final "Arc" starting
07:57:25,134 WARN [org.jboss.as] No security realm defined for native management service, all access will be unrestricted.
07:57:25,182 INFO [org.jboss.as] creating http management service using network interface (management) port (9990)
07:57:25,186 WARN [org.jboss.as] No security realm defined for http management service, all access will be unrestricted.
07:57:25,221 INFO [org.jboss.as.logging] Removing bootstrap log handlers
07:57:25,297 INFO [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)
07:57:25,356 INFO [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem.
07:57:25,532 INFO [org.jboss.as.naming] (Controller Boot Thread) JBAS011800: Activating Naming Subsystem
07:57:25,553 INFO [org.jboss.as.naming] (MSC service thread 1-3) JBAS011802: Starting Naming Service
07:57:25,566 INFO [org.jboss.as.osgi] (Controller Boot Thread) JBAS011910: Activating OSGi Subsystem
07:57:25,609 INFO [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem
07:57:25,621 INFO [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 3.2.0.Beta2
07:57:25,644 INFO [org.xnio] (MSC service thread 1-1) XNIO Version 3.0.0.Beta3
07:57:25,669 INFO [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.0.0.Beta3
07:57:26,053 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-3) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/i386:/lib:/usr/lib
07:57:26,105 INFO [org.jboss.as.remoting] (MSC service thread 1-1) Listening on /127.0.0.1:9999
07:57:26,128 INFO [org.jboss.as.jmx.JMXConnectorService] (MSC service thread 1-1) Starting remote JMX connector
07:57:26,208 INFO [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem
07:57:26,299 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
07:57:26,645 INFO [org.jboss.as.connector] (MSC service thread 1-4) Starting JCA Subsystem (JBoss IronJacamar 1.0.3.Final)
07:57:26,749 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) Bound data source [java:jboss/datasources/ExampleDS]
07:57:27,542 INFO [org.jboss.as.deployment] (MSC service thread 1-2) Started FileSystemDeploymentService for directory /home/fukeyun/Desktop/download/jboss-as-web-7.0.2.Final/standalone/deployments
07:57:27,591 INFO [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.2.Final "Arc" started in 5164ms - Started 93 of 148 services (55 services are passive or on-demand)
在firefox 中打开:http://localhost:8080 http://localhost:9990/console //管理端口,若想修改jboss,修改standalone.xml文件,比如把8080端口修改等.
关闭:#/bin/jboss-admin.sh --connect command=:shutdown
domain下格式:
/jboss-admin.sh --connect controller=<IP>:<port> command=:shutdown
对应的虚拟服务文件路径:
[root@heliy ~]# /home/fukeyun/Desktop/download/jboss-as-web-7.0.2.Final/welcome-content
命令行管理:
[root@heliy ~]#/home/fukeyun/Desktop/download/jboss-as-web-7.0.2.Final/bin/jboss-admin.sh --connect
Connected to standalone controller at localhost:9999
[standalone@localhost:9999 /] help
For a list of commands available in the current context execute
help --commands
有空再细看相关文档,多多学习。