Lightweight has always been a trend in software development, the same for domain names, now simplifying domain names, such as the t.tt of hammers
Although we do not have their own domain name, but we can also be a short-lived addiction. hehe ~
such as the project on the server, we are generally through the HTTP://IP: Port number/project name in such a way to access, it feels too long, a little trouble.
So what are the parts that can be removed?
IP is certainly not to be removed, but we can use the idea of the domain name, that is, let our computer can map a simple string to an IP, which simplifies the ~
For the port number? We know that the default port number for the Browse Web service is 80, so just configure the Tomcat server's port number to 80, then you can omit the ~
And what about the project name? This can also be done by using the Tomcat configuration file "Subtotal".
So here's a three-step process to start with:
Skillfully with the host file we visit a domain name, the first will go to the local host file mapping, if not found, will go to the DNS server to find, so we configure a local domain name in the host
Locate the host file (take the 32-bit system as an example, the host file is in the C:\WINDOWS\SYSTEM32\DRIVERS\ETC directory) and just add one line:
127.0.0.1zhu
Remove port number
Open the Server.xml file in the Conf directory under Tomcat and find the following section (approximately 69 rows or so):
<connector port= "8080" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8443"/>
Where 8080 is the current Tomcat access port, then change it to 80.
Remove Project Name
Open the Server.xml file in the Conf directory under Tomcat and find the following section (approximately 128 rows or so):
Under
<context path= "" docbase= "Mobile" debug= "0" reloadable= "true"/>
The context tag here represents a Web application where Docbase fills in your project name. Because path is set to "", you do not need to specify the project name
Try it now-just go through http://zhu to get access to your project, isn't it cool ~
Farewell to the port number and project name--tomcat directly with the IP to access the site