Diatone

Well-Known Member
Aug 22, 2001
111
0
316
Hello.

I am just wondering something. I parked a domain called curbdiver.net ontop of curbdiver.com in WHM. I also installed JSP servlets on curbdiver.com. But when you go to www.curbdiver.com it displays fine, but www.curbdiver.net, and the IP for the site, gives tomcat 404 errors. Can anyone help PLEASE? Thanks!
 

Diatone

Well-Known Member
Aug 22, 2001
111
0
316
Ok... I've figured it out myself finally. Took a bit. But I got it. Anyone that may be reading this thread, and want to know how I did this, well, listen up..

Ok. It's pretty simple. All you need to do is navigate to the directory below (may be different if you have a different version of tomcat installed)
/usr/local/jakarta/jakarta-tomcat-4.0.3-src/build/conf

Once there, open up your server.xml file, and get ready to edit some lines.. They are near the bottom of the file. They look like
&Host name=&www.curbdiver.com&&
&Context path=&& reloadable=&true& docBase=&/home/curbdive/public_html& debug=&1&/&
&/Host&

Well, I needed it to work with curbdiver.net and www.curbdiver.net - so I added the following:

&Host name=&curbdiver.net&&
&Context path=&& reloadable=&true& docBase=&/home/curbdive/public_html& debug=&1&/&
&/Host&
&Host name=&www.curbdiver.net&&
&Context path=&& reloadable=&true& docBase=&/home/curbdive/public_html& debug=&1&/&
&/Host&

Restart tomcat, restart httpd - ta da. Your parked domains now work. May be a bug in whm/cpanel when a domain is parked, it isnt added to the tomcat server.xml file. I'm going to post the info to that board also..

Hope this helps someone down the road..
 

jsteel

Well-Known Member
Jul 4, 2002
646
0
166
Atlanta, GA
This is the way it is supposed to work. Tomcat instantiates by host name. Each entry in the file utilizes additional RAM/resources. If you add entries such as below:

abc.com
www.abc.com
abc.net
www.abc.net

...you are actually loading four distinct 'instances' of Tomcat, just as if those were 4 different customers. I personally feel this is too much of a resource strain, so I only set up Tomcat to support the primary 'www.domain.com' entry only and tell my customers this.

I urge them to create a variable and define the absolute URL to the servlet using the primary domain (or hardcode it on .html pages). Assuming you support the same number of distinct customers in either scenario, the latter will increase the performance of your server.

Jaz
 

uh2

Member
Jan 22, 2004
10
0
151
edit server.xml.in just before the where the marker for the dynamic host list
 

FeeL

Well-Known Member
Apr 17, 2004
135
2
168
Rio de janeiro
cPanel Access Level
Reseller Owner
just fine

I saw this problem, but was not sure where to solve it...

thank you!

Can this be a "minor whm / cpanel bug"?

I think the Cpanel staff should think on a way to solve it!

This is not so hard to do...
 

appservermgr

Member
Feb 16, 2007
20
0
151
Actually using the Alias tag allows you to have multiple domains mapped to the
same instance of the java application like so:

<Host name="mydomain.com" appBase="/home/cpaneluser/appservers/apache-tomcat-5.5x/webapps"
unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<Alias>www.mydomain.com</Alias>
<Alias>members.mydomain.com</Alias>
<Context path="" docBase="/home/cpaneluser/appservers/apache-tomcat-5.5x/webapps/myapp">
</Context>
</Host>

<!--
Tags below used as a reference to illustrate the location to insert the
above entry.
-->
</Engine>
</Service>
</Server>