The following assumes that you are in the SSH terminal connected to your EC2 instance.

1. Stop the running tomcat instance

  1. Go to the tomcat directory

    • cd /opt/apache-tomcat-7.0.39/

  2. Stop tomcat using the shutdown wrapper script

    • sudo -su tomcat bin/shutdownwrapper.sh

  3. Verify tomcat has been shutdown

    • ps aux | grep tomcat


Shutdown tomcat
[root@ip-172-31-54-208 log]# cd /opt/apache-tomcat-7.0.39/
[root@ip-172-31-54-208 apache-tomcat-7.0.39]# sudo -su tomcat bin/shutdown.sh
Using CATALINA_BASE:   /opt/apache-tomcat-7.0.39
Using CATALINA_HOME:   /opt/apache-tomcat-7.0.39
Using CATALINA_TMPDIR: /opt/apache-tomcat-7.0.39/temp
Using JRE_HOME:        /opt/jdk1.8.0_66
Using CLASSPATH:       /opt/apache-tomcat-7.0.39/bin/bootstrap.jar:/opt/apache-tomcat-7.0.39/bin/tomcat-juli.jar
[root@ip-172-31-54-208 apache-tomcat-7.0.39]# ps aux | grep tomcat
root      1646  0.0  0.0 103312   876 pts/0    S+   13:02   0:00 grep tomcat
 
#### The following means that tomcat is still running ####
tomcat    1674 93.2 11.4 3599164 116800 pts/0  Sl   13:08   0:03 /opt/jdk1.8.0_66/bin/java -Djava.util.logging.config.file=/opt/apache-tomcat-7.0.39/conf/logging.properties 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xmx1536m -XX:+PrintGCDetails 
-Xloggc:/opt/apache-tomcat-7.0.39/logs/tomcat-gc.log -Djava.endorsed.dirs=/opt/apache-tomcat-7.0.39/endorsed 
-classpath /opt/apache-tomcat-7.0.39/bin/bootstrap.jar:/opt/apache-tomcat-7.0.39/bin/tomcat-juli.jar 
-Dcatalina.base=/opt/apache-tomcat-7.0.39 -Dcatalina.home=/opt/apache-tomcat-7.0.39 
-Djava.io.tmpdir=/opt/apache-tomcat-7.0.39/temp org.apache.catalina.startup.Bootstrap start

2. Modify configuration.properties for the public sparql endpoint

  1. Go to the repository home directory
    • cd ${SPARQLER_HOME}
  2. Open configuration.properties file in a text editor of your choice
    • vim configuration.properties
  3. The following property must be be set for your eagle-i node
    • eaglei.repository.namespace
  4. The following properties should be set for proper display of the interface
    • eaglei.repository.title
    • eaglei.repository.logo
  5. Save the changes.

    Edit repository properties
    [root@ip-172-31-54-208 ~]# cd ${SPARQLER_HOME}
    [root@ip-172-31-54-208 sparqler]# vim configuration.properties
     
    ##### configuration.properties file ####
    eaglei.repository.namespace = http://ec2-54-175-59-6.compute-1.amazonaws.com/i/
    eaglei.repository.title = AMI Test Repository
    eaglei.repository.logo = https://alaska.qa.eagle-i.net:8443/sweet/images/eaglei-medium-blue.png

3. Prepare the public sparql repository for customization

  1. Go to the repository home directory
    • cd ${REPO_HOME}
  2. Run the prepare-install script in the etc directory.  Replace SPARQLADMINUSER and SPARQLADMINPW with the credentials for the public sparqler repository administrator.
    • bash etc/prepare-install.sh SPARQLADMINUSER SPARQLADMINPW ${REPO_HOME} sparqler-users.derby
  3. Modify the ownership of the derby database to be owned by the tomcat user

    • chown -R tomcat:tomcat db/ 

    Prepare repository
    [root@ip-172-31-54-208 sparqler]# cd ${REPO_HOME}
    [root@ip-172-31-54-208 repo]# bash etc/prepare-install.sh sparqler-user sparqler-pw ${REPO_HOME} sparqler-users.derby
    _RUNJAVA set to "/opt/jdk1.8.0_66/jre/bin/java"
    java version "1.8.0_66"
    Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
    Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
    
    ---all superuser logins---
      sparqler-user
    [root@ip-172-31-54-208 repo]# chown -R tomcat:tomcat db/

4. Update eagle-i property files with public sparqler information

  1. Go to the eagle-i configuration directory
    • cd /opt/eaglei/conf/
  2. Using the text editor of your choice, edit the eagle-i-apps.properties file
    • vim eagle-i-apps.properties
  3. Add the following two properties to the eagle-i-apps.properties file to define the source and target repository for the public sparql endpoint:
    • eaglei.sparqler.source.URL, this will be your main repository URL
    • eaglei.sparqler.target.URL, this will be the URL of your public sparql endpoint. Typically it is a concatenation of the main repository URL with 'sparqler'
  4. Save your changes.
  5. Using the text editor of your choice, edit the eagle-i-apps-credentials.properties file.
  6. Add the credentials used when running the prepare-install.sh script for the sparqler to the eagle-i-apps-credentials.properties file.
    • eaglei.sparqler.target.user
    • eaglei.sparqler.target.password
  7. Save your changes

    Update Sparqler configs
    [root@ip-172-31-54-208 sparqler]# cd /opt/eaglei/conf/
    [root@ip-172-31-54-208 conf]# vim eagle-i-apps.properties
    ##### eagle-i-apps.properties file #####
    ## SPARQLER
    ### URL of source-repository (from which the sparqler reads public information):
    eaglei.sparqler.source.URL = https://ec2-54-175-59-6.compute-1.amazonaws.com/
    
    ### URL of target (i.e., sparqler) repository:
    eaglei.sparqler.target.URL = https://ec2-54-175-59-6.compute-1.amazonaws.com/sparqler/
    ########################################
     
    [root@ip-172-31-54-208 conf]# vim eagle-i-apps-credentials.properties
    ##### eagle-i-apps-credentials.properties file #####
    eaglei.sparqler.target.user=sparqler-user
    eaglei.sparqler.target.password=sparqler-password
    ####################################################

5. Start tomcat

  1. Go to the tomcat directory

    • cd /opt/apache-tomcat-7.0.39/

  2. Start tomcat using the startup wrapper script

    • sudo -su tomcat bin/startupwrapper.sh

  3. Wait for tomcat to finish startup.

    Start tomcat
    [root@ip-172-31-54-208 opt]# cd apache-tomcat-7.0.39/
    [root@ip-172-31-54-208 apache-tomcat-7.0.39]# sudo -su tomcat bash bin/startupwrapper.sh
    Waiting for Tomcat to startup ...
    Tomcat startup finished in ~115 seconds

6. Finish the public sparql repository customization

  1. Go to the repository home directory
    • cd ${REPO_HOME}
  2. Run the finish install script in the etc directory.  Replace SPARQLADMINUSER and SPARQLADMINPW with the credentials for the public sparqler repository administrator.
    • bash etc/finish-install.sh SPARQLADMINUSER SPARQLADMINPW sparqler-repository-url-prefix
    Finish repo
    [root@ip-172-31-54-208 sparqler]# cd ${REPO_HOME}
    [root@ip-172-31-54-208 repo]# bash etc/finish-install.sh sparqler-user sparqler-pw https://ec2-54-175-59-6.compute-1.amazonaws.com/sparqler
    User metadata created.
    Updating data model ontology from jar, please wait...
    Updated data model ontology from jar

7. Verify the public sparql endpoint has been customized correctly

In a browser, navigate to the public sparql endpoint admin console and log in using the public sparqler repository administrator credentials.

  • No labels