Tomcat 让百度的域名显示自己的页面内容(玩耍篇)
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Tomcat 让百度的域名显示自己的页面内容(玩耍篇),小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2195字,纯文字阅读大概需要4分钟。
内容图文
步骤一:在 <SPAN style=‘font-family: "Times New Roman";‘>C:\Windows\System32\drivers\etc
目录下的 "Times New Roman";‘>Hosts文件中添多一个条目,如下图,
第二步:在server.xml文件中做响应配置,如下图
然后在<SPAN style=‘font-family: "Times New Roman";‘>Host节点中进行如下设置
当然如果你将站点设置到其他地方,那么appBase中的内容要进行修改,现在我将站点设置到的<SPAN style=‘font-family: "Times New Roman";‘>C判断下<SPAN style=‘font-family: "Times New Roman";‘>a文件夹中。
然后在<SPAN style=‘font-family: "Times New Roman";‘>Connector节点中,更改端口为<SPAN style=‘font-family: "Times New Roman";‘>80
步骤三:启动<SPAN style=‘font-family: "Times New Roman";‘>Tomcat
这个时候会一个严重的错误,是没有发现<SPAN style=‘font-family: "Times New Roman";‘>host-manager和<SPAN style=‘font-family: "Times New Roman";‘>manager目录,这个时候可以忽略这个错误,也可以将<SPAN style=‘font-family: "Times New Roman";‘>Tomcat中对应的<SPAN style=‘font-family: "Times New Roman";‘>webapps中的内容<SPAN style=‘font-family: "Times New Roman";‘>copy到<SPAN style=‘font-family: "Times New Roman";‘>a文件夹下。
步骤四:在文件夹中新建一个文件夹<SPAN style=‘font-family: "Times New Roman";‘>ROOT,在该文件夹中放入一个默认页和一个名为<SPAN style=‘font-family: "Times New Roman";‘>WEB-INF的文件夹,在<SPAN style=‘font-family: "Times New Roman";‘>WEB-INF文件夹中,新建一个名为<SPAN style=‘font-family: "Times New Roman";‘>web.xml的文件,文件内容如下:
1<?xml version="1.0" encoding="UTF-8"?> 2 3<web-app version="2.5" 4 5xmlns="http://java.sun.com/xml/ns/javaee" 6 7xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 8 9xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 1011http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">1213<welcome-file-list>1415<welcome-file>1.html</welcome-file>1617</welcome-file-list>1819</web-app>
步骤五<SPAN style=‘font-family: "Times New Roman";‘>;在浏览器中键入<SPAN style=‘font-family: "Times New Roman";‘>http://www.baidu.com,就可以看到我们的默认页了。
注意点:如果您的电脑上安装有其他服务器,例如<SPAN style=‘font-family: "Times New Roman";‘>IIS,可能会将<SPAN style=‘font-family: "Times New Roman";‘>80端口占用。
这时您可以先停止<SPAN style=‘font-family: "Times New Roman";‘>IIS服务,然后进行对应的设置。
原文:http://www.cnblogs.com/weilengdeyu/p/3680448.html
内容总结
以上是互联网集市为您收集整理的Tomcat 让百度的域名显示自己的页面内容(玩耍篇)全部内容,希望文章能够帮你解决Tomcat 让百度的域名显示自己的页面内容(玩耍篇)所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。