Deploying just HTML, CSS webpage to Tomcat

后端 未结 4 1001
醉梦人生
醉梦人生 2020-11-28 02:02

I am just getting started on developing a website. All I have at the moment is a HTML page supported by a couple of CSS stylesheets

4条回答
  •  春和景丽
    2020-11-28 03:01

    Here's my setup: I am on Ubuntu 9.10.

    Now, Here's what I did.

    1. Create a folder named "tomcat6-myapp" in /usr/share.
    2. Create a folder "myapp" under /usr/share/tomcat6-myapp.
    3. Copy the HTML file (that I need to deploy) to /usr/share/tomcat6-myapp/myapp. It must be named index.html.
    4. Go to /etc/tomcat6/Catalina/localhost.
    5. Create an xml file "myapp.xml" (i guess it must have the same name as the name of the folder in step 2) inside /etc/tomcat6/Catalina/localhost with the following contents.

      < Context path="/myapp" docBase="/usr/share/tomcat6-myapp/myapp" />
      
    6. This xml is called the 'Deployment Descriptor' which Tomcat reads and automatically deploys your app named "myapp".

    7. Now go to http://localhost:8080/myapp in your browser - the index.html gets picked up by tomcat and is shown.

    I hope this helps!

提交回复
热议问题