Pages enfant
  • Installer uP4 rapidement

Récupération GIT

Pour linux

installer le client GIT selon la plateforme puis

git clone https://github.com/Jasig/uPortal.git
cd uPortal/
git checkout uportal-4.0.3

Pour windows

Installer "msysgit" http://code.google.com/p/msysgit/ et "tortoisegit" pour avoir une interface graphique http://code.google.com/p/tortoisegit/

Bouton droit dans un dossier > "Git Clone"

Url :Https://github.com/Jasig/uPortal.git

Dans le dossier uPortal fraichement créé > bouton droit > "tortoiseGIT" > "Switch/Checkout"

Cocher Tags > chosir le TAG "uportal-4.0.3"

déchocher  "Create New Branch"

Configurations

Properties

/build.properties

copier le build.sample.properties vers build.properties
Adapter uniquement le server.home avec le chemin du tomcat

server.home=E:/esup4/apache-tomcat-6.0.35

/filters/local.properties

environment.build.hsql.port=

## Database Connection Settings (Uncomment the Maven Filters section in rdbm.properties)
environment.build.hibernate.connection.driver_class=com.mysql.jdbc.Driver
environment.build.hibernate.connection.url=jdbc:mysql://mysq.univ.fr:3306/uPortal4
environment.build.hibernate.connection.username=uportal4
environment.build.hibernate.connection.password=PASSWORD_UP4
environment.build.hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
 
# uPortal server configuration properties
environment.build.uportal.server=up4.univ.fr
environment.build.uportal.protocol=https
environment.build.uportal.context=/uPortal
environment.build.uportal.email.fromAddress=portal4@univ.fr

# CAS server configuration properties
environment.build.cas.server=cas.univ.fr
environment.build.cas.protocol=https
environment.build.cas.context=/

Mysql

/pom.xml (drivers mysql)  (cf. https://wiki.jasig.org/display/UPM40/MySQL )

diff --git a/pom.xml b/pom.xml
index 1fa6d03..c86e320 100755
--- a/pom.xml
+++ b/pom.xml
@@ -84,9 +84,9 @@
         <project-site-path>/uportal/${project.version}</project-site-path>
         
         <!-- The JDBC Driver used by uPortal -->
-        <jdbc.groupId>org.hsqldb</jdbc.groupId>
-        <jdbc.artifactId>hsqldb</jdbc.artifactId>
-        <jdbc.version>${hsqldb.version}</jdbc.version>
+        <jdbc.groupId>mysql</jdbc.groupId>
+        <jdbc.artifactId>mysql-connector-java</jdbc.artifactId>
+        <jdbc.version>5.1.6</jdbc.version>
     
         <!--
          | Environment name and filters file for environment-specific build
@@ -337,6 +337,11 @@
                 <version>${hsqldb.version}</version>
             </dependency>
             <dependency>
+                <groupId>mysql</groupId>
+                <artifactId>mysql-connector-java</artifactId>
+                <version>5.1.6</version>
+            </dependency>
+            <dependency>
                 <groupId>org.hsqldb</groupId>
                 <artifactId>sqltool</artifactId>
                 <version>${hsqldb.version}</version>

Langues et Nombre de Threads Mysql

/uportal-war/src/main/resources/properties/portal.properties (passage en français par défaut et pb au chargement de la base)

( Pour Mysql; cf. https://wiki.jasig.org/display/UPM40/MySQL )

diff --git a/uportal-war/src/main/resources/properties/portal.properties b/uportal-war/src/main/resources/properties/portal.properties
index 8392f38..b610113 100644
--- a/uportal-war/src/main/resources/properties/portal.properties
+++ b/uportal-war/src/main/resources/properties/portal.properties
@@ -206,7 +206,7 @@ org.jasig.portal.UserPreferencesManager.save_UserPreferences_at_logout=false
 # underscore character.
 #
 org.jasig.portal.i18n.LocaleManager.locale_aware=true
-org.jasig.portal.i18n.LocaleManager.portal_locales=en_US,fr_FR,es_ES,ja_JP,sv_SE,de_DE,mk_MK,lv_LV
+org.jasig.portal.i18n.LocaleManager.portal_locales=fr_FR,en_US,es_ES,ja_JP,sv_SE,de_DE,mk_MK,lv_LV
 
 
 # The number of recent PortalExceptions ProblemsTable should cache
@@ -274,7 +274,7 @@ org.jasig.portal.version=${project.version}
 # Import/Export Thread Pool Configuration
 #
 org.jasig.portal.io.threadPool.initialThreads=0
-org.jasig.portal.io.threadPool.maxThreads=20
+org.jasig.portal.io.threadPool.maxThreads=1
 org.jasig.portal.io.threadPool.queueSize=500
 org.jasig.portal.io.threadPool.threadPriority=5
 org.jasig.portal.io.threadPool.keepAliveSeconds=30

CAS

uportal-war/src/main/resources/properties/security.properties (logout cas avec redirect + ajout d'une variable qui représente le contexte du serveur CAS)

diff --git a/uportal-war/src/main/resources/properties/security.properties b/uportal-war/src/main/resources/properties/security.properties
index 2de19c9..cb67036 100644
--- a/uportal-war/src/main/resources/properties/security.properties
+++ b/uportal-war/src/main/resources/properties/security.properties
@@ -48,17 +48,17 @@ credentialToken.root.cas=ticket
 ## (See comments in the LogoutServlet class)
 ## It would be better to escape the value of the url parameter, but since there are no parameters on the
 ## unescaped URL and since there are no further parameters on the logout URL, this does work.
-logoutRedirect.root=${environment.build.cas.protocol}://${environment.build.cas.server}/cas/logout?url=${environment.build.uportal.protocol}://${environment.build.uportal.server}${environment.build.uportal.context}/Login
+logoutRedirect.root=${environment.build.cas.protocol}://${environment.build.cas.server}${environment.build.cas.context}/logout?service=${environment.build.uportal.protocol}://${environment.build.uportal.server}${environment.build.uportal.context}/Login
 
 ## This is the factory that supplies the concrete authorization class
 authorizationProvider=org.jasig.portal.security.provider.AuthorizationServiceFactoryImpl
 
 ## Login URL, if specified the CLogin channel will display a Login link with
 ## this URL instead of the standard userName/password form.
-org.jasig.portal.channels.CLogin.CasLoginUrl=${environment.build.cas.protocol}://${environment.build.cas.server}/cas/login?service=${environment.build.uportal.protocol}://${environment.build.uportal.server}${environment.build.uportal.context}/Login
+org.jasig.portal.channels.CLogin.CasLoginUrl=${environment.build.cas.protocol}://${environment.build.cas.server}${environment.build.cas.context}/login?service=${environment.build.uportal.protocol}://${environment.build.uportal.server}${environment.build.uportal.context}/Login
 
 ## URL of the CAS cleartext password service
-#org.jasig.cas3.extensions.clearpass.integration.uportal.PasswordCachingCasAssertionSecurityContextFactory.clearPassCasUrl=${environment.build.cas.protocol}://${environment.build.cas.server}/cas/clearPass
+#org.jasig.cas3.extensions.clearpass.integration.uportal.PasswordCachingCasAssertionSecurityContextFactory.clearPassCasUrl=${environment.build.cas.protocol}://${environment.build.cas.server}${environment.build.cas.context}/clearPass

uportal-war/src/main/webapp/WEB-INF/web.xml (ajout d'une variable qui représente le contexte du serveur CAS)

diff --git a/uportal-war/src/main/webapp/WEB-INF/web.xml b/uportal-war/src/main/webapp/WEB-INF/web.xml
index 96ec7c0..5c46989 100644
--- a/uportal-war/src/main/webapp/WEB-INF/web.xml
+++ b/uportal-war/src/main/webapp/WEB-INF/web.xml
@@ -118,7 +118,7 @@
         <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
         <init-param>
           <param-name>casServerUrlPrefix</param-name>
-          <param-value>${environment.build.cas.protocol}://${environment.build.cas.server}/cas</param-value>
+          <param-value>${environment.build.cas.protocol}://${environment.build.cas.server}${environment.build.cas.context}</param-value>
         </init-param>
         <init-param>
           <param-name>serverName</param-name>

LDAP

on utilise des variable d'environnement pour le ldap (esup.ldap.url, esup.ldap.baseDN, ...)
uportal-war/src/main/resources/properties/contexts/ldapContext.xml

diff --git a/uportal-war/src/main/resources/properties/contexts/ldapContext.xml b/uportal-war/src/main/resources/properties/contexts/ldapContext.xml
index 5e7d32a..ceedd74 100644
--- a/uportal-war/src/main/resources/properties/contexts/ldapContext.xml
+++ b/uportal-war/src/main/resources/properties/contexts/ldapContext.xml
@@ -68,4 +68,11 @@
         <property name="pooled" value="false"/>
     </bean>
     -->
+    <bean id="defaultLdapContext">
+        <property name="url" value="${esup.ldap.url}"/>
+        <property name="base" value="${esup.ldap.baseDN}"/>
+        <property name="userName" value="${esup.ldap.bindDN}"/>
+        <property name="password" value="${esup.ldap.bindPasswd}"/>
+        <property name="pooled" value="${esup.ldap.pooled}"/>
+    </bean>
 </beans>

uportal-war/src/main/resources/properties/contexts/personDirectoryContext.xml

diff --git a/uportal-war/src/main/resources/properties/contexts/personDirectoryContext.xml b/uportal-war/src/main/resources/properties/contexts/personDirectoryContext.xml
index 6e69675..1832d85 100644
--- a/uportal-war/src/main/resources/properties/contexts/personDirectoryContext.xml
+++ b/uportal-war/src/main/resources/properties/contexts/personDirectoryContext.xml
@@ -137,10 +137,51 @@
                 -->
                 <ref bean="uPortalAccountUserSource" />
                 <ref bean="uPortalJdbcUserSource" />
+                <ref bean="uPortalLdapAttributeSource"/>
             </list>
         </property>
     </bean>
 
+    <bean id="uPortalLdapAttributeSource">
+        <property name="contextSource" ref="defaultLdapContext" />
+                <property name="baseDN" value="${esup.ldap.baseDN}" />
+                <property name="queryAttributeMapping">
+                    <map>
+                        <entry key="username" value="uid"/>
+                    </map>
+                </property>
+
+                <property name="resultAttributeMapping">
+                    <map>
+                        <entry key="eduPersonPrimaryAffiliation">    <value>eduPersonPrimaryAffiliation</value></entry>                
+                        <entry key="eduPersonAffiliation">            <value>eduPersonAffiliation</value></entry>                
+                        <entry key="cn">                            <value>cn</value></entry>
+                        <entry key="description">                   <value>description</value></entry>
+                        <entry key="displayName">                   <value>displayName</value></entry>
+                        <entry key="facsimileTelephoneNumber">      <value>facsimileTelephoneNumber</value></entry>
+                        <entry key="givenName">                     <value>givenName</value></entry>
+                        <entry key="mail">                          <value>mail</value></entry>
+                        <entry key="postalAddress">                 <value>postalAddress</value></entry>
+                        <entry key="sn">                            <value>sn</value></entry>
+                        <entry key="telephoneNumber">               <value>telephoneNumber</value></entry>
+                        <entry key="uid">                              
+                            <set>
+                                <value>uid</value>
+                                <value>username</value>
+                                <value>user.login.id</value>
+                            </set>
+                        </entry>
+                        <entry key="supannCodeINE">                 <value>supannCodeINE</value></entry>
+                        <entry key="supannEtuId">                   <value>supannEtuId</value></entry>
+                        <entry key="supannEmpId">                   <value>supannEmpId</value></entry>
+                        <entry key="eduPersonAffiliation">          <value>eduPersonAffiliation</value></entry>
+                        <entry key="supannaffectation">             <value>supannaffectation</value></entry>
+                        <entry key="objectclass">                   <value>objectclass</value></entry>
+                        <entry key="supannorganisme">               <value>supannorganisme</value></entry>
+                    </map>
+                </property>
+    </bean>
+    
     <bean id="uPortalAccountUserSource">
         <property name="localAccountDao" ref="localAccountDao"/>
         <property name="usernameAttributeProvider" ref="usernameAttributeProvider" />

Déploiement

Installer Ant 1.8.X, Maven 3.0.X, Tomcat 6.0.X

Coté tomcat installer un tomcat de base, le laisser en autoDeploy="true"

Premier déploiement :

ant  -Dmaven.test.skip=true initportal

Pour déployer les modifications par la suite

ant  -Dmaven.test.skip=true clean deploy-war

env.cmd : script d'exemple qui positionne les variables d'environnement qui vont bien (pour windows désolé)

SET JAVA_HOME=D:/jdk1.6.0_30

SET ANT_HOME=E:/esup4/apache-ant-1.8.2
SET M2_HOME=E:/esup4/apache-maven-3.0.4
SET TOMCAT_HOME=E:/esup4/apache-tomcat-6.0.35
SET TRUST_CERT=E:/esup4/esup-portail.keystore

SET M2=%M2_HOME%/bin

SET CATALINA_HOME=%TOMCAT_HOME%
SET CATALINA_BASE=%CATALINA_HOME%
SET CATALINA_TMPDIR=%CATALINA_HOME%/temp
SET CATALINA_OPTS=-Djavax.net.ssl.trustStore="%TRUST_CERT%"
SET CATALINA_PID=%ATALINA_TMPDIR%/uportal.pid

SET PATH=%M2%;%ANT_HOME%/bin;%JAVA_HOME%/bin;%PATH%;

SET JAVA_OPTS=-server
SET JAVA_OPTS=%JAVA_OPTS% -XX:MaxPermSize=512m  -XX:PermSize=300m
SET JAVA_OPTS=%JAVA_OPTS% -Xms1024m -Xmx1520m
SET JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote

SET JAVA_OPTS=%JAVA_OPTS% -Desup.ldap.url="ldap://ldap1.univ.fr:389 ldap://ldap2.univ.fr:389"
SET JAVA_OPTS=%JAVA_OPTS% -Desup.ldap.baseDN="ou=people,dc=univ,dc=fr"
SET JAVA_OPTS=%JAVA_OPTS% -Desup.ldap.pooled=false
SET JAVA_OPTS=%JAVA_OPTS% -Desup.ldap.bindDN=""
SET JAVA_OPTS=%JAVA_OPTS% -Desup.ldap.bindPasswd=""

start.cmd : script de démarrage de tomcat

call E:/esup4/env.cmd

DEL /Q "%TOMCAT_HOME%\logs\*.*"
DEL /Q "%TOMCAT_HOME%\work\*.*"
%TOMCAT_HOME%\bin\catalina start
@rem %CATALINA_HOME%\bin\catalina start -security
@rem %CATALINA_HOME%\bin\catalina jpda start

*_+stop.cmd ?:+_* script d'arrêt de tomcat

call E:/esup4/env.cmd

DEL /Q "%LOG_DIR%\*.*"
call %CATALINA_HOME%\bin\shutdown
  • Aucune étiquette