`
ruirui516888
  • 浏览: 136894 次
文章分类
社区版块
存档分类
最新评论

如何在ubuntu server 10.04 安装jboss4.2.3GA服务?

 
阅读更多

<!-- [if !mso]> <mce:style><!-- v/:* {behavior:url(#default#VML);} o/:* {behavior:url(#default#VML);} w/:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} --> <!-- [endif]--><!-- [if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:SpaceForUL/> <w:BalanceSingleByteDoubleByteWidth/> <w:DoNotLeaveBackslashAlone/> <w:ULTrailSpace/> <w:DoNotExpandShiftReturn/> <w:AdjustLineHeightInTable/> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:UseFELayout/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!-- [if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><!-- [if !mso]> <object classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui> </object> <mce:style><!-- st1/:*{behavior:url(#ieooui) } --> <!-- [endif]--><!-- [if gte mso 10]> <mce:style><!-- /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} --> <!-- [endif]-->

如何设置 jboss 自动启动?

http://wiki.ubuntu.org.cn/JBoss_5.0.0GA%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97 (参考这个链接)

sudo mkdir /opt/jboss

sudo mkdir /home/jboss

sudo useradd -s /bin/bash -d /home/jboss jboss

sudo chown -R jboss:jboss /opt/jboss/

sudo chown -R jboss:jboss /home/jboss/ 

如果没有安装 unzip ,哪么 sudo apt-get install unzip

sudo chown jboss:jboss jboss-5.0.0.GA.zip

sudo chown jboss:jboss OpenKM*.zip

sudo su jboss

unzip jboss-5.0.0.GA.zip -d /opt/jboss

unzip OpenKM*.zp –d /opt/jboss

exit // 退出 jboss 用户

Create a file with the script:

$ sudo vim /etc/init.d/jboss

#!/bin/sh

### BEGIN INIT INFO

# Provides: jboss

# Required-Start: $remote_fs $syslog

# Required-Stop: $remote_fs $syslog

# Default-Start: 2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: Start and stop JBoss AS

# Description: Enable JBoss AS service provided by daemon.

### END INIT INFO

ECHO= / bin/ echo

TEST= / usr/ bin/ test

JBOSS_USER= jboss

JBOSS_IP= 0.0.0 .0

JBOSS_HOME= / opt/ jboss/ jboss-4.2.3 .GA

JBOSS_START_SCRIPT=$JBOSS_HOME / bin/ run.sh

JBOSS_STOP_SCRIPT=$JBOSS_HOME / bin/ shutdown.sh

$TEST -x $JBOSS_START_SCRIPT || exit 0

$TEST -x $JBOSS_STOP_SCRIPT || exit 0

start() {

$ECHO -n "Starting JBoss"

su - $JBOSS_USER -c "$JBOSS_START_SCRIPT -b $JBOSS_IP > /dev/null 2> /dev/null &"

$ECHO "."

}

stop() {

$ECHO -n "Stopping JBoss"

su - $JBOSS_USER -c "$JBOSS_STOP_SCRIPT -s $JBOSS_IP > /dev/null &"

while [ "$(ps -fu $JBOSS_USER | grep java | grep jboss | wc -l)" -gt "0" ] ; do

sleep 5 ; $ECHO -n "."

done

$ECHO "."

}

case "$1" in

start)

start

;;

stop)

stop

;;

restart)

stop

sleep 30

start

;;

* )

$ECHO "Usage: jboss {start|stop|restart}"

exit 1

esac

exit 0

jboss 文件能够执行(And make it executable:

$ sudo chmod 755 /etc/init.d/jboss



Now update the run-levels: 提升运行级别

$ sudo update-rc.d jboss defaults 


下面的是执行后输出的日志:
 Adding system startup for /etc/init.d/jboss ...

 
/etc/rc0.d/K20jboss -> ../init.d/jboss

 
/etc/rc1.d/K20jboss -> ../init.d/jboss

 
/etc/rc6.d/K20jboss -> ../init.d/jboss

 
/etc/rc2.d/S20jboss -> ../init.d/jboss

 
/etc/rc3.d/S20jboss -> ../init.d/jboss

 
/etc/rc4.d/S20jboss -> ../init.d/jboss

 
/etc/rc5.d/S20jboss -> ../init.d/jboss




[编辑 ] 启动 JBoss

sudo /etc/init.d/jboss start 

[编辑 ] 卸载 JBoss

sudo /etc/init.d/jboss stop

sudo update-rc.d -f jboss remove

sudo rm -vf /etc/init.d/jboss

sudo userdel jboss

sudo rm -rvf /opt/jboss 


手工启动jboss服务
<!-- [if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:SpaceForUL/> <w:BalanceSingleByteDoubleByteWidth/> <w:DoNotLeaveBackslashAlone/> <w:ULTrailSpace/> <w:DoNotExpandShiftReturn/> <w:AdjustLineHeightInTable/> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:UseFELayout/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!-- [if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><!-- [if gte mso 10]> <mce:style><!-- /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} --><!-- [endif]--> sudo service proftpd start

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics