我把项目放到网站上,
但要输入http://www.域名.com:8080/工程名/home/index.jsp有什么办法能设置一下tomcat,使得只要输入http://www.域名.com,就能访问上面的网页呢?
但要输入http://www.域名.com:8080/工程名/home/index.jsp有什么办法能设置一下tomcat,使得只要输入http://www.域名.com,就能访问上面的网页呢?
调试欢乐多
1、打开Tomcat安装目录下的\conf\server.xml文件
2、在server.xml中将原有的<Host name=“localhost“ appBase=“webapps“ ……>修改为<Host name=“您要配置的域名“ appBase=“webapps“……>
3、在\conf\Catalina目录下建立目录“<您要配置的域名的名称>”,然后建立ROOT.xml文件,其格式和\conf\localhost目录下的ROOT.xml一致,但是内容如下:
<?xml version='1.0' encoding='utf-8'?>
<Context displayName="Welcome to 56World!" docBase="D:\workplace\inbuilding" path="">
</Context>
其中docBase中的内容就是你希望的打开您的域名(www.***.com) 的时候映射到的目录和默认的网页(如:index.jsp)
4、启动Tomcat服务器,就可以直接敲入域名访问你要访问的地址了
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
中间的就是你需要默认访问的jsp名称