SETTING UP A PLAIN ACE SERVER WITHOUT A PERL INTERFACE
==========================================================

This should be read in conjunction with the document 
by Curt Jamison and Steve Beckstrom-Sternberg on 
Setting up a WWW interface to ACEDB.

1. Create a new user (NEW_USER) account on YOUR_DISK.

2a. Put your acedb DATABASE (for example antace) in this new account NEW_USER.

2b. EITHER your database antace could contain a bin directory containing
the aceserver.wrm binary

~NEW_USER/antace/bin/aceserver 

OR if you want to serve several acedb databases, you could put 
aceserver.wrm  in the home-directory level of NEW_USER i.e. 

~NEW_USER/bin/aceserver 

so that you could have several databases running from the same binary

~NEW_USER/antace
~NEW_USER/catace
~NEW_USER/dogace   etc.

2c. Make sure the database/wspec/server.wrm file has been filled in
correctly (see Problems encountered below).

3a. Get  an RPC program (or port_) number for the DATABASE (e.g. antace). 
This number must be one not already in use and it needs
to be written into the file /etc/rpc as :     

antace port_number

where antace is the database which will be served up.
A port number might be something like 20000100
so that the line in /etc/rpc becomes

antace 20000100

NOTE: usually this rpc file and the inetd.conf (next paragraph)
is writable only by a superuser/system administrator.

3b.  Also you need an entry in the /etc/services file 
(services - Defines the sockets and protocols used for Internet
services), i.e.

antace   20000100/tcp


4. Then you need to edit /etc/inetd.conf to add as follows :

antace/1 stream rpc/tpc wait NEW_USER pathway_to_executable rpc.acedbd  pathway_to_database port_number 600:600:10

antace/1 :   means database/version 1, this can be changed.

pathway_to_executable :
EITHER the pathway_to_executable  will be /usr/local/bin/rpc.acedbd
OR if the server is not set up to run automatically it will be the 
normal pathway_to_executable :
/nfs/diskwhatever/NEW_USER/antace/bin/aceserver 

the pathway_to_database will be :
/nfs/diskwhatever/NEW_USER/antace

600:600:10 is the default client_timeout:server_time_out:max_chunk_size.

(NOTE this user NEW_USER must have execute permission on rpc.acedbd.)

5. To turn the thing into a daemon, EITHER copy aceserver
to rpc.acedbd OR make a link as follows :
 
ln -s /usr/local/bin/aceserver /usr/local/bin/rpc.acedbd

(the link depends on  aceserver being in /local/bin/ and the 
correct binary for the purpose)

Another way of doing it would be :
ln -s /nfs/diskwhatever/NEW_USER/antace/bin/aceserver ./rpc.acedb

6. Once this is done the super-user (system administrator) needs to
restart inetd by  killing its PID.
Here is an example from the system administrator :

a. restart the portmapper.

ps -aux|grep portmap    # Find the PID of the portmapper

root  30538  0.0  0.0 1.59M  0K ??  IW Jul 31 0:00.11 /usr/sbin/portmap

kill -9 30538           # Kill the pid

/usr/sbin/portmap       # Restart the portmap daemon

b. kill -HUP inetd      # Get inetd to re-read the inetd.conf file.

ps -aux|grep inetd      # Find the PID of the inetd daemon

root 428  0.0  0.1 1.62M  64K ??  I Jul 07  0:00.94 /usr/sbin/inetd

kill -HUP 428           # kill -HUP pid

It should then fly!


7. When all has been done at the server end one can start the server by hand
using the command line : 

aceserver pathway_to_database -port decimal_port_number -time_out client_time_out_in_seconds -server_time_out server_time_out_in_seconds -MaxKbytes max-data_chunksize

OR if the aceserver has been copied into rpc.acedb, use the following

rpc.acedbd pathway_to_database decimal_port_number client_time_out_in_seconds:server_time_out_in_seconds:max_datachunksize.

In the above example this would be 
rpc.acedbd /nfs/diskwhatever/NEW_USER/antace -port 20000100 600:600:10
	
8. When the life of the server has been established, you
can set up and test the aceclient side.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


SETTING UP ACECLIENT WITHOUT PERL INTERFACE.
===============================================

1. In your own account (not the NEW_USER account from above),
put a copy of the binary of aceclient.

2a. type on the command line :
 path_to_aceclient/aceclient server_full_name(or IP) -port decimal_port_number

2b. It is optional to add at the end of the command line : time_out_seconds

which gets a null return if the server does not respond in that time.

Once a request has been received by the server, an entry
is made in the server.log in the database home directory.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

PROBLEMS ENCOUNTERED
=======================

1. NAMING THE SERVER :
using a short name for the server computer will only work on a local network.
So one needs to use the full IP address or full name.

2. SERVER.WRM COMPATIBLILTY :
The versions of wspec/server.wrm in code releases 4_3 and 4_5 are only
partially compatible with each other's version of code.
You are advised to use old wspec with older code or new with new code.

The WRITE_ACCESS-DIRECTORY for the client to write in,
while establishing the connection,
needs making on the server and its full path giving here, e.g.

WRITE_ACCESS-DIRECTORY /nfs/diskwhatever/NEW_USER/temp

If, in server.wrm you put in the line :

READ_ACCESS_DIRECTORY PUBLIC

any client can read the database.
The server.wrm also needs another line specifying the
database version named in the pathway. in this case 1.

Therefore the server.wrm file contains 3 lines :

DATA_VERSION 1

READ_ACCESS_DIRECTORY PUBLIC

WRITE_ACCESS_DIRECTORY /nfs/diskwhatever/NEW_USER/temp

If something has gone wrong with server.wrm settings you may
get something like the following in the server.wrm file :


#### Server starts 1997-08-05_16:38:12
#### host=(unknown)  port=210200  ACEDB=/nfs/disk67/NEW_USER/antace
#### clientTimeout=600 serverTimeout=600 maxKbytes=10 autoSaveInterval=600
Nobody can read or write, please set in the file wspec/server.wrm
the variables READ_ACCESS_DIRECTORY and WRITE_ACCESS_DIRECTORY

#### Server starts 1997-08-05_17:26:53
#### host=seal  port=210200  ACEDB=/nfs/disk67/NEW_USER/antace
#### clientTimeout=6000 serverTimeout=6000 maxKbytes=10 autoSaveInterval=600
Server cannot create a magic file in the READ_ACCESS_DIRECTORY /disk67/NEW_USER/antace// Reached timeout, server will shut down

#### Server normal exit 1997-08-05_17:30:25
  A bientot 


#### Server starts 1997-08-05_18:45:02
#### host=seal  port=210200  ACEDB=/nfs/disk67/NEW_USER/antace
#### clientTimeout=6000 serverTimeout=6000 maxKbytes=10 autoSaveInterval=600
New Client 1, 1 active clients
Unauthorised access by client 1, magic = 0 != look->writeMagic = -17270380, look
->readMagic = 11648838

Closing Client 1, 0 active clients

No more active clients, starting to count-down: 6000 s // 1997-08-05_18:45:12
// Reached timeout, server will shut down



3. TIMING OUT
the message may look like this :

moot::~> bin/aceclient seal.IPaddress_in_words -port 210200
acedb@seal.IPaddress_in_words> ?
//! Null answer - Error Code: 5
//! You may have timed out
// Please report problems to mieg@kaa.crbm.cnrs-mop.fr
 //Bye

moot::~> 
No more active clients, starting to count-down: 600 s // 1997-08-05_16:48:58
// Reached timeout, server will shut down

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=

USING THE SERVER FOR DATABASE QUERIES
============================================

Also see the document by Jean Thierry_Mieg called
client.doc for some examples and the list of
commands which can be used by the client to
extract information from the server. They are
similar (?same) as those in tace.

typing :
?	//gets the list of commands
class	//gets the list of classes and the number of objects
find class // gets all the objects in the class specified.

for example :

acedb@seal.IPaddress_in_words> find species
// Reponse: 56 bytes.

// Found 1 objects in this class
// 1 Active Objects 
acedb@seal.IPaddress_in_words> show -a
// Reponse: 48 bytes.

// 1 object dumped
// 1 Active Objects 
acedb@seal.IPaddress_in_words> 

acedb@seal.IPaddress_in_words> find life_stage
// Reponse: 64 bytes.

// Found 21 objects in this class
// 21 Active Objects 
acedb@seal.IPaddress_in_words> list -a
// Reponse: 600 bytes.

KeySet : Answer_1
Life_stage : "1+1\/2 fold embryo"
Life_stage : "2 fold embryo"
Life_stage : "3-fold embryo"
Life_stage : "50-70 cell"
Life_stage : "90 cell"
Life_stage : "adult"
Life_stage : "adult hermaphrodite"
Life_stage : "adult something"
Life_stage : "bean embryo"
Life_stage : "dauer larva"
Life_stage : "early embryo"
Life_stage : "early larva"
Life_stage : "embryo"
Life_stage : "L1"
Life_stage : "L2"
Life_stage : "L3"
Life_stage : "L4"
Life_stage : "L4\/adult moult"
Life_stage : "larva"
Life_stage : "late embryo"
Life_stage : "mid embryo"
// 21 object listed
// 21 Active Objects 
acedb@seal.IPaddress_in_words> 

acedb@seal.IPaddress_in_words> find database
// Reponse: 56 bytes.

// Found 4 objects in this class
// 4 Active Objects 
acedb@seal.IPaddress_in_words> list -a
// Reponse: 144 bytes.

KeySet : Answer_1
Database : "EMBL"
Database : "Genbank"
Database : "PIR"
Database : "SWISSPROT"
// 4 object listed
// 4 Active Objects 
acedb@seal.IPaddress_in_words> 

acedb@seal.IPaddress_in_words> query find Locus Positive_clone
// Reponse: 48 bytes.

// Found 79 objects
// 79 Active Objects 
acedb@seal.IPaddress_in_words>

acedb@seal.IPaddress_in_words> quit

// Please report problems to mieg@kaa.crbm.cnrs-mop.fr
 //Bye

moot::~> 

The next stage could be changing the aceserver/client into
the perl versions, for which see documentation by .......
Curt Jamison & Steve Beckstrom-Sternberg have documented the insertion
of the Netclient layer.

Sylvia Martinelli 08/08/97.