Search code examples
angulartomcatdeployment

How to host Angular Application to work on domain root while keeping in a separate folder in webapps directory in tomcat


I have bought a VPS server and installed tomcat 10. I want to run angular app on domain root like: www.example.com and not www.example.com/myapp. I also want to keep the angular app to deploy in a separate folder (webapps/myapp) rather than deploying files to webapps directly.


Solution

  • Simply deploy your app to webapps/ROOT instead of webapps/myapp. ROOT (in all capital letters) is the key name for tomcat's app answering on /, all other directory names stand for webapps with the verbatim same name.