当我在浏览器(example.com)中输入我的域名时,它会将我带到Ubuntu的默认页面,而不是带我到应用程序。我在server.xml中有以下设置
<Host name="example.com" debug="0" appBase="webapps/socialapp" unpackWARs="true" autoDeploy="true">
<Context path="/socialapp" docBase="" debug="0" reloadable="false"/>
<Alias>example.com</Alias>
<Context path="" docBase="" privileged="true"/>
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs/socialapp"
prefix="socialapp_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
主机帐户中的A记录指向IP地址,Cname中包含www和@。 我希望example.com指向tomcat 7的webapps / socialapp文件夹。
答案 0 :(得分:0)
我认为发生此问题是因为您未在应用中设置欢迎页面
为此,在您的应用程序中编辑您的web.xml,如下所示:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
在web.xml file.this标记集index.jsp中添加以上标记 over 所有标记作为您应用的主页。
我希望这可以帮到你。