================================
DENORA INSTALLATION INSTRUCTIONS
================================

***
PLEASE READ:
This document is intended for Unix-based systems ONLY. To install the Denora binareis on Windows, please see the QUICKSTART.txt file. To self-compile Denora on Windows, please see the docs/WIN32.txt file. ***

Table of contents
-----------------
1. Requirements
2. Installing Denora
2.1 Quick install
2.2 Detailed instructions
3. Upgrading Denora
4. Setting up the IRCd
5. Setting up the MySQL server
6. Starting Denora
7. Setting up a crontab

You should also read the README and FAQ files!

1. Requirements
---------------

A. C compiler, Denora should be able to compile with gcc3/4, cc, and win32 cl (note gcc2 althought may work is not 100% supported any more)
B. *nix or Windows operating systems (sorry Mac OS 9 users)
C. If you want MySQL support you need to have mysql development libs installed, v4 or later

2. Installing Denora
--------------------

IMPORTANT NOTE: it is not recommended to use (and therefore install) Denora as root. Use an unprivileged user instead -- the one you're using for the ircd or a dedicated one will be good enough.

2.1 Quick Install in 10 steps
-----------------------------
1. Download the latest Denora package from http://www.denorastats.org/
2. Unpack it using the non-root user that will run it later
3. Change to the Denora directory (cd denora)
4. Type ./Config and follow instructions on-screen
5. Type make
6. Type make install
7. Change to the directory Denora was installed to (specified during ./Config)
8. Copy example.conf to denora.conf
9. Edit denora.conf (read the file carefully!)
10. Start Denora by typing ./stats
Read the COMMANDS file for a list of commands you can use.

If you get lost at any point, just read the detailed installation instructions just below.

2.2 Detailed Install instructions
---------------------------------
The very first thing you need to do is to get the Denora package (if not already done). You can find it at the following place:

http://www.denorastats.org/

Next, unpack the package in your home directory, and go into the created directory.

Now type ./Config to start the configuration script. It will ask you a few questions, and figure out how to compile Denora on your system. If you are unsure about the answer to a question, use the default value.

NOTE: although you may specify different binary and data paths, it is RECOMMENDED that you use the same value for both.

You can now type make to compile Denora. If there are errors in the Makefile, *try to use gmake* instead. If it still doesn't work, you (or the system administrator if it's a shell) must install GNU make. You may find it at ftp://prep.ai.mit.edu/pub/gnu/.

Now type make install (or gmake install; see above). This will install all the needed files in the paths you specified with the configure script, and setup file permissions. You should ensure that the data directory is not accessible by other users, as malicious users may cause troubles on your network if passwords are not encrypted, or read the memos of any user.

If you see errors during this process, please mail us with the *complete* error output, and don't forget to mention your OS, compiler and C library versions.

Now go into the data directory (by default, ~/stats). Copy the example.conf file to denora.conf, and open the latter with your favorite text editor. It contains all the configuration directives Denora will use at startup. Read the instructions contained in the file carefully. Using the default values is NOT a good idea, and will most likely not work!


If you need help, you could join the Denora support channel and try to solve your doubts or get help from other users.
See the README file for more information.


3. Upgrading Denora
-------------------

If you got a .diff file and want to patch the old Denora sources with it, do the following:
* Copy the .diff file into the root Denora sources directory.
* Type patch -p1
If you are using the git version, simply go to your Denora sources directory and type:
git pull

To upgrade Denora, just follow the installation instructions described in section 2.

You also will need to:
* run ./mydbgen script again to update missing MySQL tables and columns
* update your denora.conf ( see the Changes.conf file and also the example.conf )

4. Setting up the IRCd
----------------------

Stats acts as an IRC server with pseudo-clients on it. To link them to your network, you'll need to add some lines in the ircd.conf of their hub server (as stated in the Connect:hostname configuration directive).

For samples below we'll take stats.localhost.net as the name of the Stats (as stated in the identity:name configuration directive). Note that this samples are made to be as generic as possible, but there might be small variations, depending on your IRCd. For IRCd-specific help with configuration, read near the end of this section.

First, the C/N lines, that allow Stats to link. They also need a Y:line to work correctly.

Y:27:180:0:0:4000000
C:127.0.0.1:mypass:services.localhost.net::30
N:127.0.0.1:mypass:services.localhost.net::30

"mypass" is the same password you mentioned in the Connect:passwd configuration directive. 127.0.0.1 is the IP from which Stats connect from (linking in localhost is the most efficient way to run Stats).

Don't forget to /rehash your IRCd to apply changes.

A new trend in ircd configuration is popping all over the place, good examples are the latest Hybrid, Unreal and Bahamut, which use a more "readable" form of configuration. For those, use something like:
        link stats.localhost.net
        {
            username        *;
            hostname        localhost;
            bind-ip         *;
            port            6667;
            hub             *;
            password-connect "mypass";
            password-receive "mypass";
            class           servers;
        };
Note that this block-style configuration files differ heavily, depending on the IRCd. Read your IRCd documentation for more details on the exact configuration used by your IRCd.

5. Setting up the MySQL server
------------------------------

Provided with Denora is a simple configuration script which will guide you through the creation of the tables. "mydbgen", this can be found in the *binaries installation directory ( by default this is ~/stats ). To use the script type : ./mydbgen in your *binaries directory and answer the questions.

* On installations with data directory you need to run "mydbgen" from your data directory.

The sql schedume files can be found in the installation directory in a folder called "sql", you can use this to directly import the tables into sql via command line utilities or web interfaces. IMPORTANT: first import denora.sql, then the .sql file corresponding to your ircd!


6. Starting Denora
------------------

Go into the directory where binaries were installed (by default, this is ~/stats). Type ./stats to launch Denora.

If there are syntax errors in the configuration file they will be displayed on the screen. Correct them until there are no errors anymore. A successful startup won't generate any message.

Give Stats at least one minute to link to your network, as certain IRCds on some OSes may be really slow for the link process. If nothing happens after about a minute, it is probably a configuration problem. Try to launch Denora with ./stats -debug -nofork to see any errors that it encounters, and try to correct them.

If you need help to solve errors, feel free to join our support channel, ask for help there. See the README file for details.


7. Setting up a crontab
-----------------------

A crontab entry will allow you to check periodically whether Denora is still running, and restart it if not. You'll need to have Denora binaries and data installed in the same directory for this to work without modification.

First rename the example.chk script that is in Denora path (by default, this is ~/stats) to stats.chk and edit it. You'll need to modify the CONFIGURATION part of the file. Then ensure that the file is marked as executable by typing chmod +x stats.chk, and try to launch the script to see if it works (Denora must not be running when you do this ;))

When this is done, you'll have to add the crontab entry. Type crontab -e. This will open the default text editor with the crontab file. Enter the following (with correct path):

*/5 * * * * /home/ircd/stats/stats.chk >/dev/null 2>&1

The */5 at the beginning means "check every 5 minutes". You may replace the 5 with other another number if you want (but less than 60). Consult your system's manual pages for more details on the syntax of the crontab file. Interesting manpages are crontab(5), crontab(1) and cron(8).

Save and exit, and it's installed.

8. Languages
-----------------------

Languages are set in two places, the general network language this is used for messages on the network and logs. The other is the admin language for when StatServ talks back to the user

1. English
2. Spanish
3. German
4. French
5. Dutch
6. Italian
7. Russian
8. Portuguese

--