Building Responsive Applications with Uniface: Deployment, part 3 or a 3 part series. In this presentation you will learn:
• Web Deployment Architecture
• Considerations
• Tomcat Servlet Engine Configuration
• Uniface Server Configuration
• Deployment Demo (View on our YouTube channel)
Webinar recording on: www.youtube.com/unifacesme
5. Web Application Resources
Static Content
• CSS, Images, Fonts, JavaScript etc.
• Served from Web Server or Java Servlet Engine
(e.g. Tomcat)
Dynamic Page Content (Uniface)
• Requests forwarded by Servlet Engine via Web Request
Dispatcher (WRD) using middleware interface
• URouter: orchestrate Uniface uservers
• UServer: generate pages & process updates
6. Uniface Web Application Environment
Server
Uniface Server
Runtime Engine
Client
* Web Server
* Java Servlet Engine
WRD
UserBrowser
http
Uniface Router
Network Connector
Network Connector Network
Connector
Database
Connector
Uniface Runtime
Objects
* optional, e.g. IIS or Apache
ajp
* Tomcat can function as web server
7. Universal Resource Locators (URL’s)
Identify app/environment
http://server/prod/wrd/main
http://server/app1/test/main
Map to urouter configuration via web servlet config
Context Servlet ComponentProtocol Server:port
8. Uniface Web Application Configuration
Uniface Web Application Server
1. Web Browser
2. Tomcat
3. WRD
Network
4. Uniface Router
5. Uniface Server
Call my_server_page to get an HTTP Response
http.//server.machine.8080/
6
HTTP Request
uniface/ /my_server_page
urouter.asn
Context*
UV8.urouter.server-machine+13001 user-name [password] wasv
Network
WEB-INFweb.xml
wrd/
*Context = Tomcat Virtual Directory
typically defined via named xml file in confCatalinalocalhost
pointing to physical folder containing WEB-INFweb.xml
10. Preparation
Plan
• Deployment, Resources, Hardening etc.
Resources
• Product Availability Matrix on http://unifaceinfo.com
• Local Administrator privilege for installations
• License
• Optional: Web Server Certificate for https:// connections
Installation Media for target architecture
• Uniface + patches (https://download.uniface.com), DBMS drivers (match 32 or 64 bit)
• Optional: Java (for Tomcat), Tomcat, IIS + ISAPI Extensions and filters for Tomcat Connector,
ODBC drivers
Application Build
• Configuration Files, Uniface Runtime Resources, Static Resources
11. License
Features Licensed per server core (not concurrent)
• Web Features: USRVUSP, USRVSVC
• + Database features etc.
Use Distributed License Manage (DLM) to:
• Identify host for license request
• Add License
• Emergency License: https://download.uniface.com/downloads
Can specify license file in .asn
• $LICENSE_OPTIONS=LM_LICENSE_FILE="C:DLMlicense.xml"
;7188@DLMserver, LM_NOTIFICATION=0, LM_TRANSCRIPT=15
12. Security
SSL (needs certificate)
Customize Error Messages – See Help:
• “Web Application Error Pages”
• “Customize WRD Error Messages
Hardening
• See help “Configuring the Tomcat Security Manager”
• Also check online references for Tomcat
• Remove manager application
• Various server.xml, web.xml & context.xml configuration changes
• Service Account & file permissions
Firewall
14. Redirection from another Web Server
Serve static content from, e.g., IIS or Apache
Redirect dynamic content, e.g. /wrd/* to Servlet Engine
(e.g. Tomcat) using AJP binary protocol
Web Server Redirection
• IIS: Typically, Apache JK Redirector or BonCode Tomcat Redirector
for AJP connections, or ARR if you want to modify headers
• Apache: modules (mod_jk or mod_proxy_ajp)
• Some connectors (e.g. Apache JK redirector) can load balance
21. Uniface Common resources
e.g. unifacewebappsunifacecommonuniface.js
Web folder: ../common
Copy or override in wasv.asn:
[SETTINGS]
$UNIFACE_RUNTIME_BASE_URL=/uniface/common
or create Tomcat Context (virtual dir):
CommontomcatconfCatalinalocalhost
webstart#common.xml
23. Urouter.asn - Settings
[SETTINGS]
$putmess_logfile = D:ProjectsUniface10.2Defaultlogurouter%p.log
$priv_mon_user = urouter
$default_net = TCP:localhost+13001|||
Explicit Hostname may be needed to bind to correct IP
address (e.g. NAT used in Virtual Machine)
25. Urouter.asn – server switch notes
/max
• Description: maximum number of instances of a shared Uniface Server that the Uniface Router
can start
• Advice: Size to avoid resource problems (memory page swapping etc.)
/maxidle
• Description: maximum idle period for a shared Uniface Server before close
• Advice: Typically use to reduce server resource usage if /max not set or big spikes expected
/maxreq
• Description: maximum number of requests a shared Uniface server can execute
• Advice: Typically use if you have a memory leak or are short of memory
Other considerations
• Consider debugger port re-use
• See Help for other switches
26. wasv.asn (selected settings)
[SETTINGS]
;$TEST_MODE_COMPONENTS ; Don’t force reload
;$RESOURCES_OUTPUT webstart.uar ; Not needed for deployment
[WEB]
$SERVER_SECRET=xxxxxxxxxxxxxxxxxxxxxxx ; used to hash protect NED fields
$UNIFACE_RUNTIME_BASE_URL=../common ; default
$JS_BASE_URL=../common/dspjs ; default
[RESOURCES]
; Specifies folders or UAR files
; Can patch with additional resources (newest first)
webstart.uar
27. Troubleshooting
Browser Debugger Network Tab – do resources load?
Tomcat
• Can you load static resources?
• Check middleware connection in WEB-INFweb.xml (ports, credentials, UST)
Urouter/Userver
• Matching UST in urouter.asn
• Hostname in urouter.asn $DEFAULT_NET
• Log files
• Paths & File Permissions for userver user
• Monitor
License
29. Suggested Further Investigation
Standardized Deployment (resources & urm)
• See previous deployment lectures
urouter monitor
• Gracefully reload application, e.g. after patch deployment
Tomcat
• Manager application
• WAR file deployment
- see “Creating and Deploying a Web Application WAR File” help topic
• Configuration, inc. Security and Performance optimization