2. Setup Apache to use mod_proxy (AJP)
Make sure that at least following modules are loaded (uncomment this in httpd.conf)
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
Add those lines in /etc/httpd/conf/httpd.conf :3. The yourapp application will be deployed in tomcat, and make sure the tomcat 8009 connector is opened.
<Proxy balancer://mycluster>
Order deny,allow </Proxy>
Allow from all
BalancerMember ajp://localhost:8009/yourapp
</VirtualHost> <VirtualHost *:80>
ServerAdmin admin@yourhost.com
ServerName www.yourhost.com
ServerAlias yourhost.com
ProxyPass /yourapp balancer://mycluster
ProxyPassReverse /yourapp balancer://mycluster/
ErrorLog logs/yourhost_error_log
CustomLog logs/yourhost_access_log combined
4. In a browser, type: http://www.yourhost.com/yourapp, it will go to yourapp that deployed in the tomcat, you don't need to type the port number.
Reference: usintMod_ProxyWithJBoss
No comments:
Post a Comment