简体   繁体   中英

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?

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). search for 8080 and change it there.

YOu shoul dfind the following line in 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"

Unless you already have something on port 80 of course.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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