RE: Virtual Hosting with WAR files
Thanks to all. This setup has been tested on Apache2+JBoss+mod_jk-1.2.14_for MacOSX. And am sure it will work on other platforms as well. This setup also handles Apache related webapps.. Make the required entries in the DNS webapp.war: Extract the war file using zip and rename the folder with .war extension. Please put it in your deployment folder. mod-jk.so: Obtain the modjk.so library file from www.apache.org and place then in the modules folder. Apache-Virtual Host config -- NameVirtualHost *.*.*.*:80 VirtualHost *.*.*.*:80 ServerName webapp.robosoft.co.in ServerAlias www.webapp.robosoft.co.in ServerAdmin [EMAIL PROTECTED] DocumentRoot /Volumes/Extra/jboss/server/default/deploy/webapp.war JkMount /* loadbalancer DirectoryIndex index.html index.jsp ErrorLog logs/webapp-error_log CustomLog logs/webapp-access_log common /VirtualHost - mod-jk.conf LoadModule jk_module /opt/apache2/modules/mod_jk.so JkWorkersFile /opt/apache2/conf/workers.properties JkLogFile /opt/apache2/logs/mod_jk.log JkLogLevel info JkLogStampFormat [%a %b %d %H:%M:%S %Y] JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkRequestLogFormat %w %V %T JkMount /webapp.domain.com/*.jsp loadbalancer JkMountFile /opt/apache2/conf/uriworkermap.properties JkShmFile /opt/apache2/logs/jk.shm Location /jkstatus/ JkMount status Allow from all /Location -- Server.xml - Host name=webapp.domain.com debug=0 appBase=deploy unpackWARs=true Aliaswww.webapp.domain.com/Alias Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=webapp_log1. suffix=.log timestamp=true/ Context path= docBase=${jboss.server.home.dir}/deploy/webapp.war debug=0 reloadable=true/ /Host -- -- uriworkermap.properties /jmx-console=loadbalancer /jmx-console/*=loadbalancer /web-console=loadbalancer /web-console/*=loadbalancer /webapp.domain.com/*.jsp -- -- workers.properties worker.list=loadbalancer,status worker.webapp.port=8009 worker.webapp.host=webapp.domain.com worker.webapp.type=ajp13 worker.webapp.lbfactor=1 worker.webapp.cachesize=10 worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=library worker.loadbalancer.sticky_session=1 worker.loadbalancer.local_worker_only=1 worker.list=loadbalancer worker.status.type=status Regards Thanks Mahesh S Kudva Network Analyst Robosoft Technologies --- Robosoft Technologies - Partners in Product Development - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Virtual Hosting with WAR files
in $CATALINA_BASE/conf/server.xml merge these settings: Engine name=Catalina defaultHost=localhost Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Aliasfoo.com/Alias /Host Host name=file1.foo.com appBase=/opt/file1.foo.com/tomcat/webapps workDir=/opt/file1.foo.com/tomcat/work unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false !-- Rename your file1.war to /opt/file1.foo.com/tomcat/webapps/ROOT.war and ensure it does not contain any META-INF/context.xml file -- /Host Host name=file2.foo.com appBase=/opt/file2.foo.com/tomcat/webapps workDir=/opt/file2.foo.com/tomcat/work unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false !-- Rename your file2.war to /opt/file2.foo.com/tomcat/webapps/ROOT.war and ensure it does not contain any META-INF/context.xml file -- /Host Host name=file3.foo.com appBase=/opt/file3.foo.com/tomcat/webapps workDir=/opt/file3.foo.com/tomcat/work unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false !-- Rename your file3.war to /opt/file3.foo.com/tomcat/webapps/ROOT.war and ensure it does not contain any META-INF/context.xml file -- /Host /Engine Ensure the 3 sets of webapps and work directories are writable by the userid your JVM is running as. Mahesh S Kudva wrote: I have setup Tomcat+Apache2+mod_jk. I have 3 application in war files namely flie1.war, file2.war and file3.war. To deploy, I just put them in the deploy folder and access then using the urls: http://foo.com/file1 http://foo.com/file2 http://foo.com/file3 This works perfectly for me. I want to change this to simple urls as follows: http://file1.foo.com http://file2.foo.com http://file3.foo.com I have also read the notes on Virtual hosting: http://jakarta.apache.org/tomcat/connectors-doc- archive/jk2/jk2/vhosthowto.html Even though I am not able to configure Tomcat to connect to the war files as requested. How do I configure tomcat to connect to the correct war file as requested? Any help will be appreciated. -- Darryl L. Miles - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Virtual Hosting with WAR files
Try reading this, http://www.ex-parrot.com/~pete/tomcat-vhost.html It's a receipe for setting up tomcat to do virtual hosting and behave more like apache with regard to virtual hosts. Yours, Pete Stevens On Tue, 16 Aug 2005, Mahesh S Kudva wrote: Hi I have setup Tomcat+Apache2+mod_jk. I have 3 application in war files namely flie1.war, file2.war and file3.war. To deploy, I just put them in the deploy folder and access then using the urls: http://foo.com/file1 http://foo.com/file2 http://foo.com/file3 This works perfectly for me. I want to change this to simple urls as follows: http://file1.foo.com http://file2.foo.com http://file3.foo.com I have also read the notes on Virtual hosting: http://jakarta.apache.org/tomcat/connectors-doc- archive/jk2/jk2/vhosthowto.html Even though I am not able to configure Tomcat to connect to the war files as requested. How do I configure tomcat to connect to the correct war file as requested? Any help will be appreciated. Regards Thanks Mahesh S Kudva --- Robosoft Technologies - Partners in Product Development - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Pete Stevens [EMAIL PROTECTED] http://www.ex-parrot.com/~pete/ I'm a shareware signature! Send $2 if you use me, $10 for a manual. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Virtual Hosting with WAR files
If I understand this setup correctly, you would be running one instance of Tomcat for all of your virtual hosts. This has the disadvantage that if one virtual host needs to be restarted, you will need to restart Tomcat for all of your virtual hosts. An alternative is to let Apache handle the virtual hosts and run multiple instances of Tomcat -- one instance per virtual host. This requires multiple mod_jk instances, each communicating across a unique port with an instance of Tomcat. Each Tomcat should be deployed to its own home dir w/ its own CATALINA_HOME pointing to that directory and with each Tomcat given its own start/stop.sh script that sets CATALINA_HOME. This is more complex to set up, and I'm not sure how many separate Tomcats this can handle, but it does allow you to have something like: http://customer_1.com http://customer_2.com ... http://customer_n.com and fix customer_n's problem without impacting other customers using the same box. Since I maintain a box with this setup, I can post sample config files if there is interest. Pete Stevens wrote: Try reading this, http://www.ex-parrot.com/~pete/tomcat-vhost.html It's a receipe for setting up tomcat to do virtual hosting and behave more like apache with regard to virtual hosts. Yours, Pete Stevens On Tue, 16 Aug 2005, Mahesh S Kudva wrote: Hi I have setup Tomcat+Apache2+mod_jk. I have 3 application in war files namely flie1.war, file2.war and file3.war. To deploy, I just put them in the deploy folder and access then using the urls: http://foo.com/file1 http://foo.com/file2 http://foo.com/file3 This works perfectly for me. I want to change this to simple urls as follows: http://file1.foo.com http://file2.foo.com http://file3.foo.com I have also read the notes on Virtual hosting: http://jakarta.apache.org/tomcat/connectors-doc- archive/jk2/jk2/vhosthowto.html Even though I am not able to configure Tomcat to connect to the war files as requested. How do I configure tomcat to connect to the correct war file as requested? Any help will be appreciated. Regards Thanks Mahesh S Kudva --- Robosoft Technologies - Partners in Product Development - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Pete Stevens [EMAIL PROTECTED] http://www.ex-parrot.com/~pete/ I'm a shareware signature! Send $2 if you use me, $10 for a manual. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: Virtual Hosting with WAR files
Hi I am having the same problem. I tried to use Pete's recipe, but all I get is the default Tomcat page. I am setting up on win2003. Thanks Michael -Oprindelig meddelelse- Fra: Pete Stevens [mailto:[EMAIL PROTECTED] På vegne af Pete Stevens Sendt: 16. august 2005 17:07 Til: Tomcat Users List Emne: Re: Virtual Hosting with WAR files Try reading this, http://www.ex-parrot.com/~pete/tomcat-vhost.html It's a receipe for setting up tomcat to do virtual hosting and behave more like apache with regard to virtual hosts. Yours, Pete Stevens On Tue, 16 Aug 2005, Mahesh S Kudva wrote: Hi I have setup Tomcat+Apache2+mod_jk. I have 3 application in war files namely flie1.war, file2.war and file3.war. To deploy, I just put them in the deploy folder and access then using the urls: http://foo.com/file1 http://foo.com/file2 http://foo.com/file3 This works perfectly for me. I want to change this to simple urls as follows: http://file1.foo.com http://file2.foo.com http://file3.foo.com I have also read the notes on Virtual hosting: http://jakarta.apache.org/tomcat/connectors-doc- archive/jk2/jk2/vhosthowto.html Even though I am not able to configure Tomcat to connect to the war files as requested. How do I configure tomcat to connect to the correct war file as requested? Any help will be appreciated. Regards Thanks Mahesh S Kudva --- Robosoft Technologies - Partners in Product Development - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Pete Stevens [EMAIL PROTECTED] http://www.ex-parrot.com/~pete/ I'm a shareware signature! Send $2 if you use me, $10 for a manual. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Virtual Hosting with WAR files
Charles Meier wrote: If I understand this setup correctly, you would be running one instance of Tomcat for all of your virtual hosts. This has the disadvantage that if one virtual host needs to be restarted, you will need to restart Tomcat for all of your virtual hosts. An alternative is to let Apache handle the virtual hosts and run multiple instances of Tomcat -- one instance per virtual host. This requires multiple mod_jk instances, each communicating across a unique port with an instance of Tomcat. Each Tomcat should be deployed to its own home dir w/ its own CATALINA_HOME pointing to that directory and with each Tomcat given its own start/stop.sh script that sets CATALINA_HOME. This is more complex to set up, and I'm not sure how many separate Tomcats this can handle, but it does allow you to have something like: Maybe this is realistic in your hosting setup, but it would be absurd in mine. The fact you are concerned that VirtualHost changing on the fly is an issue suggests you might have a great many VirtualHosts in the first place and to give each one their own JVM would be absurd. As each JVM gets more and more use they will eat up system resources that it wont necessarly be given back to the system. Each Apache instance will end up with a AJP socket open to each TC it would multiply up the socket usage, memory usage. All so that you dont have to restart TC for VirtualHost changes. I would much sooner write the code in TC (if its not already been done) to allow Host level configuration changes to take place at runtime. -- Darryl L. Miles - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Virtual Hosting with WAR files
Hi I have setup Tomcat+Apache2+mod_jk. I have 3 application in war files namely flie1.war, file2.war and file3.war. To deploy, I just put them in the deploy folder and access then using the urls: http://foo.com/file1 http://foo.com/file2 http://foo.com/file3 This works perfectly for me. I want to change this to simple urls as follows: http://file1.foo.com http://file2.foo.com http://file3.foo.com I have also read the notes on Virtual hosting: http://jakarta.apache.org/tomcat/connectors-doc- archive/jk2/jk2/vhosthowto.html Even though I am not able to configure Tomcat to connect to the war files as requested. How do I configure tomcat to connect to the correct war file as requested? Any help will be appreciated. Regards Thanks Mahesh S Kudva --- Robosoft Technologies - Partners in Product Development - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]