Change GateIn Context path

    Because of the extension mechanism for portal containers, changing the context path  of GateIn requires to modify several files.

     

    By default, the main portal container is accessible at http://localhost:8080/portal we want to change that URL to:

    http://localhost:8080/myportal

     

    Modify the context path, by editing gatein.ear/META-INF/application.xml

    <module>
      <web>
        <web-uri>02portal.war</web-uri>
        <context-root>myportal</context-root>
      </web>
    </module>
    

     

    Now you need to use the same String for the 02portal.war display name. Edit gatein.ear/02portal.war/WEB-INF/web.xml

    <display-name>myportal</display-name>

     

     

    You will also need to specify the name of the portal container to match that key, to do so edit:

    $JBOSS_HOME/server/default/conf/gatein/configuration.xml
    

    And change the following:

    <value-param>
      <name>default.portal.container</name>
      <value>myportal</value>
    </value-param>
    
    Last you also need to inform the organization service about that change by modifying:
    gatein.ear/META-INF/gatein-jboss-beans.xml
    Like:
    <authentication>
      <login-module code="org.exoplatform.web.security.PortalLoginModule" flag="required">
        <module-option name="portalContainerName">myportal</module-option>
        <module-option name="realmName">gatein-domain</module-option>
      </login-module>
      <login-module code="org.exoplatform.services.security.jaas.SharedStateLoginModule" flag="required">
        <module-option name="portalContainerName">myportal</module-option>
        <module-option name="realmName">gatein-domain</module-option>
      </login-module>
      <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required">
        <module-option name="portalContainerName">myportal</module-option>
        <module-option name="realmName">gatein-domain</module-option>
      </login-module>
    </authentication>
    
    Important note: GateIn on JBoss AS ships an extension to the default portal, you can delete $JBOSS_HOME/server/default/deploy/gatein-sample*