Configuring Oracle Web Cache for Caching a Java EE Application文档格式.docx
《Configuring Oracle Web Cache for Caching a Java EE Application文档格式.docx》由会员分享,可在线阅读,更多相关《Configuring Oracle Web Cache for Caching a Java EE Application文档格式.docx(35页珍藏版)》请在冰豆网上搜索。
∙Availability:
Throughsurgeprotection,clustering,loadbalancing,andfailover
∙Developerproductivity:
Noneedtorollyourowncachemeansfastertime-to-market
∙Bottomline:
Reducedloadonapplicationanddatabaseserverstranslatesintoinfrastructurecostsavings
*ESIisasimplemarkuplanguageusedtodefinecomponentsofaWebpagefordynamicassemblyanddeliveryofWebapplicationsattheedgeoftheInternet.MoreinformationaboutESIisavailableat
SoftwareandHardwareRequirements(Optional)
Thefollowingisalistofsoftwarerequirements:
Item
Specification
ProcessorType
IntelXeonorPentiumIV
ProcessorSpeed
2.4GHzorhigher
NumberofProcessors
1ormore(ifrequired)
Memory
2GB
HardDiskSpace
20GB(initialsize)
OperatingSystem
RedHatEnterpriseLinux4Update5
Prerequisites
Beforestartingthistutorial,youshould:
1.
HaveaninstanceofOracleWebLogicServer10.3.
2.
Haveconfiguredadomain.
3.
Downloadandunzipthewebapp.zipfileonyourmachine.DeploytheWebAppWar.warfiletotheapplicationWebserver.
ConfiguringportconfigurationforOracleWebCachewithOPMN
OracleWebCacheusesHTTPorHTTPSlisteningporttoreceiverequests.Youcanalsoaddlisteningports,ifnecessary.Forexample,itmaybenecessarytoaddalisteningporttoassignOracleWebCacheaportthatanoriginserverwaspreviouslylisteningon.
Inadditiontoalisteningport,OracleWebCachealsoreceivesrequestsfortheadminserverprocess,invalidation,andstatisticsmonitoringrequestsonspecificHTTPorHTTPSlisteningports.
VerifyingportconfigurationforOracleWebCache
VerifyingportconfigurationforOracleWebCachewithFusionMiddlewareControl
AddinganOracleWebCachelisteningport
SpecifySitedefinitions
MapsitedefinitionstoOriginServers
TodetermineportsinusebyOracleWebCachewithOPMN,executethefollowingcommands:
NavigatetoyourORACLE_INSTANCE/bindirectoryandexecuteopmnctlstatus-lcommand.Forexample:
$cd/u01/app/oracle/product/fmw/11.1.1.1/as_1/opmn/bin/opmnctlstatus-l
Inthisexample:
Port7785istheHTTPlisteningportforOracleWebCache,representedbyhttp_
listen.
Port7786istheHTTPlisteningportfortheadminserverprocess,representedby
WebCache-admin
Port7787istheHTTPlisteningportforstatisticsmonitoringrequests,represented
byhttp_stat.
Port7788istheHTTPlisteningportforinvalidationrequests,representedby
http_invalidation.
Port7789istheHTTPlisteningportforOracleWebCache,representedbyhttps_
EnterthefollowingURLtodisplayFusionMiddlewareControl.
http:
//<
hostname>
.<
domain>
:
<
port>
/em
EntertheOracleFusionMiddlewareadministratorusernameandpassword.ClickLogin.
Fromthenavigationpane,expandthefarmandthentheWebTierinstallationtype,andselectOracleWebCachecomponent.FromtheWebCachemenu,selectPortUsage.
ThePortsUsagepagedisplays.
Youcanaddlisteningports,ifnecessary.Forexample,itmaybenecessarytoaddlisteningporttoassignOracleWebcacheaportthatanoriginserverwaspreviouslylisteningon.ToaddanHTTPlisteningport:
FromtheWebCachemenu,selectAdministration>
PortsConfiguration.
Theportsconfigurationpagedisplays.ClickCreate.TheCreatePortpageappears.
FromthePortTypelist,selectNORM.IntheIPAddressfield,selectANYtorepresentanyIPaddress.InthePortfield,enterthelisteningportfromwhichOracleWebCachereceivesclientrequestsfortheWebsite.Ensurethatthisportnumberisnotalreadyinuse.Forexample,enter7890.
ClickOK.
4.
ClickWebCache>
Control>
RestarttorestartOracleWebCache.
ClickRestarttoconfirm.
ClickClosewhentherestartoperationcompletessuccessfully.
OracleWebCachecachesandassemblesdynamiccontentforoneormoreWebsites.WhenOracleWebCachereceivesabrowserrequestforadocument,itdeterminesthedestinationsitebyusingoneofthefollowingelements:
∙Hostrequest-headervaluefromtherequest
∙HostportionoftherequestedURL
OracleWebCachethenlooksuptheconfiguredsitesettingsandmappingstodeterminewhetherthesiteissupported,andtheapplicationWebserversorproxyserversandcachingrulesforthesite.
Toconfigureasitedefinition,navigatetotheOracleWebCacheHomepageinFusionMiddlewareControl.FromtheWebCachemenu,selectAdministration>
Sites.
.
TheSitespageisdisplayed.FromtheSiteDefinitionssection,clickCreatetoaddanewsite.
EnterthefollowinginformationtoconfigureOracleWebCachewithinformationaboutthenamedWebsite:
Parameter
Description
Host
Enterthehostnameofthesite,suchas.Donotusethewildcard*torepresentmultiplesites.
Port
EntertheportnumberfromwhichtheWebsiteislisteningforincomingHTTPorHTTPSrequests.Theportnumbershouldbeoftheportusedinbrowserrequests.
URLPrefix
EnterthepathprefixoftheURLstodistinguishthissitefromanothersitethatsharesthesamehostname.DonotincludethefilenameorembeddedURLparametersintheprefixandmakesurethattheprefixstartswith“/”.Whendefiningasitedefinition,youcanspecifyaURLpathprefixforthosesitesthatsharethesamehostname.
OracleWebCacheresolvesanincomingrequestfirsttoasitedefinition,andthentothefirstmatchingsite-to-originservermapping.
ClickApplyandthenrestartOracleWebCachefromWebCache>
Restart.
ClickClosetoclosetheConfirmationwindow.
ConfigureOracleWebCachewiththeapplicationWebserversorproxyserversto
whichitsendscachemisses.Typically,OracleWebCacheusesapplicationWebservers
forinternalsitesandproxyserversforexternalsitesoutsideafirewall.
IfOracleHTTPServerwasinstalled,theinstallationprocesscreatesadefaultorigin
serverbasedonthehostnameandlisteningportofOracleHTTPServer.
OracleWebCacheonlyforwardsrequeststoaconfiguredoriginserveriftheorigin
serverismappedtoaWebsite.
FromtheWebCachemenu,selectAdministrationandthenSites.
TheSitespagedisplays.FromtheSite-to-ServerMappingsection,clickCreate.
EnterthefollowinginformationfortheOriginServertoenableittosendOracleWebCacherequests:
HostPattern
Enterthesitepattern,suchas.
PortPattern
EntertheHTTPorHTTPSportnumberfortheWebsitefromwhichOracleWebCacheislisteningforincomingrequests.
SelecttheWebServer()towhichtheadditionalWebCacheportshouldbemapped.TheWebServerisnowlistedunderSelectedOriginServers.
IntheOriginServerssection,selecttheoriginserver.ClickMove.
ClickApply.
RestartOracleWebCachefromWebCachemenu>
AddingCachingRulesandCompression
IfyouwanttocacheyourdocumentbyusingOracleWebCache,thenyoumustestablishacachingpolicy.Thecachingpolicycanbeembe