tomcat localhost configuration
How to configure tomcat so that a url may have a prefix to localhost (for example 'api.' so that is specified in the format:
http:开发者_StackOverflow//api.localhost:8080/dirpath1/path2/path3/pathetc/?
Is this possible?
You'll need to set up an entry in your hosts
file. On linux/OSX, this file is located at /etc/hosts
. On Windows it's typically located at C:\Windows\System32\drivers\etc\hosts
. You'll want to open up the file in a text editor and add a line similar to this:
api.localhost 127.0.0.1
To set up a new application in tomcat for api.localhost
, simply follow the instructions for setting up a tomcat virtual host.
精彩评论