uPortal4.1.0安装部署

来源:互联网 发布:ip mac 扫描工具 编辑:程序博客网 时间:2024/05/20 08:22

uPortal4.1.0安装部署

 

常见问题

1. Linux 下目录的访问权限问题

   1.1 用正确的帐号登录,以及用正确的帐号上传文件

   1.2 尽量上传压缩的文件,不要从别的机器上复制已经解压缩的文件夹

    1.3 压缩文件上传后,再解压

一 、软件要求

Jdk:jdk7最好,jdk8支持情况待验证,jdk6不支持。

Maven:3.0.3及以上

Ant: 1.8.2及以上

Container: Tomcat7及以上、jetty7及以上

DataBaseDB2HypersonicSQLMS SQL Server and MS JDBC DriverMySQLOraclePostgreSQLSybase SQL ServerJNDI managed DataSources

二、环境变量

1、HOME配置

exportJAVA_HOME=/path/to/java/jdk1.x

export M2_HOME=/path/to/apache-maven/apache-maven-3.0.x

exportANT_HOME=/path/to/apache-ant-1.8.2

2、PATH配置

export PATH=$JAVA_HOME/bin:$PATH:$M2_HOME/bin$PATH:$ANT_HOME/bin

 

3、MAVEN内存配置

export MAVEN_OPTS="-Xmx1024M-XX:MaxPermSize=512m"

 

以上参数在windows上的配置略

 

三、配置容器

本文以Tomcat7为例:

1、配置HOME

exportTOMCAT_HOME=/path/to/your/tomcatlinux

CATALINA_HOME :C:\apache-tomcat-7.xwindows

2、共享lib

修改CATALINA_BASE/conf/catalina.properties文件

<!-- In older versions prior to uPortal 4.0.10-->

shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar

 

<!-- In uPortal 4.0.10+, shared/classes is NOT necessary:->

shared.loader=${catalina.base}/shared/lib/*.jar

 

3、共享sessions

uPortal要想支持JSR168或者JSR268的标准的portlets之间的session共享,需要在CATALINA_BASE/conf/context.xml文件中加入:

<Context sessionCookiePath="/">

 

修改server.xml文件:

<Connector port="8080"protocol="HTTP/1.1"

    connectionTimeout="20000"redirectPort="8443"emptySessionPath="true"/>

 

4、tomcat内存配置

uPortal requires a larger than standardPermGen space and more heap than may be allocated by default,在tomcatbin目录下加入一下文件:

setenv.sh orsetenv.bat

JAVA_OPTS="$JAVA_OPTS -XX:+PrintCommandLineFlags -XX:MaxPermSize=384m -Xms1024m -Xmx1024m -Djsse.enableSNIExtension=false"

 

5、GZipping HTML(可选)

浏览器端性能可能会略有改善GZip-ping在适当的地方下载的内容。uPortal 4已经GZipsCSSJavaScript。然而,uPortal并不GZipuPortal页面本身。GZipping可以通过执行TomcatHTML内容。要启用该功能,设置压缩=””好了Tomcat连接器,并设置compressable mime类型的列表。有关此功能的更多信息可以在Tomcat配置页面。

修改server.xml文件:

<Connectorport="8080"protocol="HTTP/1.1"

    connectionTimeout="20000"redirectPort="8443"

    compression="on"compressableMimeType="text/html,text/xml,text/plain"/>

 

四、下载uPortal

从官网下载uPortal的安装包,URLhttp://www.jasig.org/uportal/

 

五、配置uPortal

1、修改build.properties文件

uPortal的根目录下的用的内容覆盖的内容。

并找到server.home修改为本地的tomcat的根目录,如下图:

2、配置filters

uPortal的根目录下进入filters目录,主要修改local.properties文件,该文件可以配置uPortal的数据库连接、uPortal的服务配置、CAS服务的配置、日志信息以及LDAP的配置,代码如下:

## HSQL Configuration

environment.build.hsql.port=8887

 

 

## Database Connection Settings (Uncomment the Maven Filterssection in rdbm.properties)

environment.build.hibernate.connection.driver_class=org.hsqldb.jdbc.JDBCDriver

environment.build.hibernate.connection.url=jdbc:hsqldb:hsql://localhost:${environment.build.hsql.port}/uPortal

environment.build.hibernate.connection.username=sa

environment.build.hibernate.connection.password=

environment.build.hibernate.dialect=org.hibernate.dialect.HSQLDialect

  

# uPortal server configuration properties

environment.build.uportal.server=localhost:8080

environment.build.uportal.protocol=http

environment.build.uportal.context=/uPortal

environment.build.uportal.email.fromAddress=portal@university.edu

 

 

# CAS server configuration properties

environment.build.cas.server=localhost:8080

environment.build.cas.protocol=http

 

 

# Log4J values applied to portlets and portals.  Seelog4j.properties file

# in WEB-INF or resources directory foreachportlet. This provides a

# single point of control formostlogging.

 

 

environment.build.log.rootLevel=INFO

# Directory to place portal and portlet log files into.

environment.build.log.logfileDirectory=${catalina.base}/logs

# Assume a DailyRollingFileAppender is used. Set the pattern todaily log-file roll-overs.

# Can also set to hourly, weekly, etc.  Use yyyy-MM-dd-HHforhourly.

# Seehttp://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html

environment.build.log.rollingLogFileDatePattern=yyyy-MM-dd

# Pattern to specify format of each log file entry.  Seehttp://logging.apache.org/log4j/1.2/apidocs/index.html.

environment.build.log.layoutConversionPattern=%5p [%t]%c{2}.[%x] %d{ISO8601} - %m%n

environment.build.logback.layoutConversionPattern=%-5level[%thread] %logger{36} %d{ISO8601} - %msg%n

 

 

# LDAP server connection settings (optional)

# To connect to LDAP, provide your connection information hereand uncomment one

# or both integration beans inuportal-war/src/main/resources/properties/contexts/ldapContext.xml

environment.build.ldap.url=

environment.build.ldap.baseDn=

environment.build.ldap.userName=

environment.build.ldap.password=

 

3、发布uPortal

uPortal的根目录(uPortal-4.1.0-quick-start\uPortal-4.1.0)下面执行以下命令:

ant initportal

 

运行最后(这个过程大约需要830分钟不等)出现“BuildSuccessfully”则表示发布成功。

 

4、访问uPortal

在第三步执行成功之后,重启tomcat,访问http://localhost:8080/uPortal/

会出现下图:

 

六、修改数据库

第一步: 配置数据库     

    1. 在filter目录,找到 local.properties, 即uPortal-4.1.x/filters/local.properties,然后配置数据

uPortal/filters/local.properties

# HSQL Configuration

environment.build.hsql.port=8887

 

# Database Connection Settings (Uncomment the Maven Filters section in rdbm.properties)

environment.build.hibernate.connection.driver_class=org.postgresql.Driver

environment.build.hibernate.connection.url=jdbc:postgresql://my.school.edu/uPortal

environment.build.hibernate.connection.username=user

environment.build.hibernate.connection.password=password

environment.build.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect

environment.build.hibernate.connection.validationQuery=select 

第二部: 增加数据库驱动

1.                               打开 uportal-db/pom.xml 这个文件,添加(取消comment即可)postgresql 依赖

2.                               注意,一定要在 uPortal源码下的 pom.xml中添加postgresql依赖的版本参数

 

uportal-db/pom.xml

 

<dependencies>

        <!-- Add any db drivers that are applicable to *any* of your environments -->

        <dependency>

            <groupId>org.hsqldb</groupId>

            <artifactId>hsqldb</artifactId>

            <version>${hsqldb.version}</version>

            <scope>compile</scope>

        </dependency>

        <!--

         | The following db drivers should be uncommented and/or modified as needed for server

         | deployments.  (Add all thaat are needed.)  Don't forget to add appropriate  .version

         | properties to the root pom.xml, or simply enter the appropriate version below.

         +-->

         

        <dependency>

            <groupId>postgresql</groupId>

            <artifactId>postgresql</artifactId>

            <version>${postgres.version}</version>

            <scope>compile</scope>

        </dependency>

 

        <!--

        <dependency>

            <groupId>com.ibm.db2</groupId>

            <artifactId>db2-jdbc</artifactId>

            <version>${db2.version}</version>

            <scope>compile</scope>

        </dependency>

        <dependency>

            <groupId>com.microsoft.sqlserver</groupId>

            <artifactId>sqljdbc4</artifactId>

            <version>${mssql.version}</version>

        </dependency>

        <dependency>

            <groupId>mysql</groupId>

            <artifactId>mysql-connector-java</artifactId>

            <version>${mysql.version}</version>

        </dependency>

        <dependency>

            <groupId>com.oracle</groupId>

            <artifactId>ojdbc6_g</artifactId>

            <version>${oracle.version}</version>

        </dependency>

        <dependency>

            <groupId>org.sybase</groupId>

            <artifactId>sybase-jconnect</artifactId>

            <version>${sybase.version}</version>

        </dependency>

        -->

    </dependencies>

uportal源码/pom.xml

       <hibernate.version>4.1.9.Final</hibernate.version>

       <hibernate-jpamodelgen.version>1.2.0.Final</hibernate-jpamodelgen.version>

       <hibernate-jpa-api.version>1.0.1.Final</hibernate-jpa-api.version>

       <hsqldb.version>2.3.2</hsqldb.version>

      <postgres.version>9.1-901.jdbc4</postgres.version>

       <icu4j.version>53.1</icu4j.version>

       <jackson2.version>2.3.3</jackson2.version>

 

然后在uPortal源码目录下,运行以下命令,进行项目编译和数据库的测试

ant dbtest -Dmaven.test.skip=true

在编译的时候,部分portlet会因为jar下载失败而编译失败,这些portlet可以取消编译,方法如下:

注意 CAS 是必须的

修改 \uportal-portlets-overlay\pom.xml

<modules>

       <module>AnnouncementsPortlet</module>

       <module>basiclti-portlet</module>

       <module>BookmarksPortlet</module>

       <!--<module>CalendarPortlet</module>-->

       <module>cas</module>

       <module>cas-proxy-test-portlet</module>

       <!--<module>email-preview</module>-->

       <module>FunctionalTestsPortlet</module>

       <module>jasig-widget-portlets</module>

       <module>pluto-testsuite</module>

                           

       <!--<module>NewsReaderPortlet</module>

       <module>NotificationPortlet</module>-->

      <module>sakai-connector-portlet</module>

       <module>SimpleContentPortlet</module>

                           

        <!--<module>WeatherPortlet</module>-->

       <!--<module>WebProxyPortlet</module>-->

   </modules>

 

 

由于,这些portlet又是uportal-ear项目的依赖项,因此,需要在 uportal-ear\pom.xml中注释掉这些依赖

<!--

       <dependency>

           <groupId>org.jasig.portal.portlets-overlay</groupId>

           <artifactId>BookmarksPortlet</artifactId>

           <version>${project.version}</version>

           <type>war</type>

       </dependency>

                                   

       <dependency>

            <groupId>org.jasig.portal.portlets-overlay</groupId>

           <artifactId>CalendarPortlet</artifactId>

           <version>${project.version}</version>

           <type>war</type>

       </dependency>

-->

 

 

 

 

然后在uPortal源码目录下,运行以下命令,进行项目编译和数据库的初始化

ant cleaninitportal -Dmaven.test.skip=true

 

然后,启动Tomcat;

0 0
原创粉丝点击