This page and the related files are hosted by

URLibService User's Guide
Version 2.1


Chapter 1

Starting URLibService

by Gerald J. F. Banon

Content

Preamble
Basic requirements
Extracting the URLibService Environment
Starting URLibService
Posting the URLib local collection
Unposting the URLib local collection
Stopping URLibService
Updating URLibService
Resetting URLibService
Environment change
Setting your preferences
Opening the mirror page

Preamble

Any questions about starting URLibService, please send a mail to <urlibservice@gmail.com>.

Once you have downloaded and extracted the URLibService Environment (see [1]), you can start the URLibService.

In this chapter, we assume that the URLib Environment have been downloaded under the directory:
C:\URLib_path (for Windows)
/URLib_path (for UNIX).

Basic requirements

i. When starting URLibService for the first time, the current host must have a hostname, afterward this is optional.
The computer name must not begin and end with a minus sign '-', and should not contain any periods '.'.

On Windows XP, to set or change the computer name click the following sequence:

Start>My Computer>Right Mouse Button>Properties>Computer Name>Change
Enter the computer name and click OK.

On Windows 7, to set or change the computer name click the following sequence:

Start>Computer>Right Mouse Button>Properties>Advanced Setting>Computer Name>Change
Enter the computer name and click OK. Accented letter in the Computer Name should be avoided.

ii. You must inform your computer its domain name.

On Windows XP, check if:
- the DNS suffix field is filled out with the domain name by clicking the following sequence:
Start>Control Panel>Network Connections>Local Area Connection Properties>>General>Internet Protocol (TCP/IP)>Advanced>DNS>Append these DNS suffixes (in order)>Add

(if the text area is empty, you must enter the Domain suffix (i.e., the domain name))
OK

On UNIX, there must exist a file called /etc/resolv.conf whose owner is root and permissions are 644, containing the following two lines (in any order):
search aaa.bbb.com
nameserver 10.10.1.1

where, aaa.bbb.com is the computer domain name and 10.10.1.1 is the ip address of the DNS server.
If the file /etc/resolv.conf doesn't contain the line search aaa.bbb.com then you should, in some Linux distributions, append this line to the file
/etc/resolvconf/resolv.conf.d/base using, for example, the command:
echo "search aaa.bbb.com" >>/etc/resolvconf/resolv.conf.d/base

WARNING 1: this last file may be modified when using the Linux graphic user interface.

WARNING 2: the file /etc/hosts must contain the right machine ip. The ip should not be 127.0.0.1, unless the machine is used in standalone mode.

iii. On UNIX, if you are planning to use port 80, then URLibService must be started by root. In this case, if the whoami command exists (it returns root) a group say urlib and a user say urlibadm member of this group must have been set up (urlibadm@a.domain.name should be a valid e-mail address). If the whoami command doesn't exist, then the group urlib and the user urlibadm member of this group must have been set up.

iv. You should have a browser installed (optional).

On Windows, you should have Netscape installed at one of the following places:
C:\Program Files\Netscape\Navigator 9\navigator.exe
C:\Arquivos de programas\Netscape\Navigator 9\navigator.exe
C:\Program Files\Netscape\Netscape\Netscp.exe
C:\Arquivos de programas\Netscape\Netscape\Netscp.exe
C:\Program Files\Netscape\Communicator\Program\netscape.exe
C:\Arquivos de programas\Netscape\Communicator\Program\netscape.exe

or you should have Mozilla installed at one of the following places:
C:\Program Files\Mozilla Firefox\firefox.exe
C:\Arquivos de programas\Mozilla Firefox\firefox.exe
C:\Program Files (x86)\Mozilla Firefox\firefox.exe
C:\Arquivos de programas (x86)\Mozilla Firefox\firefox.exe

or you should have Internet Explorer installed at one of the following places:
C:\Program Files\Internet Explorer\Iexplore.exe
C:\Arquivos de programas\Internet Explorer\Iexplore.exe
C:\Program Files (x86)\Internet Explorer\Iexplore.exe
C:\Arquivos de programas (x86)\Internet Explorer\Iexplore.exe
C:\Windows\Menu Iniciar\Programas\Iexplore.exe
C:\Program Files\Plus!\Microsoft Internet\Iexplore.exe

or you should have Chrome installed at one of the following places:
C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

If Netscape is not at one of the above places, then you may specify its absolute path in the file:
C:\URLib_path\col\dpi.inpe.br\banon\1998\08.02.08.56\auxdoc\netscape.txt
If Mozilla is not at one of the above places, then you may specify its absolute path in the file:
C:\URLib_path\col\dpi.inpe.br\banon\1998\08.02.08.56\auxdoc\mozilla.txt
If Internet Explorer is not at one of the above places, then you may specify its absolute path in the file:
C:\URLib_path\col\dpi.inpe.br\banon\1998\08.02.08.56\auxdoc\internetExplorer.txt
If Chrome is not at one of the above places, then you may specify its absolute path in the file:
C:\URLib_path\col\dpi.inpe.br\banon\1998\08.02.08.56\auxdoc\chrome.txt
(URLibService must then be resarted (not necessarily reposted) and your preference reset (see Setting the Preferences in the URLibService window)).

On UNIX, you should have Netscape installed at one of the following places:
/opt/NSCPcom/netscape
/home/galileo/solaris/bin/netscape
/usr/bin/netscape
/home/soft/bin/netscape
/usr/dt/bin/netscape6
/usr/local/bin/netscape

or you should have Mozilla (or Firefox) installed at one of the following places:
/usr/bin/firefox
/opt/mozilla/mozilla
/usr/bin/mozilla
/usr/bin/mozilla-firefox

or you should have Konqueror installed at one of the following places:
/usr/bin/konqueror

If Netscape is not at one of the above places, then you may specify its absolute path in the file:
/URLib_path/col/dpi.inpe.br/banon/1998/08.02.08.56/auxdoc/netscape.txt
If Mozilla is not at one of the above places, then you may specify its absolute path in the file:
C:/URLib_path/col/dpi.inpe.br/banon/1998/08.02.08.56/auxdoc/mozilla.txt
If Konqueror is not at one of the above places, then you may specify its absolute path in the file:
C:/URLib_path/col/dpi.inpe.br/banon/1998/08.02.08.56/auxdoc/konqueror.txt

WARNING: (URLibService must then be resarted (not necessarily reposted) and your preference reset (see Setting the Preferences in the URLibService window)).

v. You should have a text editor installed (optional).

On Windows, you should have Wordpad installed at one of the following places:
C:\Program Files\Emerald Editor Community\Crimson Editor SVN286M\cedt.exe
C:\Arquivos de programas\Emerald Editor Community\Crimson Editor SVN286M\cedt.exe
C:\Program Files\Crimson Editor\cedt.exe
C:\Arquivos de programas\Crimson Editor\cedt.exe
C:\Program Files (x86)\Crimson Editor\cedt.exe
C:\Arquivos de programas (x86)\Crimson Editor\cedt.exe
C:\Program Files\Notepad++\notepad++.exe
C:\Arquivos de programas\Notepad++\notepad++.exe
C:\Program Files\Windows NT\Accessories\wordpad.exe
C:\Arquivos de programas\Windows NT\Acessórios\Wordpad.exe
C:\Program Files\Accessories\Wordpad.exe
C:\Arquivos de programas\Accessories\Wordpad.exe

If your preferred text editor is not at one of the above places, then you may specify its absolute path in the file:
C:\URLib_path\col\dpi.inpe.br\banon\1998\08.02.08.56\auxdoc\editor.txt
(URLibService must then be resarted (not necessarily reposted)).

On UNIX, you should have a text editor installed at one of the following places:
/usr/openwin/bin/textedit
/usr/bin/gedit
/opt/kde/bin/kwrite
/opt/kde3/bin/kwrite
/usr/bin/kwrite
/usr/bin/kedit
/usr/X11/bin/xedit
/usr/X11R6/bin/xedit
/usr/bin/nedit
/usr/local/bin/nedit
/usr/dt/bin/dtpad

If your preferred text editor is not at one of the above places, then you may specify its absolute path in the file:
/URLib_path/col/dpi.inpe.br/banon/1998/08.02.08.56/auxdoc/editor.txt
(URLibService must then be resarted (not necessarily reposted)).

If the text editor is not found in your file system, then you will not be able to open files from the URLibService Check Window.

Extracting the URLibService Environment

On Windows, click the doc.zip file by using the mouse right button and then the Extract to... menu option and finally the OK button.

On UNIX execute the following commands:
cd /URLib_path
unzip doc.zip
chmod 774 start
cd ..
chmod -R g+w URLib_path
chmod -R g+s URLib_path

If you are planning to use port 80, you should execute the additional commands (assuming that the URLibService administrator urlibadm is member of the urlib group - see Item iii of Basic requirements):
chown -R root URLib_path
chgrp -R urlib URLib_path

Starting URLibService

To start URLibService, execute the following commands.

On Windows:
cd C:\URLib_path\col\dpi.inpe.br\banon\1998\08.02.08.56\doc
C:\URLib_path\col\iconet.com.br\banon\2010\06.17.00.19\doc\bin\wish85.exe start

On UNIX:
cd /URLib_path
./start

On Windows, you can create a shortcut with the following properties:
Target:
C:\URLib_path\col\iconet.com.br\banon\2010\06.17.00.19\doc\bin\wish85.exe start
Start in:
C:\URLib_path\col\dpi.inpe.br\banon\1998\08.02.08.56\doc

On Linux, you can create a shortcut with the following properties:
Command:
/URLib_path/start
Work path:
/URLib_path

Posting the URLib local collection

Starting URLibService automatically posts the URLib local collection on the Web (starting the Apache Server).

If you want to post the URLib local collection without opening the URLibService window, execute instead the following command.

On Windows:
cd C:\URLib_path\col\dpi.inpe.br\banon\1998\08.02.08.56\doc
C:\URLib_path\col\iconet.com.br\banon\2010\06.17.00.19\doc\bin\wish85.exe post

On UNIX:
cd /URLib_path
./post &

The post command is specially useful to implement the URLib local collection posting at boot time.

To implement automatic posting at boot time on Windows 95 execute the following steps.

i. Create a shortcut called, for example, PostURLibService with the following properties:
Target:
C:\URLib_path\col\iconet.com.br\banon\2010\06.17.00.19\doc\bin\tclsh85.exe post
Start in:
C:\URLib_path\col\dpi.inpe.br\banon\1998\08.02.08.56\doc

ii. Click the following sequence:
Start>Settings>Taskbar & Start Menu
Start Menu Programs
Add
Browse...
Windows>Desktop>PostURLibService
Open
Next >
StartUp
Next >
Finish
OK

To implement automatic posting at boot time on Windows XP execute the following steps.

i. Create a shortcut (same procedure as described above for Windows 95)

ii. Copy the shortcut and paste it in the following folder:
C:\Documents and Settings\UserName\Start Menu\Programs\Startup
where UserName is the name of the user who is interested in the automatic posting.
In Brazil, the same folder might be called:
C:\Documents and Settings\UserName\Menu Iniciar\Programas\Inicializar

To implement automatic posting at boot time on SunOS see Unposting the URLib local collection below.

To implement automatic posting of more than one collection using the same httpd port at boot time on Linux, follow the example below.

#!/sbin/sh

# Local system initialization script

# This script should be stored in a file named:
# /etc/rc.d/rc.local

# This script posts the following
# URLib local collections:

# /mnt/dados1/URLibLCP
# /mnt/dados1/URLibSIBGRAPI

cd /mnt/dados1/URLibLCP
rm -f ./col/dpi.inpe.br/banon/1998/08.02.08.56/auxdoc/serverDir/logs/httpd.pid 
./post &
until [ -f ./col/dpi.inpe.br/banon/1998/08.02.08.56/auxdoc/serverDir/logs/httpd.pid ]
do
sleep 1
done
cd /mnt/dados1/URLibSIBGRAPI
./post &

# End of script
OBSERVATION: at posting it is possible to set a new port entry by using the -p argument of the post command. For example, to set the port entry mtc-m16b 802 the post command must be:

On Windows:
cd C:\URLib_path\col\dpi.inpe.br\banon\1998\08.02.08.56\doc
C:\URLib_path\col\iconet.com.br\banon\2010\06.17.00.19\doc\bin\wish85.exe post -- -p mtc-m16b 802

On UNIX:
cd /URLib_path
./post -- -p mtc-m16b 802 &

Unposting the URLib local collection

If the URLibService window is open, then to unpost the URLib local collection, click the Exit button.

If the URLibService window is closed, then to unpost the URLib local collection, execute the following command.

On Windows
cd C:\URLib_path\col\dpi.inpe.br\banon\1998\08.02.08.56\doc
C:\URLib_path\col\iconet.com.br\banon\2010\06.17.00.19\doc\bin\wish85.exe post -- -x

On UNIX:
/URLib_path/unpost

Once the URLib local collection has been posted, it is not necessary to unpost it to open the URLibService window. You just execute the above start command right away as explained above in the Starting URLibService subsection.

To implement automatic unposting on some Linux distributions, follow the example below.

#!/sbin/sh

# This script should be stored in a file named:
# /etc/rc.d/rc.local_shutdown

# This script unposts the following
# URLib local collections:

# /mnt/dados1/URLibSIBGRAPI
# /mnt/dados1/URLibLCP

/mnt/dados1/URLibSIBGRAPI/unpost
/mnt/dados1/URLibLCP/unpost

# End of script

To implement automatic posting and unposting on SunOS, follow the example below.

#!/sbin/sh

# This script posts (or unposts) automatically the following
# URLib local collections:

# /home/banon/URLib
# /home/banon/URLib-
# /home/banon/URLib2
# /home/banon/URLib1920

# This script should be stored in a file placed under the
# /etc/init.d directory and named URLibServer

# With Solaris, the following symbolic links must be made:

# cd /etc/rc3.d; ln -s /etc/init.d/URLibServer S99URLibServer
# cd /etc/rc0.d; ln -s /etc/init.d/URLibServer K99URLibServer
# cd /etc/rc1.d; ln -s /etc/init.d/URLibServer K99URLibServer

# To run this script enter:
# /etc/init.d/URLibServer start
# /etc/init.d/URLibServer stop

case "$1" in
'start')

# Starting ...

su banon -c "rm -f /home/banon/URLib/col/dpi.inpe.br/banon/1998/08.02.08.56/auxdoc/serverDir/logs/httpd.pid"
su banon -c "/home/banon/URLib/post &"
su banon -c "rm -f /home/banon/URLib-/col/dpi.inpe.br/banon/1998/08.02.08.56/auxdoc/serverDir/logs/httpd.pid"
su banon -c "/home/banon/URLib-/post &"
su banon -c "rm -f /home/banon/URLib2/col/dpi.inpe.br/banon/1998/08.02.08.56/auxdoc/serverDir/logs/httpd.pid"
su banon -c "/home/banon/URLib2/post &"

         ;;

'stop')

# Stopping ...

su banon -c "/home/banon/URLib/unpost"
su banon -c "/home/banon/URLib-/unpost"
su banon -c "/home/banon/URLib2/unpost"
su banon -c "/home/banon/URLib1920/unpost"

         ;;

*)
         echo "Usage: $0 { start | stop }"
         ;;

esac
exit 0

# End of script

Stopping URLibService

If URLibService is running, unposting the local collection has no effect.

To stop URLibService (that is, to stop the Apache Server and close the URLibService main window), press the Exit Button in the main window. The local collection will be automatically unposted. If you want to close the the URLibService main window leaving the local collection posted, press the Close Button in the main window.

Updating URLibService

When URLibService is running you can update it automatically combining the unpost (with option -u) and post commands.

On Windows:
cd C:\URLib_path\col\dpi.inpe.br\banon\1998\08.02.08.56\doc
C:\URLib_path\col\iconet.com.br\banon\2010\06.17.00.19\doc\bin\wish85.exe post -- -x -u
C:\URLib_path\col\iconet.com.br\banon\2010\06.17.00.19\doc\bin\wish85.exe post

On UNIX:
/URLib_path/updateURLibService &

Resetting URLibService

When there is an inconsistency between the data in the files and the data in the RAM (this may occur after a "disk quota exceeded" for example) the URLibService must be reset by stopping it first and then posting or starting it again using the -r option.

On Windows:
cd C:\URLib_path\col\dpi.inpe.br\banon\1998\08.02.08.56\doc
C:\URLib_path\col\iconet.com.br\banon\2010\06.17.00.19\doc\bin\wish85.exe post -- -x
C:\URLib_path\col\iconet.com.br\banon\2010\06.17.00.19\doc\bin\wish85.exe post -- -r

On UNIX:
/URLib_path/reset &

Environment change

At start, URLibService is prepared o recognized any environment changes such as: host name, domain name, ip address or home path changes.

On Windows, it uses the following commands:
under DOS
ping -n 1 localhost
under tcl
info hostname
under DOS
ping -n 1 hostname
under DOS
nslookup hostname

WARNING: the third and fourth commands must return the same ip. If not, you should update the data in the Internet Protocol (TCP/IP) Properties window (the ip must be the one returned by the nslookup command).

Setting your preferences

When starting URLibService for the first time, the window entitled Setting the Preferences will open. In this window you should set your preferences: language, (URLibService administrator) e-mail address, browser and port number.

Please read the online help in that window to know how to set your preferences.

On UNIX, if you are planning to use port 80, then the e-mail address must be urlibadm@a.domain.name (see Item iii of Basic requirements).

Opening the mirror page

By pressing the blue OB (Open your Browser) button on the top of the URLib window, a new window will open containing the default mirror page diplayed by your browser.

The mirror page is an interface that ofers several services like searching the local collection, submitting new documents and registering new users.

When opning the mirror page for the first time, as local administrator, you should register yourself by executing the following steps.

i. Click the following sequence:
About this Mirror>Advanced User Registration

ii. Fill out the field "eMail Address (Login)" with the e-mail address that you inform when setting your preference (see previous section: Setting your preferences) and press the Submit button.

iii. Enter your full name and password and press the Submit button.

With this password, you will be able to search hidden metadata and execute restricted commands to manage the local collection.