Change root context to custom context

Issue

  • How to change the portal context from ROOT to something else?
  • Can I append "xxx" to all the portal URL?

Environment

  • Liferay DXP 7.3
  • Liferay DXP 7.2
  • Liferay DXP 7.1
  • Liferay Portal 6.2
  • JBoss EAP 7.1 / Tomcat 9.0

Resolution

  • For JBoss, the following is an example of how to change the default root context to custom 'myportal' context.
    1. In {JBOSS_HOME}/standalone/deployments, rename ROOT.war and ROOT.war.deployed to myportal.war and myportal.war.deployed.
    2. Modify WEB-INF/jboss-web.xml from
      <context-root>/</context-root>
      to
      <context-root>myportal</context-root>
    3. Clear up Jboss 'tmp' folder
    4. Restart the server
  • For Tomcat, the following is an example of how to change the default root context to custom 'myportal' context.
    1. Change the ROOT folder name (under {LIFERAY_HOME}/tomcat-9.0.17/webapps/ROOT) to 'myportal'.
    2. Change the ROOT.xml file name (under {LIFERAY_HOME}/tomcat-9.0.17/conf/Catalina/localhost/) to 'myportal.xml'.
    3. Clear temp and work directories under TOMCAT_HOME.
    4. Restart the server.
  • The original portal URL is "localhost:8080/". After changing the portal context, the portal URL will be changed to "localhost:8080/myportal/".

Additional Information

  • Above configuration are Application Server settings. Further recommendations need to be discussed with the corresponding Application Server Vendor.
Was this article helpful?
0 out of 0 found this helpful