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 5, 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 5, 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 5 (For RHEL 5, CentOS 5, and SL 5) 
    [root@gratiaweb ~]$ curl -O https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
    [root@gratiaweb ~]$ rpm -Uvh epel-release-latest-5.noarch.rpm
    # EPEL 6 (For RHEL 6, CentOS 6, and SL 6) 
    [root@gratiaweb ~]$ rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
    # EPEL 7 (For RHEL 7, CentOS 7, and SL 7) 
    [root@gratiaweb ~]$ rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    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. Choose the correct package name based on your operating systemís major version:

    • For EL 5 systems, use yum-priorities
    • For EL 6 and EL 7 systems, use yum-plugin-priorities
  2. Install the Yum priorities package:

    [root@gratiaweb ~]$ yum install PACKAGE

    Replace PACKAGE with the package name from the previous step.

  3. 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:

    plugins=1
    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 OSG 3.1 (or 3.2) to OSG 3.2 (or 3.3), 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 using one of the following methods depending on your EL version:

    1. For EL versions greater than EL5, install the files directly from repo.grid.iu.edu:

      [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.2 https://repo.grid.iu.edu/osg/3.2/osg-3.2-el6-release-latest.rpm N/A
      OSG 3.3 https://repo.grid.iu.edu/osg/3.3/osg-3.3-el6-release-latest.rpm https://repo.grid.iu.edu/osg/3.3/osg-3.3-el7-release-latest.rpm
    2. For EL5, download the repo file and install it using the following:

      [root@gratiaweb ~]$ curl -O https://repo.grid.iu.edu/osg/3.2/osg-3.2-el5-release-latest.rpm
      [root@gratiaweb ~]$ rpm -Uvh osg-3.2-el5-release-latest.rpm

For more details, please see our yum repository documentation.

HELP NOTE
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.

8 Comments

-- JuanFelipeMosqueraMorales - 15 Jan 2015

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

 
TWIKI.NET

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..