Change root context to custom context
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
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):
Did this article resolve your issue ?