-*- mode: text; mode: auto-fill -*-
$Id: INSTALL 4898 2008-04-13 07:21:02Z cher $

Brief instructions for installation of ejudge system
====================================================
This section describes the ejudge installation process, which
requires minimal manual configuration. This method of
installation is recommented for novice users. If this method of
installation does not work on your system, or you are not
satisfied with the default settings, you should read the verbose
manual further in this file.

So, installation step by step
-----------------------------
1. Create a new user `ejudge' with the home directory as
`/home/ejudge'. Create a separate user group `ejudge' with the
only member `ejudge'. If you don't know how to create new users,
please, refer to the system manuals.
2. Create a new directory `/home/judges'. The owner of this
directory must be `ejudge', and the group must be `ejudge' as
well. The root privilegies are required to create this
directory, so become root and issue the following commands:
mkdir /home/judges
chown ejudge:ejudge /home/judges
3. Log in as the `ejudge' users, unpack, compile and install the
reuse library in the home directory.

cd ~
tar xvfz REUSE-ARCH-DIR/reuse-VERSION.tgz
cd reuse/source
./configure
make
make install

Here REUSE-ARCH-DIR is the directory where the reuse library
archive is downloaded. VERSION is the library version. Always
use the latest version (as of this writing it is 4.3.5).
4. Change directory to the home directory and unpack the ejudge archive.

cd ~
tar xvfz EJUDGE-ARCH-DIR/ejudge-VERSION.tgz
cd ejudge

5. Configure the ejudge

./configure --prefix=/home/ejudge/inst-ejudge --with-reuse=/home/ejudge/reuse --enable-contests-home-dir=/home/judges --with-httpd-cgi-bin-dir=CGI-BIN-DIR --with-httpd-htdocs-dir=HTDOCS-DIR --enable-ajax --enable-hidden-server-bins --enable-local-dir=/var/lib/ejudge

Here CGI-BIN-DIR is the CGI directory of your web server
installation (for example, `/home/httpd/cgi-bin'), HTDOCS-DIR is
the root of the HTML documents of your web server installation
(for example, `/home/httpd/html'). Refer to your system manuals
for exact information on this paths.
6. Compile and install the ejudge system.

make
make install

7. Run the `ejudge-setup' program, go to the "Administrator
 identity" menu and fill up the required fields:

./ejudge-setup
Admin ID:       1
Admin Login:    ejudge
Admin e-mail:   YOUR-E-MAIL
Admin name:     Ejudge administrator
Admin password: PASSWORD

Then generate the setup script using the "Save setup script"
menu item. When you invoke this menu item, the setup script file
name will be requested. Preserve the default name `ejudge-install.sh'.

8. Enter the "Setup compilers" menu and check, that all
compilers and interpreters are auto-detected correctly. Edit
paths, if necessary.

9. Invoke the setup script as the root user.
su -
cd ~ejudge/ejudge
./ejudge-install.sh

10. Start the ejudge system. The programs must be started by the
`ejudge' user.

ejudge-control start

11. Download the DoJo Toolkit
(http://download.dojotoolkit.org/release-0.4.3/dojo-0.4.3-ajax.tar.gz).
Install it to HTDOCS-DIR/ejudge:
cd HTDOCS-DIR/ejudge
tar xvf dojo-0.4.3-ajax.tar.gz
mv dojo-0.4.3-ajax/* .

Make sure, that the access permissions of the `/home/ejudge'
directory allows reading of files for arbitrary users. Some
Linux distributions by default create the user home directory
with the 0700 permissions. In this case the ejudge CGI-programs
and the necessary libraries will be unavailable for the
web-server. So, the permissions for the `/home/ejudge' directory
should be changed to 0755 or 0775.

For the Fedora Core distributions make sure, that the SELinux
module is disabled. Check the SELinux configuration file
`/etc/selinux/config'. For more information (or, if you want to
configure the SELinux for the ejudge system) refer to the
SELinux documentation (man selinux).

The installation of the ejudge system is complete. Now you can
test the installation typing the
`http://localhost/cgi-bin/serve-control' URL in the web browser.
Of course, the web server should be started.

For the full installation documenation please, refer to the
wiki-pages at http://www.ejudge.ru.

