Apache + ORDS Quickstart für Produkionsumgebungen

Werbung
Apache+ORDSQuickstartfür
Produk9onsumgebungen
DietmarAust
Opal-Consul9ng,Köln
www.opal-consul9ng.de
OpalConsul9ng
► Dipl.-Inform.DietmarAust,FreelanceConsultant
▪  Master'sDegreeinComputerScience(MSCS)
► BuildingOraclebasedWebApplica9onssince1997
▪  Portal,Forms,Reports,OWAToolkit,nowAPEX!
► 1997-2000:ConsultantatOracleGermany
► Since09/2000:FreelanceConsultant,Since2006–APEX
only!
► Blog:h]p://daust.blogspot.com/
► RegularpresenteratOracleconferences(ODTUG,DOAG,
OOW)
► AuthoroftheJasperReportsIntegra9ontoolkit
▪  h]p://www.opal-consul9ng.de/tools
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 2
► 100nomineesinthecategories(chosenbythecommunity)
▪ 
▪ 
▪ 
▪ 
▪ 
SQL
PL/SQL
APEX
ORDS
DatabaseDesign
► 35finalists
► OrganizedbyOracle,chosenthroughpopularvotebythecommunity
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 3
OpalConsul9ng
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 4
WhyAndWhat?
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 5
WhyAndWhat?
► WHAT?
► SetupaproducMonenvironmentforourOracleAPEXinstance.
► Characteris9cs
▪  Fits80%ofdeployments
▪  Intranetusagemainly
▪  “Basic”securitymeasuresandgoodperformance
► Theproposedsetupisflexibleandcanbeextendedinordertosa9sfymore
elaboraterequirementsforhighersecurityandevenbe]erperformance
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 6
WhyAndWhat?
► WHY?
► InfrastructureforOracleAPEXproducMonenvironmentsoRenpoorly
configured:
▪  S9llusetheembeddedPL/SQLgateway
▪  ORDSconnec9onpoolnotproperlyconfigured
► PeoplefindithardtoimplementtherecommendedsetupwithanApache
h]pserverandORDS,becauseitseemstobecomplicated
► Mypersonalinterest:
▪  Wanttohaveastep-by-stepguidetoimplementtherecommendedarchitecture
▪  Wanttohaveapresenta9ontoeducatemyclientsregardingthearchitecture
andthebestsetup
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 7
Understandingthe
Architecture
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 8
UnderstandingtheArchitecture
OverviewandComponents
http
http
JDBC
Oracle
https
Browser
AJP
Webserver
SQLNet
PL/SQL Gateway
Oracle DB
Serve static files
SSL termination
Cache / Proxy
Compression
...
Translate URL /ords/f?p=100:1 => call to stored procedure
APEX: Execute Logic
Apache Http Server,
Nginx, IIS / Windows
Apache Tomcat, Oracle XML DB
ORDS
mod_plsql
dbms_epg
...
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
&
Generate HTML
Oracle 11.1.0.7 and higher
Oracle XE 11g
23.06.2015
Page 9
UnderstandingtheArchitecture
Consequences/Insights
► TheWORKisdoneINTHEDATABASE
► TheWebserverandPL/SQLgatewaydon’tneedalotofprocessingpower,
mostofthe9meidle
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 10
UnderstandingtheArchitecture
RecommendedArchitecture
► Thecomponentsinthispresenta9on:
▪ 
▪ 
▪ 
▪ 
▪ 
▪ 
Windows732bit(virtualmachine)
Apache2.4
Tomcat8
ORDS3.0
OracleXE11g
APEX5.0.1
AJP
Apache http
Server 2.4
JDBC
Tomcat 8
ORDS 3.0
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
TNS Listener
https
ORDS 3.0
Oracle
Oracle XE 11g
APEX 5.0
23.06.2015
Page 11
UnderstandingtheArchitecture
DatabaseUsers
ORDSiscurrentlymovingfromAPEXDependencytoAPEXIndependence
► ORDSneedsaREPOSITORYtostoreitswebservicedefini9ons
► ORDS2.0
► ORDS3.0
► Schemas
► Schemas
▪  APEX_040200
▪  APEX_LISTENER
▪  APEX_REST_PUBLIC_USER
► Configurationvia
▪  APEXSQLWorkshop
▪  ORDS_METADATA
▪  ORDS_PUBLIC_USER
► Configurationvia
▪  SQLDeveloper
▪  PL/SQLAPI
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 12
UnderstandingtheArchitecture
DatabaseUsers
APEX_PUBLIC_USER
OPTIONALLY installed when using REST services
ORDS 2.0
APEX/OWAmainconnec9onpool
Sizeaccordingtonumberofconcurrentapexusers
APEX_LISTENER(withAPEX4.2.2+)
ReadsRESTDefini9onsfromrepositoryAPEX_040200
APEX_REST_PUBLIC_USER(withAPEX4.2.2+)
RESTConnec9onpoolforallRESTopera9ons
SizeaccordingtoconcurentRESTcalls
► UsersAPEX_LISTENERandAPEX_REST_PUBLIC_USERwerecreatedusingthe
scriptapex_rest_config.sqlaspartoftheAPEXinstalla9on.
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 13
UnderstandingtheArchitecture
DatabaseUsers
► ORDS3.0supportRESTfulWebservicesevenwithoutAPEX
APEX_PUBLIC_USER
ORDS 3.0
APEX/OWAmainconnec9onpool
Sizeaccordingtonumberofconcurrentapexusers
ORDS_METADATA
StoresRESTDefini9ons
ORDS_PUBLIC_USER
RESTConnec9onpoolforallRESTopera9ons
SizeaccordingtoconcurentRESTcalls
► Currentlythereiss9lltheneedfortheusersAPEX_LISTENERand
APEX_REST_PUBLIC_USER:
▪  Thenewdownloadofsta9capplica9onfilesandsta9cworkspacefilesrequireit
▪  Sothatyoucancon9nuetousethemanagementinterfaceintheSQLWorkshop
(elseyouhavetouseSQLDeveloper)
Setting Up the Oracle APEX Listener (Now ORDS) for Production
23.06.2015
Page 14
Environments
UnderstandingtheArchitecture
DatabaseUsers
► Shouldwemigratetheexis9ngRESTfuldefini9onsinourAPEXenvironment?
▪  =>!!!NO!!!
► Whathappens?
▪  TheygetcopiedoverfromAPEX_050000=>ORDS_METADATA
▪  Nowtheyexistintwoplacesredundantly
▪  Inthissitua9onthedefini9onstoredinORDS_METADATA“wins”overthe
defini9onstoredinAPEX
▪  ThroughthemanagementinterfaceinAPEXyous9llmanagethe“OLD”defini9on
► Thisistooconfusing,thus:
▪  Keepthedefini9onsseparate
▪  EithercreatenewoneswithSQLDevdirectlyors9llusingtheSQLWorkshopin
APEX
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 15
Installa9on
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 16
Installa9on
OverviewoftheInstalla9on
LayeredApproach,stepbystep
► Install/configurerepositoryandusersindatabase
► Configureconnec9onpoolforORDS
► Startinstandalonemode,thenTESTit
► DeployORDStoTomcat,thenTESTit
► ConfigureApacheh]pServerasaproxytoTomcat,thenTESTit
► SecurityandOp9miza9ons
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 17
Installa9on
Install/configurerepositoryandusersindatabase
► RegularinstallofAPEX5.0
▪  apex_ins.sql
► ConfigureapexRESTsupport
▪  apex_rest_config.sql
▪  UserAPEX_LISTENERand
APEX_REST_PUBLIC_USER
arecreated
apex_rest_config.sqlmust
alsobeexecutedaRertheupgrade
toAPEX5.0!!!Evenifitwas
installedinAPEX4.2.x!!!
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 18
Installa9on
ORDS3.0Download
►  DownloadORDS3.0
▪ 
▪ 
h]p://www.oracle.com/technetwork/developer-tools/rest-data-services/
downloads/index.html
ords.3.0.2.294.08.40.zip
Java JDK 1.7 is required
►  Installonthecommandlineusing
▪ 
▪ 
Test:javac-version
java–jarords.war<command>
Help:java–jarords.warhelp
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 19
Installa9on
ORDS3.0Background
►  ords.warisaJ2EEapplica9onwhichcanbe
▪ 
▪ 
deployedtoWeblogic,GlassfishorTomcat
“deployed”intoitselfandruninstandalonemodebecauseithasaJe]yJ2EE
containerembeddedintothe.warfile=>easyfortes9nganddevelopment
►  ORDSneedsconfigura9onfilesforconnec9onpoolsandstandalonemode
▪ 
Thecommandlineinstalla9onwillMODIFYtheords.warfileandregistera
referencetothedirectorycontainingtheconfigfiles
java-jarords.warconfigdirc:\app\ords_3.0
updates a reference to the config directory IN
the ords.war file
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 20
Installa9on
ORDS3.0Background
►  Configura9onFiles
▪ 
defaults.xml
−  AllCommonsevngsanddefaultsforallconnec9onpools
▪ 
ords/standalone/standalone.proper9es
−  Standalonemodeconfigura9onforJe]y(/i/loca9onandport#)
▪ 
▪ 
▪ 
▪ 
▪ 
conf/apex.xml(APEX_PUBLIC_USER)
conf/apex_al.xml(APEX_LISTENER)
conf/apex_rt.xml(APEX_REST_PUBLIC_USER)
conf/apex_pu.xml(ORDS_PUBLIC_USER)
role-mapping.xml
−  MapsWebserverRolesintoRESTfulRoles
▪ 
url-mapping.xml
−  Mul9pledatabaseconfigura9ons
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 21
Installa9on
ORDS3.0Background
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 22
Installa9on
ORDS3.0Background
►  Axertheinstalla9onwemustop9mizetheconnec9onpool
▪ 
▪ 
▪ 
apex.xml(APEX_PUBLIC_USER,mainconnec9onpool)
apex_al.xml(usedforservingsta9capplica9onandworkspacefiles)–notas
highastheothers
apex_rt.xml(usedforservingsta9capplica9onandworkspacefiles)
►  Asampleconfigura9on:
▪  jdbc.Ini9alLimit=15
−  #sessionscreatedintheconnec9onpoolatstartup
▪  jdbc.MaxLimit=50
−  max.numberofconcurrentsessionsallowed
▪  jdbc.Inac9vityTimeout=1800
−  Connec9onisnotusedfor1800seconds=>removedfrompool
▪  jdbc.MinLimit=15
−  Min.numberofconnec9onsinpool,evenifinac9vityTimeouthaspassed
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 23
Installa9on
ORDS3.0Background
► Op9miza9onisalwaysdifficult,monitoringthecurrentusage,thentrialand
error
► Simplemonitoring
SELECTusername,status,COUNT(*)cnt
FROMv$session
WHEREusernameLIKE'%APEX%'ORusernameLIKE'%ORDS%'
GROUPBYusername,status;
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 24
Installa9on
ORDS3.0Background
►  Ifanythinggoeswrongduringtheinstalla9on-youcanrepeattheprocess,
butyouhavetocleanuptheconfigfilesbeforehand
▪ 
▪ 
Allconfigfilesinc:\app\ords_3.0\conf(includingthesubdirectories)
ords_params.properties(theinstallerwillrememberourpreviousprompt
andnotaskagain)
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 25
Installa9on
InstallORDS3.0
►  CreateadirectorytoholdtheORDSconfigura9on,i.e.thedefini9onofthe
differentconnec9onpools
▪ 
mkdirc:\app\ords_3.0\conf
►  Extracttheinstalla9onscripts
▪ 
java-jarords.warords-scripts
►  Runtheinstalla9onscriptstoinstalltheORDSrepository
▪ 
sqlplus"sysassysdba"@ords_manual_installSYSAUXTEMP
"c:\app\ords_3.0\log\“
►  Configuretheconnec9onpool
▪ 
▪ 
▪ 
▪ 
java-jarords.warsetupadvanced
Entertheloca9ontostoreconfigura9ondata:c:\app\ords_3.0\conf
ConfiguretheAPEXGateway
ConfiguretheAPEX_LISTENERandAPEX_REST_PUBLIC_USERAccounts
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 26
Installa9on
InstallORDS3.0
►  Startinstandalonemode
▪ 
▪ 
▪ 
java-jarords.warstandalone
Sta9cimagefilesforstandalonemode:c:\app\apex_5.0.1\apex\images
H]pPort:8090
►  Test:http://localhost:8090/
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 27
Installa9on
InstallORDS3.0
►  Op9mizetheconnec9onpool
▪ 
▪ 
▪ 
apex.xml
apex_al.xml
apex_rt.xml
► Sevngs:
▪  jdbc.Ini9alLimit=15
▪  jdbc.MaxLimit=50
▪  jdbc.MinLimit=15
► Restartords.warstandaloneandtesttheconfigura9onagain(verifysyntaxin
configfile):h]p://localhost:8090/
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 28
Installa9on
InstallTomcat8
►  DownloadApacheTomcat8forWindows32bit–Serviceinstaller
▪ 
▪ 
h]p://tomcat.apache.org/download-80.cgi
apache-tomcat-8.0.23.exe
►  InstallApacheTomcat8asaservice
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 29
Installa9on
InstallTomcat8
►  Choosethedefaults
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 30
Installa9on
InstallTomcat8
►  Leavethedefaultsandprovideauserfortheadministra9onviatheweb
managerapplica9on
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 31
Installa9on
InstallTomcat8
►  ChooseaJRE,atleastJava7isrequired
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 32
Installa9on
InstallTomcat8
►  Tothedes9na9onfolderwewillrefertoasTOMCAT_HOME
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 33
Installa9on
InstallTomcat8
►  Theserviceisini9allycreatedtobestartedmanually:
▪ 
Thishastobechangedtohaveitstartautoma9callyatsystemstartup
►  Testtheinstalla9onusingh]p://localhost:8080/
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 34
Installa9on
DeploytheAPEXimages(/i/)toTomcat8
►  DeploytheAPEXImagestoTomcat
▪ 
▪ 
Copyapex\images=>TOMCAT_HOME\webapps\ROOT
Thenrenamethefolderimagestoi
►  Testthefileloca9onusingh]p://localhost:8080/i/apex_version.txt
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 35
Installa9on
Deployords.wartoTomcat8
►  Deployords.wartoTomcat
▪ 
▪ 
Copyords.war=>TOMCAT_HOME\webapps
Theords.warwillbeautoma9callydeployedandthedirectory
ordsiscreated
►  Testthesetupusingh]p://localhost:8080/ords/apex_login
► Now:Viablesetup:
▪  Servicestartsupautoma9cally
▪  Connec9onpoolop9mized
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 36
Installa9on
Apache2.4
► Apacheh]pserver(h]p://h]pd.apache.org)
▪  EasiertosetuponLinux/UnixthanonWindows,typicallypartoftheLinux
distribu9ons
▪  Somesyntaxchangesin2.4:
−  h]p://h]pd.apache.org/docs/trunk/upgrading.html
−  h]ps://www.digitalocean.com/community/tutorials/migra9ng-yourapache-configura9on-from-2-2-to-2-4-syntax
▪  Typicallysupportsh]psviassloutofthebox,comeswithselfsignedcer9ficates
includedfortes9ng/developmentpurposes
−  Forproduc9onsitesyoushouldasignedcer9ficate
−  Finefordevelopmentandtes9ngenvironments
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 37
Installa9on
InstallApache2.4
► DownloadApacheh]pServer2.4
▪ 
▪ 
h]p://h]pd.apache.org/docs/current/pla~orm/windows.html#down
h]p://www.apachehaus.com/cgi-bin/download.plx
►  AlsodownloadtheMSWindowslibraries(DLL)
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 38
Installa9on
InstallApache2.4
► InstalltheMicrosoxVisualC++2012Redistributable
▪  vcredist_x86.exe
► UnziptheApachefolderandcopyittoc:\Apache24
=>DEFAULTApacheinstallaMoncompleted!
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 39
Installa9on
ConfigureApache2.4
►  Whatisvirtualhos9ng?
▪ 
▪ 
Apachesupportsmu9pledifferentconfigura9onsdependingonthenameand/
orportwetalktotheApache,basicallyrunningmul9plewebsitesonthesame
machine
E.g.attheGermanTelecomusedvirtualhostsfordifferentapplica9ons
(mul9pleDNSentriesforthesameipaddress):
−  h]p://abit.telekom.de
−  h]p://spots.telekom.de
▪ 
▪ 
Everycombina9onSERVER-NAME:PORTcanpossiblybeadifferentvirtualhost
ThesetupforSSL/h]psisalsoavirtualhost
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 40
Installa9on
ConfigureApache2.4
►  CreateanewconfigfileforourAPEXsetup
▪ 
copyconfigfileapex.conftoc:\Apache24\conf\apex.conf
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 41
Installa9on
ConfigureApache2.4
►  Includethisconfigura9oninallRELEVANTvirtualhosts
▪ 
APACHE_HOME\conf\extra\h]pd-vhosts.conf
►  APACHE_HOME\conf\extra\
h]pd-ahssl.conf
(specifictothisdistribu9on)
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 42
Installa9on
ConfigureApache2.4
►  Mul9pleincludesoftheapex.confwillresultinthefollowingwarning
▪ 
[WedNov1808:59:30.2344492015][so:warn][pid4984:9d216]AH01574:
modulefilter_moduleisalreadyloaded,skipping
►  Thewarningscanbeignored.
►  YoucanalsomovetheLoadModuledirec9vesintothehttpd.conffile
(theyarealllistedthereatthebeginningofthefile)
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 43
Installa9on
ConfigureApache2.4
►  StartApacheonthecommandline
▪ 
c:\Apache24\bin\h]pd.exe
►  InstallApacheasaservice
▪ 
c:\Apache24\bin\h]pd-kinstall
►  StartApacheService
▪ 
netstart"Apache2.4"
►  StopApacheService
▪ 
netstop"Apache2.4”
►  TestApacheh]pServer:h]p://localhost/andh]ps://localhost/
►  Reloadtheserverconfigura9on(justgraceful,nosessionislost)
▪ 
c:\Apache24\bin\h]pd.exe-krestart
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 44
Installa9on
ConfigureApache2.4
►  LimitAccesstoTomcattoApacheviaAJPprotocolonly
►  BindTomcattolocalhostONLY,sothatonlyApacheh]pdserverisallowed
totalktoit
►  ModifyTOMCAT_HOME\conf\server.xml:
<Connectorport="8080"protocol="HTTP/1.1"
connec9onTimeout="20000"
address="127.0.0.1"
redirectPort="8443"/>
...
<!--DefineanAJP1.3Connectoronport8009-->
<Connectorport="8009"protocol="AJP/1.3"redirectPort="8443"
address="127.0.0.1"/>
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 45
Installa9on
ConfigureApache2.4
►  Verifythatcachingworks
▪ 
▪ 
▪ 
▪ 
Don’thitreload=>clickintheapplica9onorclickinaddressbarandhitenter
ProblememitGoogleChromemitlokalerTest-Instanz=>Nichtrepresenta9v!
Firefox=>built-indevelopertools
ThefilesareonlyrequestedONCEfor8hrs
►  Verifythatcompressionworks
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 46
Opera9onalUseCases
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 47
Opera9onalUseCases
Changeconnec9onpool
►  UC#1:PasswordforAPEX_PUBLIC_USERneedstobechanged
java–jarords.warsetupadvanced
▪ 
PromptsforalldatabasesetupparametersagainandUPDATESallconfigfiles,
doesn’tcreatethemfromscratch
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 48
Opera9onalUseCases
Changeconnec9onpool
▪ 
Axerthechangeweneedtoreloadthenewconfigura9oninyourTomcatby
either:
1.  RestarttheTomcatservice
2.  “touch”thewebapps\ords.warfile
− 
Updatethe9mestamp,Tomcatwillautoma9callyredeploy
3.  usetheTomcatmanagementinterfacetoreload
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 49
Opera9onalUseCases
Changeconnec9onpool
►  UC#2:Databasewasmovedtoadifferentmachine
▪ 
Modifytheconfigfiledefaults.xmldirectlyandchangetheJDBCconnect
informa9on
<entrykey="db.hostname">localhost</entry>
<entrykey="db.port">1521</entry>
<entrykey="db.sid">xe</entry>
▪ 
Reloadthenewconfigura9oninyourTomcatasdescribedinUC#1
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 50
Opera9onalUseCases
Changeconnec9onpool
►  UC#3:Debug-MeldungenBrowseranzeigen
▪ 
Modifytheconfigfiledefaults.xml
<entrykey="debug.debugger">true</entry>
<entrykey="debug.printDebugToScreen">true</entry>
▪ 
Reloadthenewconfigura9oninyourTomcatasdescribedinUC#1
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 51
Monitoring
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 52
Monitoring
Errors/Logfiles
►  Apacheh]pserver
▪ 
APACHE_HOME\logs
−  error_log(errors)
−  access_log(whoaccessedwhichfileandwhatwastheresult(h]preturn
code(e.g.404notfoundor200ok)andthesize
►  Tomcat
▪ 
TOMCAT_HOME\logs
−  catalina.log(includesmessagesfromTomcatitselfbutalsoallJ2EE
applica9ons,i.e.ORDS):
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 53
Monitoring
Errors/Logfiles
►  Je]ydoesn’tsupportAJP
▪ 
Theproxydirec9vesintheapex.confwon’tworkwithJe]yinstandalonemode,
Je]ydoesn’tsupportAJP
►  AccountAPEX_REST_PUBLIC_USERlocked=>Downloadofsta9cimages
don’twork
▪ 
▪ 
▪ 
LookintotheTOMCAT_HOME\logs\catalina.logfile,thereyouwillseeerrors
like:
22-Jun-201510:33:19.359SEVERE[ajp-nio-8009-exec-13]
oracle.dbtools.common.config.db.DatabasePools.isValidThepoolnamed:
apex_rtisnotcorrectlyconfigured,error:ORA-28000:theaccountislocked
Allconfiguredconnec9onpoolsarealsovalidatedatstartupwhenrunningthe
je]yinstandalonemode=>youwillseeitonthecommandline,too
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 54
Monitoring
Errors/Logfiles
►  Problemdisplayingsta9cimagesinAPEX5.0forworkspacescreatedpre4.1
▪ 
Solu9on:Upgradetoapex5.0.2orinstallpatch
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 55
Monitoring
Errors/Logfiles
►  InAPEXwecanseeallerrorsduetounhandledexcep9ons:
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 56
Monitoring
Performance
►  APEXMonitoringusingtheAPEXDic9onaryViews
SELECTapplication_id,
page_id,
COUNT(*)AShits,
COUNT(*)/60AShits_pro_min,
MIN(elapsed_time)ASMIN,
AVG(elapsed_time)ASAVG,
MAX(elapsed_time)ASMAX,
AVG(elapsed_time)*COUNT(*)weight
FROMapex_workspace_activity_log
WHEREview_date>SYSDATE-1/24/60*60/*1hour*/
GROUPBYapplication_id,page_id
ORDERBYAVG(elapsed_time)*COUNT(*)/*weight*/desc
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 57
Monitoring
Performance
►  Usebrowsertoolstounderstandperformanceissues
▪ 
▪ 
Allcurrentbrowsershaveintegrateddevelopertools
Buttherealsoadd-onslikeFirebug
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 58
AdvancedConfigura9ons
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 59
AdvancedConfigura9ons
SSOwithMSWindows
SSOwithWindows
TherearedifferentwaystouseSSOinourAPEXapplica9ons.Weshouldn’tuse
NTLManymoresincethisisareallyoldprotocolandnotconsideredsecureany
more.
►  Apache+mod_auth_kerb
▪ 
▪ 
Kerberosauthen9ca9onwiththeWindowsAc9veDirectory
h]p://www.apexsolu9ons.de/blog/allgemein/single-sign-on-for-apexapplica9ons-using-kerberos/
►  SSOwithInternetInforma9onServer(IIS)
▪ 
Herewealsodothena9velyintegratedNTLMorKerberosauthen9ca9onwhich
isbuiltintotheIIS.Thenweusemod_ajptoproxytherequeststotheApache
TomcatandORDS.
►  Tomcat8+Kerberos/SPNEGOauthen9cator
▪ 
h]ps://community.oracle.com/message/12748733
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 60
AdvancedConfigura9ons
REST-styleURLs
►  REST-styleURLsforaccessingyourapplica9on,e.g.
▪ 
▪ 
▪ 
/home
/customer
/customer/edit/<id>
►  h]p://www.oracle-and-apex.com/human-readable-urls-in-oracle-apexpart-2/
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 61
h]p://9nyurl.com/modernappdev12c
abdem19.01.2016gehteslos!
6
2
6
3
Q&A
DietmarAust
Opal-Consul9ng,Köln
www.opal-consul9ng.de
daust.blogspot.com
[email protected]
Setting Up the Oracle APEX Listener (Now ORDS) for Production
Environments
23.06.2015
Page 64
Herunterladen