简体   繁体   English

Tomcat 主机和端口配置

[英]Tomcat Host & port Configuration

I have tomcat 5.5 in my windows environment listening to the port:8080.I wanted to change the hostname from localhost to www.mydomain.com.Adding the alias name in the conf/server.xml & adding the entry in /etc/hosts file I achieved this.But I have to access the name with the port number in the URL like http://www.mydomain.com:8080/ .Is there any way with out specifying the port number in the URL, redirect/forward the requests to port 8080 if the URL is www.mydomain.com? I have tomcat 5.5 in my windows environment listening to the port:8080.I wanted to change the hostname from localhost to www.mydomain.com.Adding the alias name in the conf/server.xml & adding the entry in /etc/hosts file I achieved this.But I have to access the name with the port number in the URL like http://www.mydomain.com:8080/ .Is there any way with out specifying the port number in the URL, redirect/forward如果 URL 是 www.mydomain.com,对端口 8080 的请求?

you should be able to change this in [tomcat home]/conf/server.xml (at least on a unix-type system, but should be similar on win).您应该可以在 [tomcat home]/conf/server.xml 中更改它(至少在 unix 类型的系统上,但在 win 上应该类似)。 search for 8080 and change it there.搜索 8080 并在此处更改。

YOu shoul dfind the following line in server.xml您应该在 server.xml 中找到以下行

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

change port="8080" to port="80"port="8080"更改为port="80"

Unless you already have something on port 80 of course.当然,除非您已经在端口 80 上有了一些东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM