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

HostKvm5.95美元起,香港、韩国可选

HostKvm发布了夏季特别促销活动,针对香港国际/韩国机房VPS主机提供7折优惠码,其他机房全场8折,优惠后2GB内存套餐月付仅5.95美元起。这是一家成立于2013年的国外主机服务商,主要提供基于KVM架构的VPS主机,可选数据中心包括日本、新加坡、韩国、美国、中国香港等多个地区机房,均为国内直连或优化线路,延迟较低,适合建站或者远程办公等。下面分享几款香港VPS和韩国VPS的配置和价格信息。...

iON Cloud七月促销适合稳定不折腾的用户,云服务器新购半年付8.5折,洛杉矶/圣何塞CN2 GT线路,可选Windows系统

iON Cloud怎么样?iON Cloud今天发布了7月份优惠,使用优惠码:VC4VF8RHFL,新购指定型号VPS半年付或以上可享八五折!iON的云服务器包括美国洛杉矶、美国圣何塞(包含了优化线路、CN2 GIA线路)、新加坡(CN2 GIA线路、PCCW线路、移动CMI线路)这几个机房或者线路可供选择,有Linux和Windows系统之分,整体来说针对中国的优化是非常明显的,机器稳定可靠,比...

Digital-VM80美元新加坡和日本独立服务器

Digital-VM商家的暑期活动促销,这个商家提供有多个数据中心独立服务器、VPS主机产品。最低配置月付80美元,支持带宽、流量和IP的自定义配置。Digital-VM,是2019年新成立的商家,主要从事日本东京、新加坡、美国洛杉矶、荷兰阿姆斯特丹、西班牙马德里、挪威奥斯陆、丹麦哥本哈根数据中心的KVM架构VPS产品销售,分为大硬盘型(1Gbps带宽端口、分配较大的硬盘)和大带宽型(10Gbps...

域名绑定为你推荐
免费个人网站制作怎么免费做自己个人的网站月付百万的女人们既然男人大都觉得下体毛发多的女人比较性感..那为什么那些特殊职业的女人们大多把下体的毛脱掉呢..?录屏软件哪个好手机录屏的话那个软件会好一点绝地求生加速器哪个好绝地求生用什么加速器比较好?核芯显卡与独立显卡哪个好核芯显卡和独立显卡哪个好?请直接点谢谢啦!海克斯皮肤哪个好海克斯安妮和摄魂薇恩哪个好 需要多少宝石oppo和vivo哪个好OPPO手机和vivo手机哪个好?群空间登录群空间无法正常登陆的问题如何增加百度收录如何提高百度的收录数量360云盘登陆怎样登陆360我的云盘
虚拟主机管理软件 浙江vps 动态域名解析软件 电信测速器 电影服务器 美国仿牌空间 地址大全 圣诞节促销 免费ftp空间申请 dux 帽子云 有奖调查 免费个人空间 广州服务器 环聊 带宽租赁 群英网络 免费网络空间 免费稳定空间 云服务是什么意思 更多