Tomcat is most popular web server for hosting java based websites. If you want to install tomcat on your system use following tutorials. By default tomcat runs on port 8080. This tutorial will help you to change tomcat server default port.
Change Tomcat Default Port
Edit server.xml file located under conf directory of tomcat installation.
$ vi [TOMCAT INSTALL DIR]/conf/server.xml
Find the below content in configuration file
<Connector port="8080 " protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
Replace port 8080 with your required port. For example we are changing the default tomcat port with 8081.
<Connector port="8081 " protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
After making above changes restart tomcat service. You will see that now tomcat is started on port 8081 or port you configured. Access tomcat on new port in web browser.
1 Comment
I have configured tomcat connector on one server and create different virtual host domain but I am facing some issue like I have created vms.dev.com:7070 domain and other is vms.test.com:9090 in tomcat server both domain is accessible in browser but when I open vms.dev.com:9090 it will also open and its directory location is test server and when I open vms.test.com:7070 it will also open and its directory location in dev server. it is possible to restrict port access on other domain in same server like if I want to open vms.dev.com:9090 then it should be give some error. Please help me to solve this issue.