Note that there are some explanatory texts on larger screens.

plurals
  1. POMass virtual hosts with tomcat
    text
    copied!<p>I'm using tomcat 5.5 for serving more that 100 sites(suppose my-gwt-site-1.com to my-gwt-site-100.com).<br/> All of my sites are using a single instance of a previously deployed gwt application, the only deference between them is in their "Host" configuration section in server.xml :</p> <pre><code>&lt;Host name="my-gwt-site-1.com" appBase="webapps"&gt; &lt;Context path="" reloadable="true" docBase="/my-gwt-app/" debug="1" unpackWARs="false" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false" crossContext="true"&gt; &lt;Resource name="jdbc/mysql/db_1" auth="Container" type="javax.sql.DataSource" initialSize="2" maxActive="50" maxIdle="5" maxWait="15000" removeAbandoned="true" removeAbandonedTimeout="2" validationQuery="select now();" username="root" password="pass" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/db_1" /&gt; &lt;/Context&gt; </code></pre> <p></p> <p>&amp; it repats fot all of my sites...</p> <pre><code>&lt;Host name="my-gwt-site-100.com" appBase="webapps"&gt; &lt;Context path="" reloadable="true" docBase="/my-gwt-app/" debug="1" unpackWARs="false" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false" crossContext="true"&gt; &lt;Resource name="jdbc/mysql/db_100" auth="Container" type="javax.sql.DataSource" initialSize="2" maxActive="50" maxIdle="5" maxWait="15000" removeAbandoned="true" removeAbandonedTimeout="2" validationQuery="select now();" username="root" password="pass" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/db_100" /&gt; &lt;/Context&gt; </code></pre> <p></p> <p>the only reason I do this is because my application needs to use the separate resource for every domain.<br/> when number "host" sections in server.xml is about 5, the is no problem, but when it grows up to about 10 or more, the tomcat server starts successfully but it cant load any of my site(seems that it crashes in the background silently!)<br/> I want to know is this a good solution to add a lot of "host" tags in server.xml or there is any better way to do this? Attention that I Just want to use one code with separate databases for all of my sites.<br/> Another question is that how many java sites(each one with about 500 users and low traffic) usually can be run on a single server(with 2 Quand Core CPUs &amp; 4GB of RAM)?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload