绑定tomcat5.5配置-多域名绑定和虚拟目录(Tomcat5.5 configuration - multi domain bindings and virtual directories)

域名绑定  时间:2021-01-21  阅读:()

tomcat5.5配置-多域名绑定和虚拟目录Tomcat5.5 conf iguration

- multi domain bindings and virtual directoriesTomcat5.5 configuration - multi domain binding and virtualdirectory 2007-08-19 22:02Tomcat5. 5 configuration - multidomain binding and virtual directories

Tomcat uses the default installation, and if you want tamcatto bind directly to multiple domains, here we need to modifythe configuration f ile: C:\Program, Files\Apache, Software,Foundation\Tomcat, 5.5\conf\server.xml

The modification of server.xml is as follows:

(1) multi domain binding

1. , if you want to bind a web site, first you want to changeTomcat' s default access port 8080 to 80

Original:

<Connector port= "8080"maxHttpHeaderSize="8192"maxThreads="150" minSpareThreads= "25" maxSpareThreads= "75"enableLookups= "false" redirectPort= "8443" acceptCount="100"connect ionTimeout="20000" disableUploadTimeout="true"/ >

After modification:

<Connector port= "80" maxHttpHeaderSize= "8192" maxThreads="150" minSpareThreads= "25" maxSpareThreads= "75"

enableLookups= "false" redirectPort= "8443" acceptCount="100"connect ionTimeout="20000" disableUploadTimeout="true"/ >

In fact, here is the port:8080, modified to port:80 on it, andother parameters remain unchanged

2. , the next point is, ha ha. . .

Original:

<Engine name=, "Catalina", "defaultHost=", "localhost" ><Host name= "localhost" appBase= "webapps" unpackWARs= "true"autoDeploy= "true" xmlVal idation= "false" xmlNamespaceAware="false" / >

</Engine>

Of course, here I put all the code removed, the unsightlyAfter modification:

<Engine name=, "Catalina", defaultHost=www.abc.com>

<Host name=, "www.abc. com", "appBase==", "abcapps", "true",,

<Host name=www.cba. com appBase== "D:\cba" unpackWARs= "true"autoDeploy= "true" xmlVal idation= "false" xmlNamespaceAware=

"false" / >

<Host name= "localhost" appBase= "webapps" unpackWARs= "true"autoDeploy= "true" xmlVal idation= "false" xmlNamespaceAware="false" / >

</Engine>

Here' s an explanation of the configuration above

Engine dafaultHost: means access to the default Tomcat accesshost, note must not be localhost, or else through your IPaccess,it will default into the Tomcat management interface

The Host of name: represents the domain name that the host binds,and if you bind localhost, you can access the Host. by enteringlocalhost in the browser

The Host of appBase: represents the file storage path that thehost binds, and you can use relative paths or absolute pathsFollow the configuration above:

1. if I enter http://localhost in the browser, I' ll visit theweb site under C:\Program Files\Apache Software

Foundat ion\Tomcat 5.5\webapps\ROOT

2. if you enter http://www.abc.com, access the web site under

C:\Program Files\Apache Software Foundation\Tomcat

5.5\abc app s\ROOT

D:\cba\ROOT

Note that there is a ROOT directory that needs to be created.We can just access the site to the appropriate ROOT directoryand then access it via the corresponding domain name

There are a lot of parameters, and I'm not very clear, but thiscan really achieve multi domainbinding ha ha, and the site pagechanges, as long as the direct coverage can be,

Tomcat can automatically update classes and pages, and, ofcourse, you need to restart Tomcat if you change web.xml or Lib(two) virtual directory

<Host name=, "localhost", "appBase=", "webapps""

UnpackWARs= "true", "autoDeploy=", "true""

XmlValidation= "false", "xmlNamespaceAware=", "false" ><Context path=, "/cqq", "docBase=", "f:\java\cqqapp","debug=", "", "reloadable=", "true", "crossContext=", "true" ></Ho st>

Among them, the Host tag is used to configure the virtual host,that is, you can point to a number of domain name tomcat, theformat as long as the reference to the default

All right。

<context> is the child element of the Host tag. It representsa virtual directory. It has two main attributes, and path isequivalent to the virtual directory name,

The docbase is the specific file location. Here, my virtual pathname is cqq, and in fact my program is HTML, jsp,

Servlet is under the f:\java\cqqapp directory.

So I can access myvirtual directory viahttp://127.0.0. 1/cqq/.Another way is:

Configure two sites

<Host name=, "www.xyz. com", "debug=", "0", "appBase=","D:\Tomcat5.5\portal", "true", "autoDeploy=", "true",unpa ckWARs=

<Context "path=" docBase= "D:/Tomcat5.5/portal" debug= "0"reloadable= "true" / >

</Ho st>

<Hos t name=, "www.abc. com", "appBase=", "D:\Tomcat5.5\hxw""UnpackWARs= "true", "autoDeploy=", "true""

XmlValidation= "false", "xmlNamespaceAware=", "false" >

<Context "path=" docBase= "D:\Tomcat5.5\abc" debug= "0"reloadable= "true" / >

</Ho st>

After this setting, enter the domain name can be divided intotwo sites

But because you do not specify a default site, you cannot accessthe IP directly.

Then increase D:\Tomcat5. 5\conf\Catalina\localhost\ROOT.xmlContent such as

<Context path=, "/", "docBase=", "${catalina.home}/portal","debug=", "5", "reloadable=", "true", "crossContext=","true" >

</Context>

So you can enter the domain name to a site, and enter IP defaultto D:/Tomcat5.5/portal this site

But, however, the problem arises

These two sites start consuming memory, and the TOMCAT memorysettings I've set to 1400M (no higher TOMCAT5 can't start) , soI can't start three applications at once.

Have you ever implemented an application that binds multipled oma i ns?.

As follows (so writing TOMCAT is certainly not started, justto express what I mean)

<Host name=, "www.abc. com, 192. 168.0. 1", "appBase=",

"D:\Tomcat5.5\hxw""

UnpackWARs= "true", "autoDeploy=", "true""

XmlValidation= "false", "xmlNamespaceAware=", "false" ><Context "path=" docBase= "D:\Tomcat5.5\abc" debug= "0"reloadable= "true" / >

</Ho st>

香港服务器租用多少钱一个月?影响香港服务器租用价格因素

香港服务器租用多少钱一个月?香港服务器受到很多朋友的青睐,其中免备案成为其特色之一。很多用户想了解香港云服务器价格多少钱,也有同行询问香港服务器的租赁价格,一些实际用户想要了解香港服务器的市场。虽然价格是关注的焦点,但价格并不是香港服务器的全部选择。今天小编介绍了一些影响香港服务器租赁价格的因素,以及在香港租一个月的服务器要花多少钱。影响香港服务器租赁价格的因素:1.香港机房选择香港机房相当于选择...

RangCloud19.8元/月,香港cn2云主机,美国西雅图高防云主机28元/月起

rangcloud怎么样?rangcloud是去年年初开办的国人商家,RangCloud是一家以销售NAT起步,后续逐渐开始拓展到VPS及云主机业务,目前有中国香港、美国西雅图、韩国NAT、广州移动、江门移动、镇江BGP、山东联通、山东BGP等机房。目前,RangCloud提供香港CN2线路云服务器,电信走CN2、联通移动直连,云主机采用PCle固态硬盘,19.8元/月起,支持建站使用;美国高防云...

企鹅小屋6折年付240元起,美国CN2 GIA VPS促销,独享CPU,三网回程CN2 GIA

企鹅小屋怎么样?企鹅小屋最近针对自己的美国cn2 gia套餐推出了2个优惠码:月付7折和年付6折,独享CPU,100%性能,三网回程CN2 GIA网络,100Mbps峰值带宽,用完优惠码1G内存套餐是年付240元,线路方面三网回程CN2 GIA。如果新购IP不能正常使用,请在开通时间60分钟内工单VPS技术部门更换正常IP;特价主机不支持退款。点击进入:企鹅小屋官网地址企鹅小屋优惠码:年付6折优惠...

域名绑定为你推荐
2014年万圣节是几月几日万圣节是几月几日浏览器哪个好什么浏览器最好用?涡轮增压和自然吸气哪个好涡轮增压和自然吸气哪个更好,优缺点是什么?法兰绒和珊瑚绒哪个好法兰绒和珊瑚绒睡衣哪个好?音乐播放器哪个好音乐播放器哪个最好用三国游戏哪个好玩三国类的游戏哪些好玩点行车记录仪哪个好行车记录仪哪种好用?51空间登录怎样登51个人空间qq空间登录不上为什么我的QQ空间登陆不上?东莞电信网上营业厅怎样联系申请东莞中国电信固话
长沙域名注册 骨干网 企业主机 php免费空间 河南m值兑换 空间技术网 linux使用教程 drupal安装 超级服务器 工信部icp备案查询 如何登陆阿里云邮箱 大化网 电信主机托管 香港博客 什么是dns WHMCS godaddy域名 56折扣网 sockscap下载 最年轻博士 更多