Differences between revisions 7 and 8
Revision 7 as of 2009-09-20 22:47:48
Size: 9035
Editor: localhost
Comment: converted to 1.6 markup
Revision 8 as of 2013-04-09 20:50:51
Size: 0
Editor: KurtStam
Comment: moved to juddi's wiki
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
##language:en
== 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.
<<BR>>
<<BR>>
Get and install MySQL from http://www.mysql.com/downloads/index.html.
<<BR>>
<<BR>>
Install Tomcat from http://jakarta.apache.org/tomcat/index.html

=== MySQL Configuration ===
This section provides the instructions for a quick installation of MySQL
<<BR>>
# cd to ${HOME}
<<BR>>
cd
<<BR>>
# unzip and untar the downloaded binary distribution
<<BR>>
tar xzf mysql-3.23.53a-pc-linux-gnu-i686.tar.gz
<<BR>>
# restore file mods
<<BR>>
chmod u+x ${HOME}/mysql-3.23.53a-pc-linux-gnu-i686/bin/*
<<BR>>
chmod u+x ${HOME}/mysql-3.23.53a-pc-linux-gnu-i686/support-files/*
<<BR>>
chmod u+x ${HOME}/mysql-3.23.53a-pc-linux-gnu-i686/tests/*
<<BR>>
chmod u+x ${HOME}/mysql-3.23.53a-pc-linux-gnu-i686/scripts/mysql_install_db
<<BR>>
# install db
<<BR>>
cd ${HOME}/mysql-3.23.53a-pc-linux-gnu-i686/
<<BR>>
./scripts/mysql_install_db # start mysqld
<<BR>>
./bin/safe_mysqld & # repair access passwords
<<BR>>
cd ${HOME}/mysql-3.23.53a-pc-linux-gnu-i686/bin/
<<BR>>
./mysqladmin --user=root --password= password '123456'
<<BR>>
./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}
<<BR>>
# verify that java is installed
<<BR>>
echo ${JAVA_HOME}
<<BR>>
java
<<BR>>
# go to ${HOME}
<<BR>>
cd
<<BR>>
# unzip the downloaded binary distribution
<<BR>>
unzip tomcat-4.1.27.zip
<<BR>>
# ${CATALINA_HOME} is ${HOME}/tomcat-4.1.27
<<BR>>
# restore file mods
<<BR>>
cd ${CATALINA_HOME}/bin
<<BR>>
chmod u+x catalina.sh
<<BR>>
# start Tomcat
<<BR>>
./catalina.sh start
<<BR>>
# browse http://localhost:8080/ to verify that Tomcat has started
<<BR>>
<<BR>>
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
<<BR>>
cp juddi_0.8.0_bin/ddl/juddi_mysql.ddl .
<<BR>>
Connect to the installed mysql as follows:
<<BR>>
mysql --host=host.domain.com --port=3306 --user=root --password=123456
<<BR>>
Run the following:<<BR>>
{{{
#
# 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).
# IS_ADMIN Indicate if the publisher has administrative privileges.
# Valid values for this column are 'true' or 'false'. The IS_ADMIN
# value is currently not used.

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

To exit MySQL type: <<BR>>
quit

=== Install the jUDDI web application ===
Tomcat should be shutdown during this procedure.<<BR>>
<<BR>>
Unzip the ${HOME}/juddi_0.8.0_bin/build/juddi.war file at the directory ${CATALINA_HOME}/webapps/juddi/<<BR>>
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"/>
  <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
}}}