Modify the port number and domain name

1. Modify the port number

1. Find the " server.xml " file of Tomcat , whose path is " Tomcat / conf ", as shown below

2. Open the "server.xml" file with Notepad / edit plug-in and modify the port number according to the logo below ( understand the port number )

3. Remember to save after modification.

PS: When the port number is " 80 ", you can not write the port number when accessing the project , that is, "domain name / project path"

        When the port number is other , the port number needs to be written when accessing the project , that is, "domain name: port number / project path"

2. Modify the domain name, two parts (local and server)

Relationship between domain name and ip: An ip can have multiple domain names, but a domain name can only correspond to one ip, that is , the relationship between ip and domain name is one-to-many .

(1) Modify the domain name locally

1. Find the " hosts " file under the path of " C: \ Windows \ System32 \ drivers \ etc " on the local computer , as shown in the figure below

2. Use Notepad / edit plugin to open, you can see the local default domain name is " localhost "

3. New domain name, please note that there is a gap between ip and domain name , not next to each other

4. Save after adding, you can access the project through the custom domain name

(2) Modify the domain name on the server

1. Find the " server.xml " file under Tomcat , whose path is " Tomcat / conf ", as shown below

2. Open the file and modify the domain name

3. Complete the operation and save the file

Published 77 original articles · 100 likes · 70,000+ views

Guess you like

Origin blog.csdn.net/super_DuoLa/article/details/103293325