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.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/".
订阅者专属内容
Liferay企业级订阅提供超过1500篇文章的访问权限,包括最佳范例,排查和解决问题,和其他有价值的解决方案。登录以获得全部权限。
登录