只将HTML,CSS网页部署到Tomcat [英] Deploying just HTML, CSS webpage to Tomcat

查看:1128
本文介绍了只将HTML,CSS网页部署到Tomcat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始开发网站。目前我只有一个HTML页面支持一些 CSS样式表



我可以从HTML和CSS页面创建 WAR文件吗?我如何将它们部署到Tomcat服务器



感谢。

解决方案

这是我的设置:我在Ubuntu 9.10。



现在,这是我做的。


  1. / usr / share 中创建一个名为 tomcat6-myapp

  2. / usr / share / tomcat6-myapp 下创建文件夹 myapp

  3. 将HTML文件(我需要部署)复制到 / usr / share / tomcat6-myapp / myapp 。必须将其命名为 index.html

  4. 转到 / etc / tomcat6 / Catalina / localhost

  5. 在/ etc /下创建一个xml文件 myapp.xml (我想它必须与步骤2中文件夹的名称相同) tomcat6 / Catalina / localhost具有以下内容。




上下文路径=/ myapp

  docBase =/ usr / share / tomcat6-myapp / myapp/> 


6.此xml称为'部署描述符 myapp



7.现在开始使用 http: // localhost:8080 / myapp 在您的浏览器中 - index.html被tomcat取出并显示。



我希望这有助于! p>

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.

Can I create a WAR file from the HTML and CSS pages? How do I deploy them on to a Tomcat server?

Thanks.

解决方案

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!

这篇关于只将HTML,CSS网页部署到Tomcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆