Home Documentation
Download Report a Bug/Github About Contact

Deploying rdap-server with the customized SQL Provider

The server is a typical servlet Java WAR; so, simply put it into a servlet container. The following is an improvised example on how this might be done in Ubuntu/Tomcat; if any other means or environments are flavored, knock yourself out. (Payara and Wildfly have been tested as well as Tomcat).

Info General recommendation: if RedDog’s server will be at a production environment, configure a load balancer or a reverse proxy to protect the server.

Info When configuring the balancer/proxy, the context must be the same as the server. E.g. if the backend server is at example.com:8080/rdap, then the frontend service should be at example.com/rdap (note that the server context is /rdap).

Install Java

sudo apt-get install openjdk-8-jre

Install Tomcat

# Ubuntu repositories aren't used because their Tomcat is rather old.
# You will probably need to adapt this link because it keeps changing.
# See www-us.apache.org/dist/tomcat/tomcat-8
wget www-us.apache.org/dist/tomcat/tomcat-8/v8.5.23/bin/apache-tomcat-8.5.23.tar.gz
tar -xzvf apache-tomcat-8.5.23.tar.gz

Install the MySQL driver on Tomcat

# https://dev.mysql.com/downloads/connector/j/
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.44.zip
unzip -j mysql-connector-java-5.1.44.zip mysql-connector-java-5.1.44/mysql-connector-java-5.1.44-bin.jar

Install RedDog on Tomcat

mkdir $CATALINA_HOME/webapps/rdap
cd $CATALINA_HOME/webapps/rdap
# www.reddog.mx/server-download.html
wget https://github.com/NICMx/releases/raw/master/RedDog/rdap-server-1.4.0.war
jar -xvf rdap-server-1.4.0.war
rm rdap-server-1.4.0.war

Add the SQL Provider to the classpath

The latest SQL Provider can be found here.

mv ~/Downloads/rdap-sql-provider-1.4.0.jar WEB-INF/lib

If classpath only contains one implementation, that’s all there is needed. Otherwise the provider’s hub class must be specified in the data-access.properties file:

echo "data-access-implementation = mx.nic.rdap.sql.impl.SqlProviderImplementation" > WEB-INF/data-access.properties

This file is rdap-server’s data access configuration file] and contains some predefined properties that are useful for the reference implementation; more details on this configuration can be seen here.

Add custom queries to the classpath

There are more elegant ways to do this, but a relatively fuss-free and reliable option is to place in WEB-INF/classes the custom directory (that must contain all the customized queries files); assuming that such directory is named user_sql_files, this can be done:

mv ~/Documents/user_sql_files WEB-INF/classes

One way to do this in Tomcat is to define the datasource in context.xml.

The file $CATALINA_HOME/webapps/rdap/META-INF/context.xml must be created, then the following content must be inserted and the dummy values (in square brackets) replaced:

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/rdap">
	<Resource name="jdbc/rdap"
		validationQuery="select 1" />

Start Tomcat


RedDog server is now running and serving data provided by the SQL Provider’s queries.

Sample Firefox screenshot