The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Pointing two subdomains to the same jsp application

Discussion in 'General Discussion' started by zabousla, Aug 1, 2011.

  1. zabousla

    zabousla Member

    Joined:
    Dec 15, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    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 !
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    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.
     
  3. zabousla

    zabousla Member

    Joined:
    Dec 15, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    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).
     
  5. zabousla

    zabousla Member

    Joined:
    Dec 15, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    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.
     
  7. zabousla

    zabousla Member

    Joined:
    Dec 15, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    So how to make this possible with the custom tomcat configuration ?

    Thanks
     
  8. zabousla

    zabousla Member

    Joined:
    Dec 15, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  9. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    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
     
Loading...

Share This Page