更改 liferay 工程的 context root

来源:互联网 发布:编程判断题 编辑:程序博客网 时间:2024/05/16 01:42

Liferay 缺省发布在服务器的根目录下,我们可以通过修改一些设置来实现修改 context root 的目的。

 

1. 在.../glassfish/domains/domain1/applications/j2ee-modules/liferay-portal-5.2.3/WEB-INF目录下修改 sun-web.xml 文件(由于我发布在glassfish上所以修改这个文件)。

 

原文件内容为:  <context-root>/</context-root>

 

修改为:           <context-root>/liferay/</context-root>

 

2. 在.../glassfish/domains/domain1/applications/j2ee-modules/liferay-portal-5.2.3/WEB-INF/classes目录下建立 portal.ctx 文件。

 

内容为:

     ## Portal Context
##
#
# Set this property if you deploy the portal to another path besides root.
#
portal.ctx=/liferay

 

3. 在 glassfish 的 Web Applications 中将新发布的 liferay-portal-5.2.3 Context Root修改为 /liferay, 保存。

 

4. 重新启动glassfish, 此时context root 已经改变为 http://localhost:8080/liferay/web/guest/home/

原创粉丝点击