分享

uPortal的安装配置

 binke 2006-11-09

uPortal 何许人也,当然它是一个开源的Portal产品,那么在众多的Portal中为什么它能吸引我的眼球呢?原来在近期研究CAS的过程中发现了它。uPortal的单点登录部分采用了CAS的Proxy架构,而且它也是一个由美国众高校开发研制和维护的产品,本文简述了uPortal的安装与配置过程。对其的深入研究还需一定时日。

uPortal is a free, sharable portal under development by institutions of higher-education. This group sees an institutional portal as an abridged and customized version of the institutional Web presence... a "pocket-sized" version of the campus Web. Portal technology adds "customization" and "community" to the campus Web presence. Customization allows each user to define a unique and personal view of the campus Web. Community tools, such as chat, forums, survey, and so on, build relationships among campus constituencies.

uPortal is an open-standard effort using Java, XML, JSP and J2EE. It is a collaborative development project with the effort shared among several of the JA-SIG member institutions. You may download uPortal and use it on your site at no cost.

uPortal的发行版有两种,Quick Start版和Only uPortal版,顾名思义,前者是一个包含了Servlet容器在内的可直接运行的程序,而后者则需要进行编译和部署到现有的Web容器中,这里我当然用的是后者(前者实在太无聊了)。需要使用ant对其源码进行编译。具体步骤如下:

uPortal Only Distribution

What is included?

The uPortal-only distribution is downloaded as a zip file which extracts to directory called uPortal_rel-2-4-2.zip . The directory contains the following...

  • docs - directory containing documentation about uPortal.
  • src - directory hierarchy containing the source code for uPortal.
  • lib - directory containing necessary jar files for the Java API‘s used by uPortal.
  • webpages - hierarchy which contains stylesheets, image files, java servlet pages, and other necessary files for uPortal.
  • properties - directory which contains properties and configuration files used by uPortal.

...and the following files

  • build.xml - build file for use by Ant.
  • build.properies - properties file for use by Ant.

What do you need to know?

Use of this distribution requires knowledge of J2EE environments and the Ant tool from the Apache Jakarta project.

Requirements

  • The Java Development Kit (JDK) version 1.3 or higher must be installed.
  • JAVA_HOME environment variable must be set.
  • The Jakarta-Ant build tool (version 1.5.3 or later).
  • A web application environment such as Tomcat or IBM Websphere
  • An SQL database such as HypersonicSQL, Oracle, or PostgreSQL

Setting up a Web Application Environment

The uPortal web application requires a web application enviroment such as Tomcat or IBM Webshere . If you already have a web application environment installed on a server, the uPortal context can just be deployed to that environment, otherwise you will have to install one. The build files for uPortal have been set up such that it can be easily deployed into Tomcat. The Jakarta-Tomcat servlet container can be downloaded from: http://jakarta./tomcat/index.html . Version 4.1.24 is recommended.

Compiling and Deploying uPortal

Compiling and deploying uPortal is managed using the Jakarta Ant build environment. It is highly recommended that anyone implementing uPortal or developing channels become familiar with the Ant build tool. Documentation for Ant is available at Jakarta-Ant web site

For detailed instructions on how to compile and deploy uPortal go to the documentation page at:

Building uPortal.

Building and Deploying uPortal

Overview

Compiling and deploying uPortal is managed using the Ant build tool. Ant uses a file called build.xml for managing what is compiled and copies all necessary files into the uPortal context. The uPortal context can then be deployed as a complete web application running in a servlet container such as Tomcat or IBM Websphere. The build.xml file uses several properties defined in a file called build.properties. Both of these files can be found in the uPortal_rel-2-1-3 directory.

Obtaining the Ant build tool

If using the uPortal-only release you will need to download the Ant build tool. It is available from http://jakarta./ant. Once the archive is downloaded, uncompress it and update the operating system environment such that it is available form the standard search path. It is recommended that an ANT_HOME environment be set, and ANT_HOME/bin added to the PATH environment variable.

Obtaining external dependency libraries

If using the uPortal-only release you will have to obtain all of the necessary external dependency libraries before attempting to compile uPortal.

  1. First create a directory for downloading the necessary packages, for example /usr/local/java (unix) or C:\usr\local\java (Windows).
  2. Refer to the build.xml for a complete list of all packages you will need to obtain. Look for the comment section labeled "External Dependencies".
  3. Download each of the packages from the location specifed. For example, the xalan jar files are available from http://xml./xalan-j. It is recommended that the required version specified in the build.xml file be downloaded.
  4. Each package typically contains jar files, documentation, and other related files in an compressed archive (zip, gzipped tar file). Uncompress each of the packages into the download directory. Most of the packages will created a subdirectory for the package with lib, doc, and other directories within that directory.
  5. Edit the build.properties file and change the property values to point to the location of all the required jar files.

    For example, change:

    xalan.jar=./lib/xalan.jar
    to
    xalan.jar=/usr/local/java/xalan-j_2_4_0/bin/xalan.jar

  6. Note that there are some additional properties in build.properties which may be modified. Leave them alone for now. Typically you should not need to modify the build.xml file at all.
Compiling uPortal

Now your ready to compile uPortal. Go to the uPortal_rel-2-1-3 directory and just type ant. Ant will first create a build directory, then invoke the java compiler and store all of the compiled class files into build/WEB-INF/classes. It will also copy many other files into the build directory including stylesheet files, images, and property files. If everything worked you should see a message which reads:

BUILD SUCCESSFUL

If something went wrong, it is most likely due to Ant being unable to find one or more of the external dependencies. Check the build.properties file and try again.

Deploying uPortal

The Ant build tool also manages the deployment of the uPortal application into a servlet container. It will copy everything that it compiled and stored in the build directory into a directory specified in the build.properties files as deploy.home.

If using the uPortal-only release you will first need to obtain a servlet container. The Tomcat servlet container is recommended. Tomcat can be downloaded from http://jakarta./tomcat. Uncompress the archive file to a location where the web application server will run. For example, on Unix, extracting the Tomcat version 4.1.24 zip file into the /usr/local directory will create a directory called /usr/local/jakarta-tomcat-4.1.24 which is usually refered to with an environment variable called TOMCAT_HOME.

Before deploying uPortal you may need to modify the build.properties. Edit the file and find the deploy.home property. Change the value such that it points to the location where uPortal will be deployed. For a Tomcat servlet container that would typically be $TOMCAT_HOME/webapps/{app.name}, for example:

deploy.home=/usr/local/jakarta-tomcat-4.0.4/webapps/uPortal

Note: if you are working with the quick-start release, the deployment directory is relative to the uPortal_rel-2-1-3 directory (../tomcat-4.1.24/webapps/uPortal) and should not be changed.

Now you‘re ready to deploy uPortal to the servlet container. Simply type "ant deploy" to invoke the "deploy" target. If everything worked correctly you will see a BUILD SUCCESSFULL message.

Setting up A Database

The uPortal system can be deployed such that a database from several different vendors may be used. Installation and configuration information about databases can be found in the:

Database Installation and Configuration Document

Setting up A Oracle Database

About Oracle

Oracle is a commercial database available from http://www.oracle.com

Obtaining the Driver

A Oracle JDBC driver is also available through http://www.oracle.com. Versions for Oracle 8i and Oracle 9i are available. The driver downloads as a single "zip" file (for example, classes12.zip). The file should be stored in a directory where it will be accessible from the uPortal build environment (for example /usr/local/java/oracle/lib/classes12.zip)

See Issues section about possible issues using this driver.

Properties Configuration

The uPortal build.properties will need to be modifed. Find the property called jdbcDriver and change it to point to the Oracle zip/jar file, for example:

jdbcDriver.jar=/usr/local/java/lib/classes12.zip

The uPortal rdbm.properties file (in the properties directory) will need to modified to specify the driver properties. First, comment out the property definitions which are currently defined (most likely, for HypersonicSQL). The rdbm.properties file contains several sample entries. Uncomment the lines for the Oracle database and make whatever changes necessary to match your local database installation, For example:

##### Oracle - example
jdbcDriver=oracle.jdbc.driver.OracleDriver
jdbcUrl=jdbc:oracle:thin:@localhost:1521:uportal
jdbcUser=test
jdbcPassword=mypass

The dbloader.xml properties file (also in the properties directory) may also need to be modified. This file is used by the DbLoader tool to create the uPortal database tables and populate the database. It contains several sample entries which create db-type-mappings for different databases. Find the tags for an Oracle database and modify the db-version, driver-name, and driver-version as necessary. For example:

<db-type-mapping>
  <db-name>Oracle</db-name>
  <!-- Line break has to be here -->
  <db-version>Oracle8 Enterprise Edition Release 8.0.6.2.0 - Production
  PL/SQL Release 8.0.6.2.0 - Production</db-version>
  <driver-name>Oracle JDBC driver</driver-name>
  <driver-version>8.1.6.0.0</driver-version>
  <type><generic>TIMESTAMP</generic><local>DATE</local></type>
  <!-- map more types here -->
</db-type-mapping>

The PersonDirs.xml file (also in the properties directory) may need to be modified; This file is used if the database is to be used to provide user directory information.

<!-- JDBC Properties -->
<driver>oracle.jdbc.driver.OracleDriver</driver>
<url>jdbc:oracle:thin:@localhost:1521:uportal</url>
<logonid>test</logonid>
<logonpassword>mypass</logonpassword>,
<uidquery>SELECT FIRST_NAME||‘ ‘||LAST_NAME AS FIRST_LAST,
FIRST_NAME, LAST_NAME, EMAIL FROM UP_PERSON_DIR WHERE USER_NAME=?></uidquery>
Loading the Database

Loading the database requires a couple of steps

  • Create the database: Refer to the Oracle database documentation for instructions regarding how to create an Oracle database instances. The database name (or in this case, the Oracle SID), port number, and driver information must reflect what was defined in the rdbm.properties file
  • Create the tables and populate the database: From the uPortal build directory, run "ant db" to execute the ant target which loads the database. The ant target uses the Dbloader tool.

Complete the Installation

Once you have compiled and deployed uPortal and setup a database for it to utilize, you still need to publish the channel fragments and internationalize the database. This can be done in one step by issuing the `ant initportal` command. Once this command completes without errors, your uPortal instance should be fully functional.



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=318520

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多