Install Gratia Web

1 About this Document

Here we describe how to install and configure the Gratia-Web server. Gratia Web is a web server that displays the accounting information collected in the Gratia Databases. An OSG instance of Gratia Web is available here.

2 Requirements

2.1 Host and OS

  • A host to install the Gratia Web server.
  • OS is Red Hat Enterprise Linux 6, 7, and variants (see details...). Currently most of our testing has been done on Scientific Linux 6.
  • Root access.
  • Read access to a Gratia database (MySQL)

2.2 Networking

For more details on overall Firewall configuration, please see our Firewall documentation.

HTTP tcp 8100 choice-yes   Default http port for the Gratia Web server

3 Installation Procedure

3.1 Install the Repositories

Install the Yum Repositories required by OSG

The OSG RPMs currently support Red Hat Enterprise Linux 6, 7, and variants (see details...).

OSG RPMs are distributed via the OSG yum repositories. Some packages depend on packages distributed via the EPEL repositories. So both repositories must be enabled.

Install EPEL

  • Install the EPEL repository, if not already present. Note: This enables EPEL by default. Choose the right version to match your OS version.
    # EPEL 6 (For RHEL 6, CentOS 6, and SL 6) 
    [root@gratiaweb ~]$ rpm -Uvh
    # EPEL 7 (For RHEL 7, CentOS 7, and SL 7) 
    [root@gratiaweb ~]$ rpm -Uvh
    WARNING: if you have your own mirror or configuration of the EPEL repository, you MUST verify that the OSG repository has a better yum priority than EPEL (details). Otherwise, you will have strange dependency resolution (depsolving) issues.

Install the Yum priorities package

For packages that exist in both OSG and EPEL repositories, it is important to prefer the OSG ones or else OSG software installs may fail. Installing the Yum priorities package enables the repository priority system to work.

  1. Install the Yum priorities package:

    [root@gratiaweb ~]$ yum install yum-plugin-priorities
  2. Ensure that /etc/yum.conf has the following line in the [main] section (particularly when using ROCKS), thereby enabling Yum plugins, including the priorities one:

    NOTE: If you do not have a required key you can force the installation using --nogpgcheck; e.g., yum install --nogpgcheck yum-priorities.

Install OSG Repositories

  1. If you are upgrading from one OSG series to another, remove the old OSG repository definition files and clean the Yum cache:

    [root@gratiaweb ~]$ yum clean all
    [root@gratiaweb ~]$ rpm -e osg-release

    This step ensures that local changes to *.repo files will not block the installation of the new OSG repositories. After this step, *.repo files that have been changed will exist in /etc/yum.repos.d/ with the *.rpmsave extension. After installing the new OSG repositories (the next step) you may want to apply any changes made in the *.rpmsave files to the new *.repo files.

  2. Install the OSG repositories:

    [root@gratiaweb ~]$ rpm -Uvh URL

    Where URL is one of the following:

    Series EL6 URL (for RHEL 6, CentOS 6, or SL 6) EL7 URL (for RHEL 7, CentOS 7, or SL 7)
    OSG 3.3
    OSG 3.4

For more details, please see our yum repository documentation.

If you are working on RHEL-5 you will need to install also the rpmforge repository to include a newer version of python-cherrypy that is required.

3.2 Install the Gratia Web package (osg-measurements-metrics-web)

As root install the package osg-measurements-metrics-web enabling the osg-development repo.

[root@gratiaweb ~]$ yum install osg-measurements-metrics-web --enablerepo=osg-development

3.3 Configure the database connection to be used by Gratia Web

Copy the DBParam.xml.rpmnew file that contains an skeleton of the database connection configuration for GratiaWeb:

[root@gratiaweb ~]$ cp /etc/DBParam.xml.rpmnew /etc/DBParam.xml

Edit /etc/DBParam.xml updating the user/password fields with a user with read access to the database.

4 Services

Gratia Web works with one web server and a cron job that generate static graphics for the home page of the web server. The default location of the static graphs crontab is /etc/cron.d/GratiaStaticGraphs.cron

4.1 Starting and Enabling Services

To start the Gratia Web web server execute as root the following command:
[root@gratiaweb ~]$ service GratiaWeb start

4.2 Stopping and Disabling Services

To stop the Gratia Web web server execute as root the following command:
[root@gratiaweb ~]$ service GratiaWeb stop

5 Validation of Service Operation

On a browser visit the following URLs (replacing host with localhost or the hostname of your server):

  • http://host:8100/gratia
  • http://host:8100/gratia/xml
  • http://host:8100/gratia/xml/facility_transfer_volume

6 Advanced Topic - Adding queries to GratiaWeb (OPTIONAL)

Check the following documentation about queries in GratiaWeb: Adding/Modifying Queries to GratiaWeb

7 Troubleshooting

7.1 Useful Configuration and Log Files

Service/Process Configuration File Description
gratia_web /etc/DBParam.xml Configuration for the database connection parameters.

Service/Process Log File Description
gratia_web /var/log/GratiaWeb-access.log Records of all HTTP requests received.
  /var/log/GratiaWeb-error.log Records errors produced while handling HTTP requests.
  /var/log/GratiaWeb.out Records all the stdout and stderr from the service.


-- JuanFelipeMosqueraMorales - 15 Jan 2015

Topic revision: r12 - 06 Dec 2016 - 18:12:42 - KyleGross
Hello, TWikiGuest!


TWiki | Report Bugs | Privacy Policy

This site is powered by the TWiki collaboration platformCopyright by the contributing authors. All material on this collaboration platform is the property of the contributing authors..