Skip to content

gluu customizing public pages

Martin Vanbrabant edited this page Jan 17, 2019 · 1 revision

Gluu - customizing public pages

Intro

This is about an after-installation task that can be done to customize the pages that end-users see.

Notes

  • If really needed, see also Gluu documentation https://gluu.org/docs/ce/3.0.2/operation/custom-loginpage/ (but rather hard to read).
  • File locations given on this page are relative to the gluu container's root, unless specified otherwise.

Principles

Inside the Gluu container, Jetty is the webserver that serves the web applications of interest (e.g. oxauth).

Each web application is contained in a .war file

/opt/gluu/jetty/<web-app-name>/webapps/<web-app-name>.war

e.g.:

/opt/gluu/jetty/oxauth/webapps/oxauth.war

You can copy such .war files and expand them with some zip tool to look at their contents, or you can have at look at a location where Jetty expands them while running:

/opt/jetty-x.x/temp/jetty-localhost-<port>-<web-app-name>.war-<etc>/webapp

e.g.:

/opt/jetty-9.3/temp/jetty-localhost-8081-oxauth.war-_oxauth-any-1054355886809958311.dir/webapp

Note that multiple similar directories for the same port, same web application may exist at the same time.

But most of all, note that it does not make sense to modify any of these files; your modifications will get lost!

The web applications are however configured in such a way that they allow paths for overriden site pages and additional static files.

When putting files on these paths, make sure user jetty can read them.

Overriden site pages

Overriden site pages (e.g. *.xhtml, *.xml) must be put in

/opt/gluu/jetty/<web-app-name>/custom/pages/<path>

where <path> is the path where the file to override lives in the .war file (the path from the webapps folder to the file when looking in the location where Jetty expands them).

These files are used by Jetty in stead of their overridden counterparts!

Example:

  • The overridden login page for oxauth:
/opt/gluu/jetty/oxauth/custom/pages/login.xhtml
  • The overridden login page template for oxauth:
/opt/gluu/jetty/oxauth/custom/pages/WEB-INF/incl/layout/login-template.xhtml

Additional static files

Additional static files (e.g. images, stylesheets, javascript) must be put in

/opt/gluu/jetty/<web-app-name>/custom/static/<path>

where <path> is the path where these files would normally live in the .war file (the path from the webapps folder to the file when looking in the location where Jetty expands them): img for images, stylesheet for stylesheets, js for jsavasript files.

These files are mapped to corresponding URLs:

https://<base-url>/<web-app-name>/ext/resources/<path>/<filename>

where <base-url> is the Gluu site's base URL.

Examples (on the production server):

  • An image in the oxauth application:

    /opt/gluu/jetty/oxauth/custom/static/img/my-image.png
    

    is mapped as

    https://tcblsso.ilabt.iminds.be/oxauth/ext/resources/img/my-image.png
    
  • A stylesheet in the oxauth application:

    /opt/gluu/jetty/oxauth/custom/static/stylesheet/style-tcbl.css
    

    is mapped as

    https://tcblsso.ilabt.iminds.be/oxauth/ext/resources/stylesheet/style-tcbl.css
    

    and can be referenced in /opt/gluu/jetty/oxauth/custom/pages/WEB-INF/incl/layout/login-template.xhtml as on the second line of next snippet:

    <link type="text/css" rel="stylesheet" href="#{oxAuthConfigurationService.getCssLocation()}/style.css" />
    <link type="text/css" rel="stylesheet" href="#{oxAuthConfigurationService.getCssLocation()}/../ext/resources/stylesheet/style-tcbl.css" />
    

How to deploy these overriden site pages and additional static files

We keep these files under version control in the project https://github.com/TCBL/internal-server-docs, as we do for other server related files. Follow the README in that project to install these files.

Because the script scripts/put-files.sh in that project is run from outside the Gluu container, the path under the corresponding content directory will contain the extra part /srv/opt/gluu-server-3.0.2 in front of the file paths we documented above.

Have fun!

Clone this wiki locally