Current location - Quotes Website - Team slogan - How to change the port in java!
How to change the port in java!
Modify the default port number of tomcat in Java, and you must be in tomcat environment when running the WEB project. Its default port number is 8080. Sometimes if you want to occupy this port number and run a web project, you need to modify its default port. The specific method is as follows:

1. Open Jakarta-Tomcat-5.5.9 \ conf \ server.xml and find the following code:

& lt! - ? Definition? Answer? Non-SSL Coyote? HTTP/ 1. 1? Connector? Open? Port? 8080? -& gt;

& lt connector? Port ="8080 "

maxThreads=" 150 "? minSpareThreads="25 "? maxSpareThreads="75 "

enableLookups="false "? redirectPort="8443 "? acceptCount=" 100 "

debug="0 "? connectionTimeout="20000 "?

disableUploadTimeout="true "? uri encoding = " GBK "/& gt; 2. The above port=8080 is the port number it uses. You can change it to 80 (the default port of the browser), so you can directly enter the name of http://localhost/ project when editing, and you can access it!