This wiki does not contain official documentation and is currently deprecated and read only. Please try reading the documentation on the Liferay Developer Network, the new site dedicated to Liferay documentation. DISCOVER Build your web site, collaborate with your colleagues, manage your content, and more. DEVELOP Build applications that run inside Liferay, extend the features provided out of the box with Liferay's APIs. DISTRIBUTE Let the world know about your app by publishing it in Liferay's marketplace. PARTICIPATE Become a part of Liferay's community, meet other Liferay users, and get involved in the open source project. Installing Liferay EE on Existing Tomcat 5.5 (Chinese)
部署 liferay-portal-x.x.x.war 到tomcat的方法 #
1.下载并且安装 Tomcat 5.5.x 到指定的文件夹下.现在开始,所指定的文件夹将成为 $TOMCAT_HOME. 注意:JDK 5使用者,移动bundleTomcat下webapps/ROOT/WEBINF/lib/xercesImpl. jar和ccpp.jar(或名ccpp-ri.jar,移动后需更名为ccpp.jar)到$TOMCAT_HOME/common/ endorsed 目录下.JDK1.4在Liferay5.x及以上版本已不被支持。
2.创建并且编辑文件 $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml 内容如下:
<Context path=""> </Context>
3.下载 liferay-portal-x.x.x.war. 4.下载 liferay 的附件(dependencies文件).创建一个文件夹 $TOMCAT_HOME/common/lib/ext 并将dependencies文件解压到该目录下。或手动将每一个文件移动到目标目录下,要保证每一个文件都要复制到该目录下. 5.如下方式编辑 $TOMCAT_HOME/conf/catalina.properties: 在
common.loader= ${catalina.home}/common/classes,
${catalina.home}/common/i18n/*.jar,
${catalina.home}/common/endorsed/*.jar,
${catalina.home}/common/lib/*.jar后加上
,${catalina.home}/common/lib/ext/*.jar(目的是让tomcat能够自动读${catalina.home}/common/lib/ext 目录下的文件) 6.确认数据库是正常运行的,如果数据库安装在另一机器上确保可以使用.
7.设置数据库,使Tomcat的 JDBC可以可以使用数据库,数据库使用 Mysql,从对应的 bundleTomcat复制Mysql.jar,mail.jar,jta.jar到TOMCAT_HOME/common/lib/ext.
8.按如下方式编辑 $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml 内容: 在<Context path="">与</Context>间插入
<Resource name="jdbc/LiferayPool" auth="Container" type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8" username="" password="" maxActive="100" maxIdle="30" maxWait="10000" />
9.确认输入的数据库名字是否存在,若不存在需建立此数据库。确认用户名和密码是否正确,是否与数据库相符合。
10.创建一个邮箱的期限. 编辑 $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml 内容如下:
<Context...> <Resource name="mail/MailSession" auth="Container" type="javax.mail.Session" mail.transport.protocol="smtp" mail.smtp.host="localhost" mail.store.protocol="imap" mail.imap.host="localhost" /> </Context>
11.设置 JAAS 编辑 $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml 内容如下:
<Context...> <Realm className="org.apache.catalina.realm.JAASRealm" appName="PortalRealm" userClassNames="com.liferay.portal.security.jaas.PortalPrincipal" roleClassNames="com.liferay.portal.security.jaas.PortalRole" debug="99" useContextClassLoader="false" /> </Context>
12.创建 $TOMCAT_HOME/conf/jaas.config 内容如下:
PortalRealm { com.liferay.portal.kernel.security.jaas.PortalLoginModule required;
};13.按如下方式编辑 $TOMCAT_HOME/bin/catalina.bat(在Windows) 或者 $TOMCAT_HOME/bin/catalina.sh (在 Linux/Mac/Unix): 在文件中寻找: "set JAVA_OPTS=%JAVA_OPTS% ...". 紧接其后插入
-Xms128m -Xmx1024m -XX:MaxPermSize=128m".
14.删除 $TOMCAT_HOME/webapps/ROOT 目录下的内容。
15.解压 Liferay-portal-x.x.x.war 到 $TOMCAT_HOME/webapps/ROOT.
16.为了支持 UTF-8 的编译,编辑 $TOMCAT_HOME/conf/server.xml 内容如下在代码:
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true"
加入:
URIEncoding="UTF-8"
17.启动 Tomcat 运行浏览器键入 http://localhost:8080 你将会看到 Liferay的初始页面。