I have tomcat installed on my local machine. I see it in server.xml where I have below entry
<Connector executor="tomcatThreadPool"
port="${http.port}"
protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="${https.port}"
acceptCount="100"
maxKeepAliveRequests="15"/>
where http.port value in catalina.properties is 8080 .
But every time I try to access my application it url http://localhost/myApp I get error
could not connect to localhost but it works fine http://localhost:8080/myApp. I am not getting why it expects
the port 8080 when it is already a default port? What should I do so that I do not have to mention port?
When you write
http://localhost/myAppon the Address Bar of your Browser, the request always goes to Port 80, and not Port 8080. So the default is Port 80 here. Forhttp://localhost/myAppto work you need to install something like Apache HTTP Server.Then you can configure it with the help of a connector like mod_jk or mod_proxy to use
http://localhost/myAppi, instead ofhttp://localhost:8080/myApp. So that what ever request comes on Port 80 can be diverted to Port 8080 automatically.Once you will download mod_jk, simply extract the file mod_jk.so to the modules folder of your Apache HTTP Server.
Hopefully the steps written here How to Configure Apache HTTP Server with Apache Tomcat, might help you in doing that.