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.4
- 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.
- In {JBOSS_HOME}/standalone/deployments, rename ROOT.war and ROOT.war.deployed to myportal.war and myportal.war.deployed.
- Modify WEB-INF/jboss-web.xml from
<context-root>/</context-root>
to<context-root>myportal</context-root>
- Clear up Jboss 'tmp' folder
- Restart the server
- For Tomcat, the following is an example of how to change the default root context to custom 'myportal' context.
- Update the ROOT folder name (under {LIFERAY_HOME}/tomcat_home/webapps/ROOT) to 'myportal'.
- Update the ROOT.xml file name (under {LIFERAY_HOME}/tomcat_home/conf/Catalina/localhost/) to 'myportal.xml'.
- Update the
common.loader
property in the catalina.properties file name (under {LIFERAY_HOME}/tomcat_home/conf/) from:
common.loader=“${catalina.home}/webapps/ROOT/WEB-INF/lib/support-tomcat.jar”
to
common.loader=“${catalina.home}/webapps/myportal/WEB-INF/lib/support-tomcat.jar”
- Clear temp and work directories under TOMCAT_HOME.
- 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/".
- It is important to also change other paths originally pointing to the ROOT context, such as Patching Tool's configuration file (default.properties):
- war.path
- global.lib.path
Additional Information
- Above configuration are Application Server settings. Further recommendations need to be discussed with the corresponding Application Server Vendor.
Subscriber Exclusive Content
A Liferay Enterprise Subscription provides access to over 1,500 articles that include best practices, troubleshooting, and other valuable solutions. Sign in for full access.
Sign In