开发者

setting the tomcat context path

I am running alfresco (alfresco开发者_JS百科.war) on tomcat server..

Presently i am using the url as http://kmkhub/alfresco .. it is redirecting into the alfresco website..

But i want to type kmkhub in the browser.. it will redirect into the .. alfresco website..

Can you provide the suggestions.. how can i achieve it..

Regards, krishna


goto war check web.xml contextroot make it blank instead of alfresco or goto tomcat admin console and deploy and specify context path blank from UI

setting the tomcat context path


The easiest way is to name your war ROOT.war and deploy it (remove/rename) the ROOT folder before that

Another option is to an .xml context configuration file with <Context path="/" />:

In individual files (with a ".xml" extension) in the $CATALINA_BASE/conf/[enginename]/[hostname]/ directory. The name of the file (less the .xml extension) will be used as the context path. Multi-level context paths may be defined using #, e.g. foo#bar.xml for a context path of /foo/bar. The default web application may be defined by using a file called ROOT.xml.

You can also have this in META-INF/context.xml in the WAR.

See here


If you don't care about the URL displayed in the browser the easiest way is to create a redirect in the ROOT webapp.

Create this index.jsp file in the ROOT webapp:

<%
response.sendRedirect("/alfresco");
%>

Changing the name of the alfresco app, as proposed by the others, will work but you would need to alter the configuration for the share webapp as well because Share connects to http://localhost/alfresco. To change the URLs you would have to edit the configuration files found in tomcat\shared\classes\alfresco\web-extension.


If you are using Maven + Tomcat7 Maven Plugin, then just configure your Root Path as shown below:

setting the tomcat context path

<plugin>
  <groupId>org.apache.tomcat.maven</groupId>
  <artifactId>tomcat7-maven-plugin</artifactId>
  <version>2.2</version>
  <configuration>
    <path>/</path>
  </configuration>
</plugin>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜