Results 1 to 3 of 3

Thread: Deployment Problem: What's the document root?

  1. #1
    Join Date
    Oct 2011
    Posts
    17

    Default Deployment Problem: What's the document root?

    I've built my first Spring Roo web project. I got it all WAR'ed up and put up on my staging server, and after some wrestling with it, Tomcat deploys it without issue.

    Now I can't get Apache configured to actually go to it.

    Apache's DocumentRoot setting won't work unless the file is all unpacked. So I've put up an exploded-out tarball of my application in webapps/ rather than a .war file as I'd prefer.

    Even then, I don't know what to point DocumentRoot at to launch my app. None of the URLs that work on the local vFabric server seem to translate properly to Apache/Tomcat. I don't HAVE an index.jsp here, I'm using Tiles as configured by Roo... Everything I try gets me a 404.

  2. #2
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default

    What is your root view? Isn't it "index.jspx" inside the view folder?
    Have you set a context.xml file in your META-INF in order to have your app respond to "sitename.com" ie the root context "/"? It mentions "This makes deployment easier, particularly if you're distributing a WAR file. "

    This is suggested in approach #1 of the Tomcat 6 documentation. What version of Tomcat are you using? I can recommend the tomcat-users list for specific tomcat issues.

  3. #3
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default

    So what I did was set up my Tomcat servers virtual host with the file: .../apache-tomcat-6.0.33/conf/Catalina/[sitename]/ROOT.xml:
    Code:
    <?xml version='1.0' encoding='utf-8'?>
    <Context displayName="[sitename]/" path="ROOT" workDir="work/Catalina/[sitename]/_" appBase="home/websites/[sitename]/webapps">
    </Context>
    where [sitename] is the domain name sans "www". I have also set up hosts in server.xml and used the same name there to set an Alias for "www.[sitename]".
    And finally in my webapp/META-INF directory in my project I have context.xml:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <Context displayName="[sitename]" path="">
    </Context>

    After I have packaged my app as a war I renamed it ROOT.war and put inside the appbase directory where Tomcat picks it up.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •