只将HTML,CSS网页部署到Tomcat [英] Deploying just HTML, CSS webpage to Tomcat
问题描述
我刚刚开始开发网站。目前我只有一个HTML页面支持一些 CSS样式表。
我可以从HTML和CSS页面创建 WAR文件吗?我如何将它们部署到Tomcat服务器?
感谢。
这是我的设置:我在Ubuntu 9.10。
现在,这是我做的。
- 在 / usr / share 中创建一个名为 tomcat6-myapp
- 在 / usr / share / tomcat6-myapp 下创建文件夹 myapp 。
- 将HTML文件(我需要部署)复制到 / usr / share / tomcat6-myapp / myapp 。必须将其命名为 index.html 。
- 转到 / etc / tomcat6 / Catalina / localhost 。
- 在/ 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.
- Create a folder named "tomcat6-myapp" in /usr/share.
- Create a folder "myapp" under /usr/share/tomcat6-myapp.
- Copy the HTML file (that I need to deploy) to /usr/share/tomcat6-myapp/myapp. It must be named index.html.
- Go to /etc/tomcat6/Catalina/localhost.
- 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屋!