search
HomeDatabaseMysql TutorialLiferay学习笔记(一)Liferay Portal5.2.3环境的初步搭建

Liferay Portal5.2.3 环境的初步搭建 一、 准备工作 1、 开发包 目前 Liferay 官网 http://www.liferay.com/zh/home 上只提供最新版本的 liferay 包下载,下载 5.2.3 版本需要到开源社区 http://sourceforge.net/projects/lportal/files/Liferay%20Portal/

Liferay Portal5.2.3环境的初步搭建

一、  准备工作

1、     开发包

目前Liferay官网http://www.liferay.com/zh/home上只提供最新版本的liferay包下载,下载5.2.3版本需要到开源社区http://sourceforge.net/projects/lportal/files/Liferay%20Portal/,选择5.2.3版本下载下面两个包:

Portal源码包:liferay-portal-src-5.2.3.zip

Tomcat捆绑包:liferay-portal-tomcat-6.0-5.2.3.zip

2、     开发工具

开发工具       建议版本         本文使用版本

JDK          1.6以上             1.6.0_22

Ant           1.7以上             1.8.2

MyEclipse     5.5以上             7.5

Tomcat        6.0以上             6.0.18

注意:这里的Tomcatliferay-portal-tomcat捆绑包中的tomcat,所以不需要再另外下载;Anthttp://ant.apache.org/bindownload.cgi下载最新的apache-ant-1.8.2.bin.zip

3、     目录结构

本文假设操作目录结构如下:

D:/workspace                      根目录

D:/workspace/ant                  ant的安装目录

D:/workspace/Liferay              liferay工作目录

D:/workspace/Liferay/portal       liferay-portal源代码目录

D:/workspace/Liferay/service      liferay-portal捆绑Tomcat的目录

D:/workspace/Liferay/ext          liferay-portal的扩展项目目录

二、  基础配置

1、JDK的安装配置

JDK的安装配置和以前一样,这里不再赘述,提醒一下安装配置完成别忘了使用“java -version”和“javac”来检查是否安装成功

2、Ant的安装配置

   解压缩apache-ant-1.8.2.bin.zipD:/workspace/ant目录下,在环境变量(Windows7下右键点击“计算机”后选择“高级系统设置—>高级—>环境变量”)中为Path系统变量新增如下路径:“D:/workspace/ant/apache-ant-1.8.2/bin;”,保存。

打开dos,输入“ant -version”检查配置是否正确

3、Tomcat的安装配置

解压缩liferay-portal-tomcat-6.0-5.2.3.zipD:/workspace/Liferay/service目录下,在环境变量的Path系统变量中新增如下路径:“D:/workspace/Liferay/service/tomcat-6.0.18/bin;”,保存。

运行tomcatstartup.bat,服务器正常启动说明安装成功

4、MyEclipse的安装配置

这里只说一下MyEclipseTomcat服务器的配置。

MyEclipseTomcat配置为第3步中安装的Tomcat,将Tomcat下的JDK配置为第1步中安装的JDK,并为JDK配置虚拟机参数如下:

-Xmx1024m -XX:MaxPermSize=256m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config="%CATALINA_HOME%/conf/jaas.config" -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false

提示:打开tomcatbin目录下的setenv.bat文件,找到名为JAVA_OPTS的变量,其参数值即为需要copy的虚拟机参数。这个步骤非常重要,否则会导致内存溢出。

三、  建立开发环境

方法一:

1、  部署Liferay源码

liferay-portal-src-5.2.3.zip解压缩到D:/workspace/Liferay/portal目录下

Liferay学习笔记(一)Liferay Portal5.2.3环境的初步搭建

 

2、  新建配置文件release.${username}.properties

找到portal源码中release.properties文件,在同目录下新建release.${username}.properties文件。${username}为本机的用户名,可以在dos下使用set命令查看username的值。我的机器username值为Administrator,故新建release.Administrator.properties文件,文件内容只有一行:

lp.ext.dir=D:/workspace/Liferay/ext

注:lp.ext.dirLiferay指定扩展项目的目录,注意路径中必须使用“/”而不是“/”。

3、  生成扩展目录

运行dos,进入D:/workspace/Liferay/portal目录下,输入“ant clean start build-ext”命令执行,等待ant执行完成(需要310分钟)后,在Liferayext目录下会出现下列文件:

Liferay学习笔记(一)Liferay Portal5.2.3环境的初步搭建

 

4、  新建配置文件app.server.${username}.properties

ext目录下新建app.server.Administrator.properties文件,添加如下内容:

app.server.type=tomcat

app.server.tomcat.dir=D:/workspace/Liferay/service/tomcat-6.0.18

注:app.server.typeLiferay指定服务器类型,app.server.tomcat.dirLiferay指定Tomcat服务器的安装目录。

5、  执行配置

打开dos,进入D:/workspace/Liferay/ext目录下,输入“ant clean deploy”命令执行,等待ant执行完成。

6、  开发环境建立完毕。

 

方法二:

1、  同方法一的步骤1

2、  同方法一的步骤2

3、  在与release.properties文件同目录下新建app.server.Administrator.properties文件,内容和方法一的步骤4文件内容一样。

4、  找到与release.properties文件同目录下的build.xml文件,找到下图中的节点:

Liferay学习笔记(一)Liferay Portal5.2.3环境的初步搭建

 

并在该节点下新增子节点fileset,内容如下:

"." includes="app.server.Administrator.properties"/>

5、同方法一的步骤3,不同的是执行完后生成的ext目录下多了一个名为app.server.Administrator.properties的文件

6、同方法一的步骤5

7、  开发环境建立完毕。

四、  测试开发环境

运行startup.bat启动tomcat服务器,一段时间后会弹出一个登录网页,默认用户名为:test@liferay.com;密码:test;登录即进入Liferay Portal账户,可以对Portlet进行定制。

注:如果修改了后台数据库文件里的用户信息,则需要换一个Admin身份的用户进行登录,具体用户信息请查阅数据库。这里谢谢一楼nwpubin的提醒^_^

五、  环境搭建完成。

 

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What are stored procedures in MySQL?What are stored procedures in MySQL?May 01, 2025 am 12:27 AM

Stored procedures are precompiled SQL statements in MySQL for improving performance and simplifying complex operations. 1. Improve performance: After the first compilation, subsequent calls do not need to be recompiled. 2. Improve security: Restrict data table access through permission control. 3. Simplify complex operations: combine multiple SQL statements to simplify application layer logic.

How does query caching work in MySQL?How does query caching work in MySQL?May 01, 2025 am 12:26 AM

The working principle of MySQL query cache is to store the results of SELECT query, and when the same query is executed again, the cached results are directly returned. 1) Query cache improves database reading performance and finds cached results through hash values. 2) Simple configuration, set query_cache_type and query_cache_size in MySQL configuration file. 3) Use the SQL_NO_CACHE keyword to disable the cache of specific queries. 4) In high-frequency update environments, query cache may cause performance bottlenecks and needs to be optimized for use through monitoring and adjustment of parameters.

What are the advantages of using MySQL over other relational databases?What are the advantages of using MySQL over other relational databases?May 01, 2025 am 12:18 AM

The reasons why MySQL is widely used in various projects include: 1. High performance and scalability, supporting multiple storage engines; 2. Easy to use and maintain, simple configuration and rich tools; 3. Rich ecosystem, attracting a large number of community and third-party tool support; 4. Cross-platform support, suitable for multiple operating systems.

How do you handle database upgrades in MySQL?How do you handle database upgrades in MySQL?Apr 30, 2025 am 12:28 AM

The steps for upgrading MySQL database include: 1. Backup the database, 2. Stop the current MySQL service, 3. Install the new version of MySQL, 4. Start the new version of MySQL service, 5. Recover the database. Compatibility issues are required during the upgrade process, and advanced tools such as PerconaToolkit can be used for testing and optimization.

What are the different backup strategies you can use for MySQL?What are the different backup strategies you can use for MySQL?Apr 30, 2025 am 12:28 AM

MySQL backup policies include logical backup, physical backup, incremental backup, replication-based backup, and cloud backup. 1. Logical backup uses mysqldump to export database structure and data, which is suitable for small databases and version migrations. 2. Physical backups are fast and comprehensive by copying data files, but require database consistency. 3. Incremental backup uses binary logging to record changes, which is suitable for large databases. 4. Replication-based backup reduces the impact on the production system by backing up from the server. 5. Cloud backups such as AmazonRDS provide automation solutions, but costs and control need to be considered. When selecting a policy, database size, downtime tolerance, recovery time, and recovery point goals should be considered.

What is MySQL clustering?What is MySQL clustering?Apr 30, 2025 am 12:28 AM

MySQLclusteringenhancesdatabaserobustnessandscalabilitybydistributingdataacrossmultiplenodes.ItusestheNDBenginefordatareplicationandfaulttolerance,ensuringhighavailability.Setupinvolvesconfiguringmanagement,data,andSQLnodes,withcarefulmonitoringandpe

How do you optimize database schema design for performance in MySQL?How do you optimize database schema design for performance in MySQL?Apr 30, 2025 am 12:27 AM

Optimizing database schema design in MySQL can improve performance through the following steps: 1. Index optimization: Create indexes on common query columns, balancing the overhead of query and inserting updates. 2. Table structure optimization: Reduce data redundancy through normalization or anti-normalization and improve access efficiency. 3. Data type selection: Use appropriate data types, such as INT instead of VARCHAR, to reduce storage space. 4. Partitioning and sub-table: For large data volumes, use partitioning and sub-table to disperse data to improve query and maintenance efficiency.

How can you optimize MySQL performance?How can you optimize MySQL performance?Apr 30, 2025 am 12:26 AM

TooptimizeMySQLperformance,followthesesteps:1)Implementproperindexingtospeedupqueries,2)UseEXPLAINtoanalyzeandoptimizequeryperformance,3)Adjustserverconfigurationsettingslikeinnodb_buffer_pool_sizeandmax_connections,4)Usepartitioningforlargetablestoi

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.