Pointing two subdomains to the same jsp application

zabousla

Member
Dec 15, 2010
6
0
51
Hello,

I need to point two subdomains to the same jsp application and I need as well to preserve the subdomains in the address bar of the browser.

Can you please give me help ?

Kind regards !
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
You could try to park one subdomain on the other subdomain. You can do this in cPanel > Subdomains area by simply changing the Document Root field to point both to the same folder.
 

zabousla

Member
Dec 15, 2010
6
0
51
Doing so gives me the /cgi-sys/defaultwebpage.cgi error page when I try to access the second subdomain which does not point to the directory of the application in tomcat.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Explain how it isn't pointing to the directory of the application in Tomcat? The /usr/local/jakarata/tomcat/conf/server.xml file should have both pointing to the same location if this was done properly when adding the subdomain in cPanel (to use the document root of the other subdomain).
 

zabousla

Member
Dec 15, 2010
6
0
51
Hello,

I don't see any reference to subdomains in server.xml except the reference to the main domain. I added an alias of the subdomain to the main domain <host> but it doesn't work.
I explain the situation :
The main domain points to a jsp application. I need to point a subdomain to the same application. I created the new subdomain which the document directory points to the public_html (document directory of the main domain). Than I added an alias in the files /usr/local/jakarta/tomcat/conf/server.xml and /home/user_name/jvm/apache-tomcat-6.0.14/conf/server.xml. Now it shows me the index.html in the public_html directory and not the jsp application.

Thanks
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
It appears you are using Tomcat 6.0.14 rather than the cPanel provided copy, correct? This is basically a custom configuration for Tomcat that has been created on the machine.
 

zabousla

Member
Dec 15, 2010
6
0
51
I deleted the tomcat 6 and I installed tomcat 5. Now I'm able to see all the entrees in the server.xml. I changed the appBase for the subdomain to point to the appBase of the main domain but unfortunatly it tries to return the cgi-sys/defaultwebpage.cgi page.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Is the subdomain in /usr/local/apache/conf/httpd.conf listed as part of the main domain's VirtualHost entry? Since both are pointing to the same document root, it should be parked on the main domain.

Also, if it is properly setup in httpd.conf file, try restarting Apache and then checking using a proxy in case you might be cached to the prior entry. You could use a proxy such as proxify.net or kproxy.com