maverick
maverick

Reputation: 1484

restrict the default url of a web application

upon deploying a web application in Tomcat one can access it at the url http://localhost:8080/Application_name I want to disable/restrict access through this url as I have defined different url patterns/ servlet mapping in web.xml. How to achieve this.

Upvotes: 1

Views: 259

Answers (1)

Raphael Amoedo
Raphael Amoedo

Reputation: 4455

I guess that's what you want:

  1. Edit tomcat/conf/server.xml.
  2. Specify a bind address for that connector:

    <Connector 
        port="8080" 
        protocol="HTTP/1.1" 
        address="127.0.0.1"
        connectionTimeout="20000" 
        redirectPort="8443" 
      />
    

In this case, I'm setting 127.0.0.1 as IP address, so you can call through 127.0.0.1:8080/Application_name

But you can put an valid IP and that's how it will work.

Upvotes: 1

Related Questions