You may have developed a web application using JSF or other techniques, wich runs on an application server and should be reachable from the internet. You might configure your AppServer, e.g. GlassFish, listening on port 80 directly. Usually it is better to run this behind a HTTP server, which serves static content or provides load balancing. The folowing configuration is an example how to run GlassFish behind an Apach WebServer.
Its using this scenario:
- The application runs on localhost:8080/myapp
- The site is reachable on http://mydomain.net
- The site is hosted on a virtual server
- The complete site is forwared to the AppServer
- The modules mod_proxy.so and mod_proxy_http.so are loaded
<VirtualHost *:80> ServerName mydomain.net ServerAlias www.mydomain.net ServerAdmin webmaster@mydomain.net DocumentRoot /var/htdocs/mydomain/ <Directory /var/htdocs/mydomain/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /myapp http://localhost:8080/myapp/ ProxyPassReverse /myapp http://localhost:8080/myapp/ </VirtualHost>
Essential is the config of ProxyPass(Reverse), which forwards the directory (“/myapp”) to the adress of your AppServer (“http://localhost:8080/myapp/”). Please treat this only as an example. For security reasons you may run Apache within your dmz and GlassFish on a different machine behind your firewall.
Maybe I provide a full commented description later on in an future article of my JSF tutorial.
To web development content.
Do you want to support this blog? You may help to finance the needed hardware.
Want to read more about software development? Purchase one of my books:
Start application development with Java. Learn development foundation, quality control and more.
A Journey through Java EE Technologies whilst developing Web Applications with JavaServer Faces.
Java Lambdas and Parallel Streams
The compact starter: Foundation, supporting structures, parallel processing
No software development, just nature:
A photographic image book. Get it for free. Or pay whatever you like.
No Comments Yet