绑定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>

bluehost32元/月,2核2G/20GB空间,独立ip,新一代VPS美国云主机!

bluehost怎么样?bluehost推出新一代VPS美国云主机!前几天,BlueHost也推出了对应的周年庆活动,全场海外虚拟主机月付2.95美元起,年付送免费的域名和SSL证书,通过活动进入BlueHost中文官网,购买虚拟主机、云虚拟主机和独立服务器参与限时促销。今天,云服务器网(yuntue.com)小编给大家介绍的是新一代VPS美国云主机,美国SSD云主机,2核2G/20GB空间,独立...

六一云互联(41元)美国(24元)/香港/湖北/免费CDN/免费VPS

六一云互联六一云互联为西安六一网络科技有限公司的旗下产品。是一个正规持有IDC/ISP/CDN的国内公司,成立于2018年,主要销售海外高防高速大带宽云服务器/CDN,并以高质量.稳定性.售后相应快.支持退款等特点受很多用户的支持!近期公司也推出了很多给力的抽奖和折扣活动如:新用户免费抽奖,最大可获得500元,湖北新购六折续费八折折上折,全场八折等等最新活动:1.湖北100G高防:新购六折续费八折...

RAKsmart 黑色星期五云服务器七折优惠 站群服务器首月半价

一年一度的黑色星期五和网络星期一活动陆续到来,看到各大服务商都有发布促销活动。同时RAKsmart商家我们也是比较熟悉的,这次是继双十一活动之后的促销活动。在活动产品中基本上沿袭双11的活动策略,比如有提供云服务器七折优惠,站群服务器首月半价、还有新人赠送红包等活动。如果我们有需要RAKsmart商家VPS、云服务器、独立服务器等产品的可以看看他们家的活动。这次活动截止到11月30日。第一、限时限...

域名绑定为你推荐
锦天城和君合哪个好记忆棉和乳胶哪个好核芯显卡与独立显卡哪个好独立显卡和核芯显卡有什么区别网校哪个好有什么网校比较好p图软件哪个好有什么P图工具比较好用腾讯空间登录腾讯qq空间进入登陆个人QQ空间牡丹江教育云空间登录请问一下校园云空间的登录方式有哪些?yy空间登录怎样进入YY主播的空间网通dns服务器地址湖北省鄂州市葛店镇DNS服务器IP地址是多少铁通dns服务器地址铁通dns服务器地址360云盘同步版网络正常的。 提示360云盘同步版同步失败 ,文件被占用中,无法更新是什么原因
合肥虚拟主机 免费注册网站域名 域名备案只选云聚达 美元争夺战 圣迭戈 l5520 美国便宜货网站 gomezpeer 正版win8.1升级win10 轻量 丹弗 qingyun 数字域名 有奖调查 泉州电信 cdn加速原理 php空间购买 免费高速空间 息壤代理 独享主机 更多