ESUP-CARTE-CULTURE

Arborescence des pages

Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

Sommaire

Pré-requis

Configuration Tomcat

Décompresser un serveur tomcat dans /opt/tomcat-carte-culture

...

Une fois le SP Shibboleth et Apache configurés usuellement (voir : https://services.renater.fr/federation/docs/installation/sp), il faut sécuriser certains répertoires en ajoutant ceci à la conf apache (à adapter cependant en fonction des versions d'Apache et mod_shib) :

...


Bloc de code
languagexml
  ProxyPass /Shibboleth.sso !
  ProxyPass /secure !
  ProxyPass / ajp://localhost:8009/ ttl=10 timeout=3600 loadfactor=100 retry=1

  # Security measure: remove any client-supplied REMOTE_USER header early.                                                                                                                 
  RequestHeader unset REMOTE_USER early

  <Location /secure>
     AuthType shibboleth
     ShibRequestSetting requireSession 1
     require shib-session
     ShibUseHeaders On
   </Location>
   <Location /login>
     AuthType shibboleth
     ShibRequestSetting requireSession 1
     require shib-session
     ShibUseHeaders On
   </Location>
   <Location /partenaire>
     AuthType shibboleth
     ShibRequestSetting requireSession 1
     require shib-session
     ShibUseHeaders On
   </Location>
   <Location /admin>
     AuthType shibboleth
     ShibRequestSetting requireSession 1
     require shib-session
     ShibUseHeaders On
   </Location>
   <Location /etudiant>
     AuthType shibboleth
     ShibRequestSetting requireSession 1
     require shib-session
     ShibUseHeaders On
   </Location>
   <Location /manager>
     AuthType shibboleth
     ShibRequestSetting requireSession 1
     require shib-session
     ShibUseHeaders On
   </Location>
   <Location /ent>
      Deny from All
      Allow from 'ip autorisées'
   </Location>
   <Location /ws>
      Deny from All
      Allow from 'ip autorisées'
   </Location>


Avertissement

Attention, il ne faut pas sécuriser le dossier racine "/" pour laisser l'accès libre à certains web service.

 


Configuration PostgreSQL

  • pg_hba.conf : ajout de

...


Bloc de code
host all all 127.0.0.1/32 password


...

Pensez à paramétrer les espaces mémoire JVM :

...


export JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=256m"
 


Pour maven :

...


export MAVEN_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=256m"
 


Sources : https://github.com/EsupPortail/esup-carte-culture

...


cd /opt
git clone https://github.com/EsupPortail/esup-carte-culture
 


Configurations (src/main/resources/META-INF/spring)

...

Bloc de code
<http disable-url-rewriting="true" use-expressions="true" entry-point-ref="http403EntryPoint">
...
	<intercept-url pattern="/nfc-ws/**" access="hasIpAddress('127.0.0.1') or hasIpAddress('Adresse IP du serveur Esup-Nfc-Tag')" />
...
</http>




<beans:bean id="authUserDetailsService"
		class="org.esupportail.esupnfccarteculture.security.ShibAuthenticatedUserDetailsService">
		<beans:property name="mappingGroupesRoles">
			<beans:map>
				<beans:entry key="cn=for.carte-culture.admin,ou=groups,dc=univ-ville,dc=fr" value="ROLE_ADMIN" />
				<beans:entry key="cn=for.carte-culture.manager,ou=groups,dc=univ-ville,dc=fr" value="ROLE_MANAGER" />
				<beans:entry key="cn=for.carte-culture.partenaire,ou=groups,dc=univ-ville,dc=fr" value="ROLE_PARTENAIRE" />
			</beans:map>
		</beans:property>
	</beans:bean>

<beans:bean id="ldapContextSourceUnivVille" class="org.springframework.ldap.core.support.LdapContextSource">
	<beans:property name="url" value="ldap://ldap.univ-ville.fr" />
	<beans:property name="base" value="dc=univ-ville,dc=fr" />
	<beans:property name="userDn" value="cn=test,dc=univ-ville,dc=fr" />
	<beans:property name="password" value="secret" />
</beans:bean>   


<beans:bean id="ldapContextSourceAutre" class="org.springframework.ldap.core.support.LdapContextSource">
...
</beans:bean>   

applicationContext.xml

Dans ce fichier il faut déclarer les beans LdapTemplate et PersonLdapDao correspondants aux différentx Ldap auxquels on accède.

...

Compilation / Déploiement

Obtention du war pour déploiement sur tomcat ou autre :

Bloc de code
languagebash
cd /opt/esup-carte-culture
mvn clean package

...

On copie/colle le répertoire webapp packagé ainsi dans le tomcat : 

...

On arrête le tomcat avant et on le redémarre ensuite.

...