Overview

This howto presents a quick installation guide for the jUDDI web application and its prerequisites. The platform used herein is *nix with bash shell, MySQL and Tomcat. Installation is not much different for other platforms and the document will evolve to include them.

Get and install MySQL from http://www.mysql.com/downloads/index.html.

Install Tomcat from http://jakarta.apache.org/tomcat/index.html

MySQL Configuration

This section provides the instructions for a quick installation of MySQL

# cd to ${HOME}

cd

# unzip and untar the downloaded binary distribution

tar xzf mysql-3.23.53a-pc-linux-gnu-i686.tar.gz

# restore file mods

chmod u+x ${HOME}/mysql-3.23.53a-pc-linux-gnu-i686/bin/*

chmod u+x ${HOME}/mysql-3.23.53a-pc-linux-gnu-i686/support-files/*

chmod u+x ${HOME}/mysql-3.23.53a-pc-linux-gnu-i686/tests/*

chmod u+x ${HOME}/mysql-3.23.53a-pc-linux-gnu-i686/scripts/mysql_install_db

# install db

cd ${HOME}/mysql-3.23.53a-pc-linux-gnu-i686/

./scripts/mysql_install_db # start mysqld

./bin/safe_mysqld & # repair access passwords

cd ${HOME}/mysql-3.23.53a-pc-linux-gnu-i686/bin/

./mysqladmin --user=root --password= password '123456'

./mysqladmin --user=root --password= --host=host.domain.com password '123456'

Tomcat Configuration

This is not meant to be a Tomcat installation manual. It only explains how to make a simple installation. Tomcat will be installed in the user home directory (${HOME}). After the installation the Tomcat directory is referred to as ${CATALINA_HOME}

# verify that java is installed

echo ${JAVA_HOME}

java

# go to ${HOME}

cd

# unzip the downloaded binary distribution

unzip tomcat-4.1.27.zip

# ${CATALINA_HOME} is ${HOME}/tomcat-4.1.27

# restore file mods

cd ${CATALINA_HOME}/bin

chmod u+x catalina.sh

# start Tomcat

./catalina.sh start

# browse http://localhost:8080/ to verify that Tomcat has started

You might find useful to set tomcat user accounts. Edit ${CATALINA_HOME}/conf/tomcat-users.xml:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="manager"/>
  <role rolename="admin"/>
  <user username="both" password="changeme" roles="admin,manager"/>
</tomcat-users>

Prepare MySQL

Copy to the current directory the file ${HOME}/juddi_0.8.0_bin/ddl/juddi_mysql.ddl

cp juddi_0.8.0_bin/ddl/juddi_mysql.ddl .

Connect to the installed mysql as follows:

mysql --host=host.domain.com --port=3306 --user=root --password=123456

Run the following:

#
# Create the jUDDI database
#
DROP DATABASE IF EXISTS juddi;
CREATE DATABASE juddi;
#
# Sets global privileges to user juddi
#
REPLACE INTO mysql.user SET 
  Host = '%', # any hostname (including localhost)
  # alternatively '192.168.0.1/255.255.255.0', '129.%', 'localhost'
  User = 'juddi',
  Password = PASSWORD('123456'),
  Select_priv = 'Y',
  Insert_priv = 'Y', 
  Update_priv = 'Y', 
  Delete_priv = 'Y', 
  Create_priv = 'Y', 
  Drop_priv = 'Y', 
  Reload_priv = 'Y', 
  Shutdown_priv = 'Y', 
  Process_priv = 'Y', 
  File_priv = 'Y', 
  Grant_priv = 'Y', 
  References_priv = 'Y', 
  Index_priv = 'Y', 
  Alter_priv = 'Y'
  # Show_db_priv = 'N',
  # Super_priv = 'N',
  # Create_tmp_table_priv = 'N',
  # Lock_tables_priv = 'N',
  # Execute_priv = 'N',
  # Repl_slave_priv = 'N',
  # Repl_client_priv = 'N',
  # ssl_type = 'X509',
  # ssl_cipher = '', # blob
  # x509_issuer = '', # blob
  # x509_subject = '', # blob
  # max_questions = '0',
  # max_updates = '0',
  # max_connections = '0'
;
FLUSH PRIVILEGES; # required

#
# fix the mysql security gaps 
# NOTE: allowed access from root@localhost, root@domain.com
#
DELETE FROM mysql.user WHERE User='';
UPDATE mysql.user SET Password=PASSWORD('123456') 
  WHERE user='root';
FLUSH PRIVILEGES; # required

#
# Optionaly Set db provilege and host privileges
# This should be used if the juddi user should not 
# have global privileges. In detail mysql access control
# is calculated as follows:
#   global privileges
#   OR (database privileges AND host privileges)
#   OR table privileges
#   OR column privileges
#
INSERT INTO mysql.db SET 
  Host = '%', # if blank intersect with the mysql.host record
  Db = 'juddi%', 
  User = 'juddi', 
  Select_priv = 'Y', Insert_priv = 'Y', 
  Update_priv = 'Y', Delete_priv = 'Y', 
  Create_priv = 'Y', Drop_priv = 'Y',
  Grant_priv = 'N', References_priv = 'Y', 
  Index_priv = 'Y', Alter_priv = 'Y', 
  Create_tmp_table_priv = 'N', 
  Lock_tables_priv = 'N'
;
INSERT INTO mysql.host SET
  Host = '%',
  Db = 'juddi%',
  Select_priv = 'Y', Insert_priv = 'Y',
  Update_priv = 'Y', Delete_priv = 'Y',
  Create_priv = 'N', Drop_priv = 'N',
  Grant_priv = 'N', References_priv = 'N',
  Index_priv = 'N', Alter_priv = 'N',
  Create_tmp_table_priv = 'N',
  Lock_tables_priv = 'N'
;

#
# create the jUDDI tables
#
USE juddi;
SOURCE juddi_mysql.ddl;

#
# add a jUDDI publisher
#
# PUBLISHER_ID  The user ID the publisher uses when authenticating.
# IMPORTANT: This should be the same value used to authenticate 
# with the external authentication service. 
# PUBLISHER_NAME The publisher's name (or in UDDI speak the
# Authorized Name). 
# ADMIN Indicate if the publisher has administrative privileges.
# Valid values for this column are 'true' or 'false'. The ADMIN 
# value is currently not used.

INSERT INTO PUBLISHER (PUBLISHER_ID,PUBLISHER_NAME,ADMIN) 
  VALUES ('juddi','juddi user','false');

To exit MySQL type:

quit

Install the jUDDI web application

Tomcat should be shutdown during this procedure.

Unzip the ${HOME}/juddi_0.8.0_bin/build/juddi.war file at the directory ${CATALINA_HOME}/webapps/juddi/

Set the following properties at the file ${CATALINA_HOME}/webapps/juddi/WEB-INF/classes/juddi.properties
(jar:file:/juddi.war!/WEB-INF/classes/juddi.properties)

# The UDDI Operator Name
juddi.operatorName = eurodyn.com
# the DataSource JNDI name
juddi.dataSource=java:comp/env/jdbc/juddi

Set the following properties at ${CATALINA_HOME}/webapps/juddi/WEB-INF/classes/log4j.properties

#
# set the log file to ${HOME}/juddi.log and not the ${PWD}/juddi.log
#
log4j.appender.LOGFILE.File=${user.home}/juddi.log

Configure Tomcat for jUDDI

Add the following lines at the ${CATALINA_HOME}/conf/server.xml file, Host element

<Context path="/juddi" docBase="juddi" debug="5" reloadable="true" 
  crossContext="true">
  <Logger className="org.apache.catalina.logger.FileLogger"
               prefix="localhost_juddiDB_log" suffix=".txt"
               timestamp="true"/>
   <!-- the Resource element will probably work better for 
       you on Tomcat 5+ if you simply use a Resource only tag 
       with xml attributes as opposed to the nested ResourceParams and
       parameter elements -->
  <Resource name="jdbc/juddiDB"
                 auth="Container"
                 type="javax.sql.DataSource"/>
  <ResourceParams name="jdbc/juddiDB">
    <parameter>
      <name>factory</name>
      <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <!-- Maximum number of dB connections in pool. Make sure you
         configure your mysqld max_connections large enough to handle
         all of your db connections. Set to 0 for no limit. -->
    <parameter><name>maxActive</name><value>100</value></parameter>
    <!-- Maximum number of idle dB connections to retain in pool.
         Set to 0 for no limit. -->
    <parameter><name>maxIdle</name><value>30</value></parameter>
    <parameter><name>maxWait</name><value>10000</value></parameter>
    <!-- MySQL dB username and password for dB connections  -->
    <parameter><name>username</name><value>juddi</value></parameter>
    <parameter><name>password</name><value>123456</value></parameter>
    <!-- Class name for mm.mysql JDBC driver -->
    <parameter>
      <name>driverClassName</name>
      <value>org.gjt.mm.mysql.Driver</value>
    </parameter>
    <!-- The JDBC connection url for connecting to your MySQL dB.
         The autoReconnect=true argument to the url makes sure that the
         mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
         connection.  mysqld by default closes idle connections after 8 hours. 
    -->
    <parameter>
      <name>url</name>
      <value>jdbc:mysql://host.domain.com:3306/juddi?autoReconnect=true</value>
    </parameter>
    <parameter>
           <name>validationQuery</name>
           <value>select count(*) from PUBLISHER</value>
    </parameter>
  </ResourceParams>
</Context>

Run Tomcat

Start the Tomcat server and test the installation browsing

${CATALINA_HOME}/bin/startup
http://localhost:8080/juddi/happyjuddi.jsp
  • No labels