linux下weblogic的安装和部署

Attend 2010-12-23

从weblogic的安装开始。

一.weblogic的安装

1.创建weblogic的组和用户

这是为了更好的管理你的Linux服务器。当然,如果你只是玩玩的,那么直接用root也没什么不可以。

创建组:

[root@localhost~]#groupadd-g501weblogic

上面的-g参数是用来指定GID的。上面命令的翻译过来就是添加一个GID为501的名为weblogic的组。GID在500以前的一般是系统级的。看看是否成功创建了组:

[root@localhost~]#cat/etc/group

在group文件的最下方应该可以看到刚才创建的群组weblogic:x:501:

创建用户:

[root@localhost~]#useradd-u1001-g501weblogic

上面的-u参数是指定UID的,-g参数是指定其所属组GID的。翻译过来就是添加一个UID为1001的并且属于刚才创建的组的名为weblogic的用户。同样,UID在1000以前的属于系统级的。看看是否成功创建了用户:

[root@localhost~]#cat/etc/passwd

在该文件内容的最下方应该可以看到所创建的用户weblogic:x:1001:501::/home/weblogic:/bin/bash

2.创建一个目录存放安装文件

[root@localhost~]#mkdir/home/weblogic/share/

毕竟Linux用着不如windows顺手,下载安装文件还是用windows吧。完了利用SMB或者直接用SSH传过来就行。

[root@localhost~]#cd/home/weblogic/share/

Linux的权限体系非常严格,需要对文件赋予权限后才能做相应操作。更改share文件夹的所有者为weblogic。

[root@localhost~]#chown-R/home/weblogic/shareweblogic

[root@localhostshare]#ls-al

drwxrwxrwx2rootroot409608-0813:51.

drwx------4weblogicweblogic409608-0812:47..

-rwxrwx---1weblogicweblogic3587087542008-08-15server816_linux32.bin

3.安装过程

既然所有者已经给了weblogic了,当然我们需要切换用户去安装。

[root@localhostshare]#suweblogic

以下就开始执行安装文件进行安装了:

[weblogic@localhostshare]$./server816_linux32.bin

Extracting0%....................................................................................................100%

UnabletoinstantiateGUI,defaultingtoconsolemode.

解包需要一点时间,耐心等待一小会。之后会出现安装欢迎界面:

<-------------------------------------------------------------------BEAInstaller-WebLogicServer8.1SP6------------------------------------------------------------------->

Welcome:

--------

ThisinstallerwillguideyouthroughtheinstallationofWebLogicServer8.1SP6.Type"Next"orentertoproceedtothenextprompt.Ifyouwanttochangedataentered

previously,type"Previous".Youmayquittheinstalleratanytimebytyping"Exit".

后面还有,输入Next,回车继续到许可协议页面:

Enter[Exit][Next]>Next

<-------------------------------------------------------------------BEAInstaller-WebLogicServer8.1SP6------------------------------------------------------------------->

BEASystemsLicenseAgreement:

------------------------------

BEASYSTEMS,INC.SOFTWARELICENSEAGREEMENT

USEOFSOFTWAREORDEREDFROMBEASYSTEMS,INC.("BEA")ISPROVIDEDONLYUNDERLICENSEFROMBEA.PLEASEREADTHEFOLLOWINGLICENSECAREFULLYANDINDICATEYOURACCEPTANCEBY

CLICKINGTHEACCEPTANCEBOX.CERTAINCAPITALIZEDTERMSAREDEFINEDINSECTION11.

1.LICENSETERMS

a.WebLogicSDKUse.ThetermsofthisSection1(a)areapplicabletoyouifyouhaveregisteredasaWebLogicSDKcustomer.SubjecttothetermsofthisAgreement,BEAgrantstoyouanon-exclusive,non-transferable,royalty-freelicensetouseWebLogicSDKsolelyforDevelopmentUseandScale-LimitedPersonalUseforthenumberofusersand/or

developersandthenumberofCPU's,Serversand/orattheSites,asspecifiedatthetimeofregistration.ThirdpartysoftwareproductsormodulessuppliedbyBEA,ifany,may

beusedsolelywiththeSoftware.AllrightsnotspecificallygrantedtoyouhereinareretainedbyBEA.

b.WebLogicSDKProUse.ThetermsofthisSection1(b)areapplicabletoyouifyouhaveregisteredasaWebLogicSDKProcustomer.SubjecttothetermsofthisAgreement,BEAgrantstoyouanon-exclusive,non-transferable,fee-bearinglicensetouseWebLogicSDKProsolelyforDevelopmentUseandScale-LimitedCommercialUseforthenumberofusers

and/ordevelopersandthenumberofCPU's,Serversand/orattheSites,asspecifiedonBEA'sinvoice.ThirdpartysoftwareproductsormodulessuppliedbyBEA,ifany,maybe

usedsolelywiththeSoftware.AllrightsnotspecificallygrantedtoyouhereinareretainedbyBEA.

c.EvaluationUse.ThetermsofthisSection1(c)areapplicabletoyouifyouhaveregisteredasanEvaluationUsecustomer.SubjecttothetermsofthisAgreement,BEAgrantstoyouanon-exclusive,non-transferable,licensetousetheSoftwaresolelyforEvaluationUse.ThirdpartysoftwareproductsormodulessuppliedbyBEA,ifany,maybeused

solelywiththeSoftware,andmaybesubjecttoyouracceptanceoftermsandconditionsprovidedbysuchthirdparties.ThislicensebeginsupondownloadingandendsifandwhenterminatedbyBEAinaccordancewiththisAgreement.WhenthelicenseterminatesyoumuststopusingtheSoftware.Allrightsnotspecificallygrantedtoyouhereinare

retainedbyBEA.NotethatnotallSoftwareisavailableforEvaluationUse.YourEvaluationUselicenseshallterminateontheearlierof:(i)thelicensekeyprovidedbyBEAexpiringorceasingtofunction;(ii)atanytimeuponnoticefromBEA;or(iii)theexpirationdateindicatedinanyrelatedBEAquotationororderdocument.

d.DevelopmentUse.ThetermsofthisSection1(d)areapplicabletoyouifyouhaveregisteredasaDevelopmentUsecustomer.SubjecttothetermsofthisAgreement,BEAgrants

SelectOption:

1-Yes,Iagreewiththetermsofthelicense

2-No,Idonotagreewiththetermsofthelicense

问是否同意此协议,废话,输入1回车继续:

EnteroptionnumbertoselectOR[Down][Exit][Previous]>1

<-------------------------------------------------------------------BEAInstaller-WebLogicServer8.1SP6------------------------------------------------------------------->

ChooseBEAHomeDirectory:

--------------------------

"BEAHome"=[/home/weblogic/bea]

此处设置程序主目录,输入Next表示接受默认路径,不然就自己输入一个路径回车:

InputnewBEAHomeOR[Exit][Previous][Next]>/var/bea

<-------------------------------------------------------------------BEAInstaller-WebLogicServer8.1SP6------------------------------------------------------------------->

ChooseBEAHomeDirectory:

--------------------------

*BEAhomechoice

->1|Yes,UsethisBEAhomedirectory[/var/bea]

2|No,returntoBEAhomedirectoryselection

此处确认程序主目录,输入2可以回到上一界面重新设置,输入1表示确认之前的设定,回车继续:

EnterindexnumbertoselectOR[Exit][Previous][Next]>1

<-------------------------------------------------------------------BEAInstaller-WebLogicServer8.1SP6------------------------------------------------------------------->

ChooseInstallType:

--------------------

->1|Complete

|InstallthecompleteBEAWebLogicPlatform.

2|CustomInstallation

|Choosesoftwarecomponentstoinstallandperformoptionalconfiguration.

此处选择安装模式,选择2开始自定义安装;选择1开始完全安装,如果不很熟悉就选1然后回车:

EnterindexnumbertoselectOR[Exit][Previous][Next]>1

<-------------------------------------------------------------------BEAInstaller-WebLogicServer8.1SP6------------------------------------------------------------------->

ChooseProductDirectory:

-------------------------

"ProductInstallationDirectory"=[/var/bea/weblogic81]

此处设置程序安装路径,可以定义个一个有权限的路径,或者输入Next使用之前设置的程序主目录:

InputnewProductInstallationDirectoryOR[Exit][Previous][Next]>Next

<-------------------------------------------------------------------BEAInstaller-WebLogicServer8.1SP6------------------------------------------------------------------->

ChooseProductDirectory:

-------------------------

->1|Yes,usethisproductdirectory[/var/bea/weblogic81]

2|No,selectanotherproductdirectory

再次确认程序安装路径,输入1回车。之后会出现一个进度条,程序就开始安装了,安装完程序后还会安装SUN的JDK,如果已经有了JDK不想再安装,可以在之前的步骤选择自定义安装,并去掉它。

EnterindexnumbertoselectOR[Exit][Previous][Next]>1

<-------------------------------------------------------------------BEAInstaller-WebLogicServer8.1SP6------------------------------------------------------------------->

Installingfiles..

0%25%50%75%100%

[------------|------------|------------|------------]

[**************************************************

<-------------------------------------------------------------------BEAInstaller-WebLogicServer8.1SP6------------------------------------------------------------------->

InstallingJDK....

0%25%50%75%100%

[------------|------------|------------|------------]

[*************************************************

<-------------------------------------------------------------------BEAInstaller-WebLogicServer8.1SP6------------------------------------------------------------------->

InstallationComplete

Congratulations!WebLogicServer8.1SP6hasbeensuccessfullyinstalledto/var/bea/weblogic81.

OK,程序安装完成,按回车结束。

PressanykeytocontinueOR[Exit]>

二.新建domain域

在安装主目录下的/weblogic81/common/bin/下执行config.sh

[weblogic@localhostbin]$./config.sh

UnabletoinstantiateGUI,defaultingtoconsolemode.

<----------------------------------------------------------------------BEAWebLogicConfigurationWizard---------------------------------------------------------------------->

CreateorExtendaConfiguration:

---------------------------------

Choosebetweencreatingandextendingaconfiguration.Basedonyourselection,theConfigurationWizardguidesyouthroughthestepstogenerateaneworextendanexisting

configuration.

->1|CreateanewWebLogicconfiguration

|StartheretocreateaWebLogicconfigurationinyourprojectsdirectory.

2|ExtendanexistingWebLogicconfiguration

|StartheretoextendanexistingWebLogicconfiguration.Usethisoptiontoaddapplicationsandservices,includingDatabaseaccess(JDBC)andMessaging(JMS).This

|optionalsoenablesyoutoextendfunctionalitybyenablingWebLogicWorkshop.

此处选择选择2为维护现有的domain,输入1回车继续,开始创建一个新的domain:

EnterindexnumbertoselectOR[Exit][Next]>1

<----------------------------------------------------------------------BEAWebLogicConfigurationWizard---------------------------------------------------------------------->

SelectaDomainTemplate:

-------------------------

Pleaseselectatemplatefromthelistorselectanotherdirectoryoftemplates.

*[/var/bea/weblogic81/common/templates/domains]

1|WebLogicServerExamplesDomain8.1.6.0

|BEASystems,Inc.

|CreatetheWebLogicServerExamplesdomaininadirectoryoutsideoftheinstalledkit.TheExamplesdomaincontainsacollectionofexamplestoshowbestpracticesfor

|codingindividualJ2EEAPIs.

2|BasicWebLogicWorkshopDomain8.1.6.0

|BEASystems,Inc.

|CreateabasicWebLogicWorkshopdomain,withoutinstallingsampleapplications.DomainscreatedfromthistemplatewillsupporttheWebLogicServerandWebLogic

|Workshopruntimefunctionality,includingsupportforJ2EEapplications,Webapplications,WebServicesandcustomcontrols.Usedomainscreatedfromthistemplatefor

|developmentofWebLogicWorkshopapplications.

->3|BasicWebLogicServerDomain8.1.6.0

|BEASystems,Inc.

|CreateabasicWebLogicServerdomainwithoutinstallingsampleapplications.

4|AvitekMedicalRecordsSampleDomain8.1.6.0

|BEASystems,Inc.

|CreatetheAvitekMedicalRecordsdomaininadirectoryoutsideoftheinstalledkit.TheAvitekMedicalRecordsisaWebLogicServersampleapplicationsuitethat

|conciselydemonstratesallaspectsoftheJ2EEplatform.

5|Selectanotherdirectorylocation

此处根据用途选择不同的配置模版,输入3回车继续,创建一个serverdomain:

EnterindexnumbertoselectOR[Exit][Previous][Next]>3

<----------------------------------------------------------------------BEAWebLogicConfigurationWizard---------------------------------------------------------------------->

ChooseConfigurationOption:

----------------------------

*Doyouwanttorunthewizardinexpressmode?

->1|Yes

2|No

此处提示是否进行快速配置,选择2,则开始自定义配置,如果需要更改端口号等配置就输入2,不过此处稍显繁琐,可以之后修改config.xml文件,故此处推荐输入1回车继续:

EnterindexnumbertoselectOR[Exit][Previous][Next]>1

<----------------------------------------------------------------------BEAWebLogicConfigurationWizard---------------------------------------------------------------------->

ConfigureAdministrativeUsernameandPassword:

-----------------------------------------------

CreateauserautomaticallyassignedtotheAdministrativeRole.Thisuseristhedefaultadministratorusedtostartdevelopmentmodeservers.

|Name|Value|

_|_________________________|_________________________________|

1|*Username:|weblogic|

2|*Userpassword:||

3|*Confirmuserpassword:||

4|Description:|Thedefaultadministrationuser|

SelectOption:

1-Modify"Username"

2-Modify"Userpassword"

3-Modify"Confirmuserpassword"

4-Modify"Description"

此处为控制台设置用户名和密码,用户名默认为weblogic,可以输入1更改,此处输入2,设置密码:

EnteroptionnumbertoselectOR[Exit][Previous][Next]>2

<----------------------------------------------------------------------BEAWebLogicConfigurationWizard---------------------------------------------------------------------->

ConfigureAdministrativeUsernameandPassword:

-----------------------------------------------

CreateauserautomaticallyassignedtotheAdministrativeRole.Thisuseristhedefaultadministratorusedtostartdevelopmentmodeservers.

"*Userpassword:"=[]

输入一个密码后回车:

Inputnew*Userpassword:OR[Exit][Reset][Accept]>

<----------------------------------------------------------------------BEAWebLogicConfigurationWizard---------------------------------------------------------------------->

ConfigureAdministrativeUsernameandPassword:

-----------------------------------------------

CreateauserautomaticallyassignedtotheAdministrativeRole.Thisuseristhedefaultadministratorusedtostartdevelopmentmodeservers.

|Name|Value|

_|_________________________|______________________________________|

1|*Username:|weblogic|

2|*Userpassword:|********

3|*Confirmuserpassword:||

4|Description:|Thedefaultadministrationuser|

SelectOption:

1-Modify"Username"

2-Modify"Userpassword"

3-Modify"Confirmuserpassword"

4-Modify"Description"

5-DiscardChanges

输入3进行验证密码,要与上一步的密码一致:

EnteroptionnumbertoselectOR[Exit][Previous][Next]>3

<----------------------------------------------------------------------BEAWebLogicConfigurationWizard---------------------------------------------------------------------->

ConfigureAdministrativeUsernameandPassword:

-----------------------------------------------

CreateauserautomaticallyassignedtotheAdministrativeRole.Thisuseristhedefaultadministratorusedtostartdevelopmentmodeservers.

"*Confirmuserpassword:"=[]

输入验证密码后回车继续:

Inputnew*Confirmuserpassword:OR[Exit][Reset][Accept]>

<----------------------------------------------------------------------BEAWebLogicConfigurationWizard---------------------------------------------------------------------->

ConfigureAdministrativeUsernameandPassword:

-----------------------------------------------

CreateauserautomaticallyassignedtotheAdministrativeRole.Thisuseristhedefaultadministratorusedtostartdevelopmentmodeservers.

|Name|Value|

_|_________________________|______________________________________|

1|*Username:|weblogic|

2|*Userpassword:|********

3|*Confirmuserpassword:|********|

4|Description:|Thedefaultadministrationuser|

SelectOption:

1-Modify"Username"

2-Modify"Userpassword"

3-Modify"Confirmuserpassword"

4-Modify"Description"

5-DiscardChanges

选项4可以为此server添加备注,选项5为恢复默认。没什么事的话就输入Next回车继续:

EnteroptionnumbertoselectOR[Exit][Previous][Next]>Next

<----------------------------------------------------------------------BEAWebLogicConfigurationWizard---------------------------------------------------------------------->

DomainModeConfiguration:

--------------------------

EnableDevelopmentorProductionModeforthisdomain.

->1|DevelopmentMode

2|ProductionMode

此处询问选择开发模式还是产品模式,当然选择1了,除非你习惯每次起服务都输入用户名和密码,输入1回车继续:

EnterindexnumbertoselectOR[Exit][Previous][Next]>1

<----------------------------------------------------------------------BEAWebLogicConfigurationWizard---------------------------------------------------------------------->

JavaSDKSelection:

-------------------

->1|JRockitSDK1.4.2_10-8160@/var/bea/jrockit81sp6_142_10

2|SunSDK1.4.2_11@/var/bea/jdk142_11

3|OtherJavaSDK

此处询问server将使用的JDK,根据自己需要选择,此处选择了之前自动安装的SUN_JDK_1.4.2_11

EnterindexnumbertoselectOR[Exit][Previous][Next]>2

<----------------------------------------------------------------------BEAWebLogicConfigurationWizard---------------------------------------------------------------------->

Selectthetargetdomaindirectoryforthisconfiguration:

----------------------------------------------------------

"TargetLocation"=[/var/bea/user_projects/domains]

此处设置domain所在的路径,可以输入一个指定的路径或输入Next接受默认

InputnewTargetLocationOR[Exit][Previous][Next]>Next

<----------------------------------------------------------------------BEAWebLogicConfigurationWizard---------------------------------------------------------------------->

EditDomainInformation:

------------------------

|Name|Value|

_|________|__________|

1|*Name:|mydomain|

此处可更改domain的名称输入新的名称或输入Next接受默认名称:

Entervaluefor"Name"OR[Exit][Previous][Next]>Next

<----------------------------------------------------------------------BEAWebLogicConfigurationWizard---------------------------------------------------------------------->

CreatingDomain...

0%25%50%75%100%

[------------|------------|------------|------------]

[***************************************************]

****DomainCreatedSuccessfully!****

耐心等待进度到100%,设置完成。访问http://127.0.0.1/console开始吧!

三.相关问题

1.关于SSH终端乱码

用SSH终端登录可能产生乱码,解决方法:

登陆后输入:

exportLANG=C

exportLANG=zh_ZN.GBK

exportLC_ALL=zh_CN.GBK

2.关于部署完成后其它机器无法访问的问题

如果出现此情况,请检查防火墙配置

输入setup后在防火墙设置中‘允许进入’选项选中HTTP,之后在其它端口项填写Web程序端口号即可解决。

相关推荐