John
John

Reputation: 11

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://api.localhost:8080/dirpath1/path2/path3/pathetc/?

Is this possible?

Upvotes: 1

Views: 778

Answers (1)

Asaph
Asaph

Reputation: 162801

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.

Upvotes: 4

Related Questions