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

Vultr VPS新增第18个数据中心 瑞典斯德哥尔摩欧洲VPS主机机房

前几天还在和做外贸业务的网友聊着有哪些欧洲机房的云服务器、VPS商家值得选择的。其中介绍他选择的还是我们熟悉的Vultr VPS服务商,拥有比较多达到17个数据中心,这不今天在登录VULTR商家的时候看到消息又新增一个新的机房。这算是第18个数据中心,也是欧洲VPS主机,地区是瑞典斯德哥尔摩。如果我们有需要欧洲机房的朋友现在就可以看到开通的机房中有可以选择瑞典机房。目前欧洲已经有五个机房可以选择,...

HostWebis:美国/法国便宜服务器,100Mbps不限流量,高配置大硬盘,$44/月起

hostwebis怎么样?hostwebis昨天在webhosting发布了几款美国高配置大硬盘机器,但报价需要联系客服。看了下该商家的其它产品,发现几款美国服务器、法国服务器还比较实惠,100Mbps不限流量,高配置大硬盘,$44/月起,有兴趣的可以关注一下。HostWebis是一家国外主机品牌,官网宣称1998年就成立了,根据目标市场的不同,以不同品牌名称提供网络托管服务。2003年,通过与W...

hosteons:10Gbps带宽,免费Windows授权,自定义上传ISO,VPS低至$21/年,可选洛杉矶达拉斯纽约

hosteons当前对美国洛杉矶、达拉斯、纽约数据中心的VPS进行特别的促销活动:(1)免费从1Gbps升级到10Gbps带宽,(2)Free Blesta License授权,(3)Windows server 2019授权,要求从2G内存起,而且是年付。 官方网站:https://www.hosteons.com 使用优惠码:zhujicepingEDDB10G,可以获得: 免费升级10...

域名绑定为你推荐
美国10次啦导航gps卫星导航用的卫星应该是美国的吧?那有限几十颗卫星怎么能同时给地面上如此多的终端提供导航呢?电脑管家和360哪个好360和电脑管家哪个好啊莫代尔和纯棉哪个好请问莫代尔棉和纯莫代尔哪个更好?帕萨特和迈腾哪个好迈腾与帕萨特那个好?华为p40和mate30哪个好华为mate30和荣耀3O那个好?等额本息等额本金哪个好等额本金和等额本息哪个划算?如果想在5-10年内还清贷款哪类更划算一些?oppo和vivo哪个好vivo好还是oppo手机好呢?行车记录仪哪个好我想买一个24小时监控行车记录仪,哪款比较好?p图软件哪个好有什么P图工具比较好用飞信空间登录关于飞信登陆方式
ipage hostmaster 荷兰服务器 Hello图床 免费网站申请 40g硬盘 anylink 169邮箱 流量计费 免费dns解析 google台湾 西安主机 阿里云邮箱登陆地址 江苏徐州移动 apnic wordpress空间 cdn加速 木马检测 泥瓦工 百度空间登陆首页 更多