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

RAKsmart秒杀服务器$30/月,洛杉矶/圣何塞/香港/日本站群特价

RAKsmart发布了9月份优惠促销活动,从9月1日~9月30日期间,爆款美国服务器每日限量抢购最低$30.62-$46/月起,洛杉矶/圣何塞/香港/日本站群大量补货特价销售,美国1-10Gbps大带宽不限流量服务器低价热卖等。RAKsmart是一家华人运营的国外主机商,提供的产品包括独立服务器租用和VPS等,可选数据中心包括美国加州圣何塞、洛杉矶、中国香港、韩国、日本、荷兰等国家和地区数据中心(...

老薛主机入门建站月付34/月,年付345元,半价香港VPS主机

老薛主机怎么样?老薛主机这个商家有存在有一些年头。如果没有记错的话,早年老薛主机是做虚拟主机业务的,还算不错在异常激烈的市场中生存到现在,应该算是在众多商家中早期积累到一定的用户群的,主打小众个人网站业务所以能持续到现在。这不,站长看到商家有在进行夏季促销,比如我们很多网友可能有需要的香港vps主机季度及以上可以半价优惠,如果有在选择不同主机商的香港机房的可以看看老薛主机商家的香港vps。点击进入...

昔日数据:香港云服务器(2G防御)、湖北云服务器(100G防御),首月5折,低至12元/月

昔日数据,国内商家,成立于2020年,主要销售湖北十堰和香港HKBN的云服务器,采用KVM虚拟化技术构架,不限制流量。当前夏季促销活动,全部首月5折促销,活动截止于8月11日。官方网站:https://www.xrapi.cn/5折优惠码:XR2021湖北十堰云服务器托管于湖北十堰市IDC数据中心,母鸡采用e5 2651v2,SSD MLC企业硬盘、 rdid5阵列为数据护航,100G高防,超出防...

域名绑定为你推荐
郑州软银筑巢360郑州哪家公司做的好,服务也比较好?美国10次啦导航与美国GPS可以抗衡的国产导航有哪些?登陆qq空间首页使用您的原来关闭了空间的QQ号码登录空间首页http://qzone.qq.com,在进入QQ空间个人中心体验版后,点击左上角“立即开通QQ空间”,根据系统提示,输入您相关的资料后为什么还是没有开通手机炒股软件哪个好手机炒股哪个软件好 要免费的qq空间登录不上为什么我登不进去QQ空间yy空间登录玩空间游戏怎样1直是正在登录中考生个人空间登录自学考试的“考生个人空间”密码忘记了……一定要本人带身份证和考籍证去有关部门吗?考生个人空间登录第一次登陆湖南省高等教育自学考试 考生个人空间就密码不对为什么考生个人空间登录湖南自考所有成绩查询怎么查dns服务器故障DNS服务解析故障 怎么办
备案域名 域名信息查询 博客主机 webhosting 轻博客 512au 服务器cpu性能排行 云主机51web 免费mysql web服务器架设 河南m值兑换 200g硬盘 速度云 国外代理服务器地址 广州服务器 美国独立日 中国电信网络测速 免费ftp smtp服务器地址 中国linux 更多