0

I have a java application.war and I copied the file to tomcat7/webapps directory.

I'm able to access it with www.application.com/application (My domain points to ip 200.xyz.12.jk:8080) BUT

I want to access it through www.application.com (without the name of the folder inside webapps directory)

Also i dont want to allow access to other folders inside webapps.

I have tried some topics but didnt succeed.

Failed to help: Deploying my application at the root in Tomcat

https://josefbetancourt.wordpress.com/2011/02/12/tomcat7-change-root-app/

Tomcat 6: How to change the ROOT application

Thank you so much

Community
  • 1
  • 1
Solano
  • 550
  • 2
  • 9

1 Answers1

1

Place your tomcat under apache http server then point it to tomcat's AJP protocol.

Example of Apache httpd.conf configuration:

Listen 80
ProxyPass / ajp://application.com:8009/application

In tomcat server.xml file you should have below ajp connector:

<Connector port="8009" protocol="AJP/1.3" />

As a result www.application.com/ url points to the application entire directory over ajp protocol.

Hope this will help you.

Ruslan
  • 126
  • 4
  • It throws "ProxyPass|ProxyPassMatch needs a path when not defined in a location" with config you said – Solano May 19 '15 at 16:17
  • 1
    That's ok. Use virtual host instead: ProxyPass ajp://application.com:8009/application . See more info here - https://httpd.apache.org/docs/2.2/mod/core.html#virtualhost – Ruslan May 19 '15 at 16:27