Installation of the chat server:
------------------------------

Required:

- Java runtime environment ( 1.4 or later)
	http://java.sun.com

Instructions:

Note: These instructions worked fine on a Debian Sarge installation.
	They should work on other systems too. But maybe you have to adjust
	some parts for the chat system to work properly on your system.

Quick install:

Enter the ILIAS Administration as user root

Configure the chat server in 'Administration -> Chat settings'
Now you can start the chatserver by typing

	java -jar YOUR_ILIAS_ROOT_DIRECTORY/Modules/Chat/chatserver/chatserver.jar YOUR_ILIAS_DATA_DIRECTORY/YOUR_ILIAS_CLIENT/chat/server.ini &


To start the webserver automatically at boottime, follow these instructions:


Change to the super user root

	bash$ su

Type in your root password

Change the working directory and create a file named chatserver

	bash$ cd /etc/init.d	# Adjust this path according to your distribution
	bash$ vi chatserver

with this content

	#!/bin/bash

	JAVABIN=/usr/bin/java
	ILIASDIR=/var/www/ilias		# Type in the root directory of your ILIAS installation
	ILIAS_DATA_DIR=/var/www/data # Type in the ILIAS Data directory (outside webspace)
	USER=wwwrun				    # Type in the user who should run the chatserver
	CLIENT=test38x				# Type in the exact name of your ILIAS client

	case "$1" in
		start)
			if [ -f /tmp/chatserver.pid ]
			then
				echo "The chat server seems to be running. Type 'chatserver stop' or remove the file '/tmp/chatserver.pid' manually"
				exit 1
			fi
			echo "Starting chat server"
			su -c "$JAVABIN -jar $ILIASDIR/Modules/Chat/chatserver/chatserver.jar $ILIAS_DATA_DIR/$CLIENT/chat/server.ini" $USER &
			echo $! > /tmp/chatserver.pid
			;;

		stop)
			echo "Shutting down chatserver"
			{
				kill `cat /tmp/chatserver.pid`
				unlink /tmp/chatserver.pid
			} 2> /dev/null
			;;

		restart)
			$0 stop
			sleep 2
			$0 start
			;;

		*)
			echo "Usage: $0 {start|stop|restart}"
			exit 1
	esac

	exit 0

change the file permissions by typing

	bash$ chmod 755 chatserver

you can start the chat server by typing

	bash$ /etc/init.d/chatserver start

stop it

	bash$ /etc/init.d/chatserver stop

or restart it

	bash$ /etc/init.d/chatserver restart

You can start the chatserver automatically at boottime by linking 'chatserver'
to one of the /etc/rcX.d ( X indicates the specific runlevel).

Finally enable the ILIAS chat module in 'Administration -> Chat settings'.

Remark:
	Logout and login to ILIAS after each chatserver restart. This is required for the chatserver authentication.

Description of server.ini params:

	LogLevel = [0-6]			# OFF,FATAL,ERROR,INFO,WARN,DEBUG,ALL
	LogFile = PATH				# Absolute path to chatserver logfile
    IpAddress = IP              # internal IP address of the chatserver
    ExternalIpAddress = IP      # external IP address of the chatserver
	ModeratorPassword = PWD		# Used for ILIAS 3 installations
	Port = PORT					# Port of chatserver
	HeaderFileName = PATH		# Path to HTML header file. Use default generated by ILIAS
	FooterFileName = PATH		# Path to HTML header file. Use default generated by ILIAS
	Authentication = [0 or 1]   # En/Disable authentication for chatserver
	AllowedHosts = IP,...		# List of hosts which are allowed to access the chatserver e.g '192.168.1.1,192,168.1.2'
								# Please enter only the ILIAS server IP address.
