The ICS-FORTH SWKM Services: Installation Instructions.
A) Installation Steps.
Useful Links:Optionally you can create a user who will have the rights to query/update/delete the specific database. This user should be the one who owns the database and preferably this user should be the account which is used to start the glassfish server. In case it is not, you should make sure that the user under which glassfish runs has the appropriate rights required to successfully use the database.
Software Download Link: http://www.postgresql.org/download/
Installation Process:
(The installation instructions described below apply for postgres 8.1.x and 8.2.x. Do not try to install postgres 8.3.x with SWKM beta and pr1.)
The following lines describe how to install the postgres server from source code. For a more detailed tutorial, please follow the links above.gunzip postgresql-version.tar.gz
tar xvf postgresql-version.tar
./configure --prefix =// you can set the installation directory here (default path for root is /usr/local/pgsql )
make
You can install postgres either as super user (the binaries will be globally accessible on your machine) or as a non root user (the binaries will be installed into the non root
users directory). In the first case you have to create a user named postgres. This user is responsible for starting and administrating the postgres server (postgres cannot by
started by root for security reasons).
A) Installing as root:
su
make install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
B) Installing as non-root (example):./configure --prefix = $HOME/pgsqlmake install
mkdir $HOME/pgsql/data
After installing postgres, you initialize it as follows:
<postgres_installation_dir>/bin/initdb -D<data_folder_installation_dir>
<postgres_installation_dir>/bin/pg_ctl -D<data_folder_installation_dir>> <logfile_location> 2>&1 &
<postgres_installation_dir>/bin/createdb test
<postgres_installation_dir>/bin/psql test
Its very important to export the<postgres_installation_dir>/bin files to the $PATH environment variable otherwise toy won't be able
to load the rul functions into the database (see section below).
Post - Installation Steps (obligatory)
Upon installation start postgres manually and create a database that will be used for the storage of the data handled by SWKM
(iei.e. my_db) by issuing the following commands:createdb my_db
and
createlang plpgsql my_db
In the process you should also repeat the above procedure and create a second database that should be used for the storage of data handled by the registry service. The
default the name of this database should be “registry”:createdb registry
and
createlang plpgsql registry
For instance:In addition, in order to optimize the memory usage of the postgres server one has to to the following:CREATE USER myuser WITH PASSWORD 'myuser';
createdb my_db -O'myuser';
and
createlang plpgsql my_db
It is highly recommended to issue the following SQL commands, from inside psql (i.e., the command-line PostrgeSQL client), in order to optimize the PostgreSQL query
evaluation engine for RUL queries:ALTER DATABASE xxx SET ENABLE_SEQSCAN TO OFF
ALTER DATABASE xxx SET ENABLE_MERGEJOIN TO OFF
These two statements should be executed for both the “my_db” and “registry” databases. Then the glassfish server should be started by the specified user alone.
Post - Installation Steps (optional)
1. Go to the ‘postgresql.conf’ file, located under the directory
<data_folder_installation_dir>
2. Change the values of the next parameters:
max_fsm_relations = 30000
max_fsm_pages = 600000
shared_buffers = A
Depending on the postgres version you are running might be number in MB smaller than the half of your physical memory. e.g. A = 800 MB if you have 2GB physical memory. However this may differ in some postgres versions (the amount of memory could be passed in KBytes see the version specific documentation of postgres for further details).
3. You have to restart postgres for the new changes to take effect.
Useful Links:
Software Download Link (registration required): http://www.ics.forth.gr/isl/RDF/RUL/Register.html
Installation Instructions at: http://www.ics.forth.gr/isl/RDF/RUL/Install.html
Installation Process:
RUL is using PostgreSQL as its backend. Please make sure that your LD_LIBRARY_PATH is set correctly to include paths to the library
objects of the database (libpq). The configure script uses the pg_config command to get information about the installation of PostgreSQL
(includefiles and library paths). If necessary, users can specify paths to include files and library objects of the installation of
PostgreSQL, by passing the following parameters to configure script:--with-pg-libdir=<path to postgres library directory>
Specify the path to the postgres library directory (the place where libpq.so is placed). This option is mainly used if the system
fails to locate libpq.so. Before trying this option, check if your LD_LIBRARY_PATH contains a path to libpq.so--with-pg-includedir=<path to postgres include directory>
Specify the path to the postgres include dir (the place where libpq-fe.h and other files are placed). This option is mainly used if
the system fails to locate a postgres include file.
Use the configuration script with the following parameters:./configure --enable-rul --enable-hybrid --enable-dag --with-pg-libdir=<path to postgres library directory>
--with-pg-includedir=<path to postgres include directory>
make
make install (optional if you want the RUL executables to be globally accessible)
If you execute the above command from root or super user account, by default, executables will be placed in the systems standard bin
directory (e.g. /usr/local/bin) and libraries in the standard lib directory (e.g. /usr/local/lib).
Users who don't run the above command as superusers can specify a location where executables and library objects will be installed,
by passing the --prefix option at configuration time.
For example:
./configure --enable-rul --enable-hybrid --enable-dag --prefix=$HOME/my_rul_installation_directory/
Post - Installation Steps (obligatory)
Upon compilation ensure that the postgres is up and running and issue the following commands/rul_installation_dir/bin/load/load-hybrid my_db "-p <postgres_port_number>" /rul_installation_dir/bin/load/load-hybrid registry "-p <postgres_port_number>"Please note that the arguments that are passed to the scripts (-p) are included in quotes. Use the scripts with the above parameters only if
you configured postgress to run in a different port than the default one (5432). If postgres is running on the default port, then just use the following:/rul_installation_dir/bin/load/load-hybrid my_db /rul_installation_dir/bin/load/load-hybrid registryNote: Users should also load the necessary library functions into the database they have created. Which functions will be loaded
depends on the representation chosen for the database. The default case for SWKM is HYBRID, so the corresponding functions
(found at /rul_build_dir/bin/load) should be loaded before using the database. More information can be found at RUL installation
instructions.
Useful Links:JVM Settings --> JVM Options )
Software Download Link: https://glassfish.dev.java.net/downloads/v2-b58g.html
Installation Process:
The following lines describe how to install the glassfish server.
Post - Installation Steps (required):
Startup process:Please make sure that the user who starts glassfish also exists as a role in postgres database and has permissions to thePost - Installation Steps (optional):
particular datbase/ses you want to access.
1. Changing the services port:
Glassfish creates by default the domain “domain1” upon installation which runs on the default port 8080. In order to change this port,
a user has to edit manually the following lines in the /<glassfish installation dir>/domains/<yourdomain>/config/domain.xml file:<http-listener acceptor-threads="1"
address="0.0.0.0"
blocking-enabled="false"
default-virtual-server="server"
enabled="true"
family="inet"
id="http-listener-1"
port="8080"
security-enabled="false"
server-name=""
xpowered-by="true">
Change the 8080 value and replace it with a specified value (ie 3027). After that you have to restart the domain by issuing the command:<glassfish_installation_folder>/bin/asadmin stop-domain domain1
and then restart it by issuing the command:<glassfish_installation_folder>/bin/asadmin start-domain domain1AdminConsole --> Application Server --> JVM Settings --> JVM Options inf the glassfish admin webapp, set the following options:
2.Optimal Glassfish configuration:
Via the
<glassfish_installation_dir>/domains/domain1/lib/ext/postgresql-8.1-407.jdbc3.jar
Useful Links:
Download the latest SwkmMiddleware.war from the SWKM site (http://www.ics.forth.gr/isl/SWKM/).
Installation Process:
Just put the SwkmMiddleware.war file in the deployables folder of a specific domain (the specific folder can be found at
<glassfish_installation_dir>/domains/<your_domain>/autodeploy)
OR
alternatively start glassfish and use the http://localhost:4848/admin tool to remotely deploy the war file (this can be done via
the Applications\ Web Applications menu from the administrator menu and then clicking on the "deploy" button).
To check if the services were deployed correctly visit:http://your.server.ip:<domain port>/SwkmMiddlewareWS
If the installation was successful a relevant message will appear.
Post - Installation Steps (obligatory)
After installation please modify the registry.properties and repository.properties files located in
<glassfish_installation_dir>/domains/domain1/applications/j2ee-modules/SwkmMiddlewareWS/WEB-INF/classes
folder to set the correct values regarding database host, port, user name, password and connection protocol.
These files have the following structure:The repository.properties file:
#The database connection protocol
repository.jdbc.protocol=jdbc:postgresql
#The database server IP address
repository.jdbc.host=127.0.0.1
#The database server port
repository.jdbc.port=5432
#The specific database used by the services
repository.jdbc.db=my_db
#The specific use who has access to the database
repository.jdbc.username=myuser
#The database user's password:
repository.jdbc.password=mypassword
#Representation values: [ISA, NOISA, HYBRID] (leave as hybrid)
repository.jdbc.representation=HYBRID
#In the two options belwo just set the RUL installation directory
repository.ruql.icl=/rul_installation_directory/bin/icl
repository.ruql.dbc=/rul_installation_directory/bin/dbc
repository.query.threadPool.max=150
#If you want to enable users to erase tha database programmatically
repository.debug.enableEraseDatabase=true
The registry.properties file:
#The database connection protocol
registry.jdbc.protocol=jdbc:postgresql
#The database server IP address
registry.jdbc.host=127.0.0.1
#The database server port
registry.jdbc.port=5432
#The database name where the registry ontology is stored
registry.jdbc.db=registry
#The specific use who has access to the database
registry.jdbc.username= myuser
#The database user's password:
registry.jdbc.password=mypassword
#Representation values: [ISA, NOISA, HYBRID]
registry.jdbc.representation=HYBRID
#If you want to enable users to erase the database programmatically
registry.debug.enableEraseRegistry=true
Important Notice: Upon editing the contents of these files you have to restart the glassfish server in order for the changes to take effect.
B) Startup Process.
Start Postgress: login as the user under which postgres has been installed and execute the
pg_ctl start -D /path/to/data/installation/directory command.
Note: depending on the way of installation postgres might start at system boot.
Start glassfish: <glassfish_installation_folder>/bin/asadmin start-domain yourdomain(by default domain1).
Use the SWKM Client and the corresponding libraries (find the appropriate version at the Services Downloads section) to test the services.
Last modified: July 2, 2008