Its been few days i've been searching for a solution. My question is..I have to deploy a project in tomcat and make it as a default webapp. What I did is copied my war file and placed it in the tomcat/webapps folder. Started tomcat and changed the port to default. Now I can access my application at http://localhost/myapp .What i want is to see my application at http://localhost. How can I do this?
相关问题
- Tomcat and SSL Client certificate
- Can't configure nginx as a proxy for tomcat wi
- Can you set the Location header in a chunked http
- Tomcat 8 how to remove sessionCookieName from URL
- C# How do I create code to set a form back to defa
相关文章
- Tomcat的User信息可以存储到数据库中吗?
- tomcat的server.xml支持从Oracle中获取数据吗?
- web项目,Resonse Header发生解析错误,请大牛帮忙看看究竟是哪里的问题?
- Apache+Tomcat+JK实现的集群,如果Apache挂了,是不是整个服务就挂了?
- linux环境部署jpress,创建数据库时提提示连接失败
- Making a two way SSL authentication between apache
- File Upload of more than 4GB
- Can't start Tomcat as Windows Service
you could rename your webapp to ROOT (the default app for tomcat), or you can use a web server that can handle domain names and redirects (like apache httpserver), and configure your site there.
The first approach is not very elegant, but quick and efficient though.
Delete the
Tomcat/webapps/ROOT
folder (if any), rename your WAR file toROOT.war
and restart.I was able to do it by adding "Context" element with path="" attribute under Host in server.xml file.
Note: I am using Tomcat 7. Also I had to move my webapp to different location than default webapps folder. I also deleted default webapps provided by tomcat. But this solution works even without deleting them.
Here are contents of my server.xml for reference. Hope this helps.
create index.html at webapps/ROOT with below.