# CNStats STD/PRO 3.2 / User manual

© "CN-Software" Ltd. 2002-2008
support@cn-software.com
www.cnstats.com, www.cn-software.com

# Installation

## - If you haven`t any CNStats versions:

1. Download the last version of CNStats STD distribution kit at the official site.

Note: To obtain CNStats PRO distribution kit upon the purchase, please, contact "CN-Software",Ltd support team. (As a rule, the distribution kit is sent by e-mail).

2. Unpack the obtained archive (/cnstats folder with files and sub-directories ('sub-folders') will be created);

3. Copy /cnstats with its contents to the root directory of your web-site. As a rule it is executed with the help of an FTP-client.

As a result,/cnstats directory should appear at the server. All further installation steps presume /cnstats directory.

Note: CNStats can function in any directory or even in the server root.

The directory structure should be as follows:

- root directory of the web-site/
  - cnstats/
    - graph/
    - img/
    - lang/
    - manual/
    - ...
    - _funct.php
    - index.php

4. Run installation script by indicating /install/index.php location in the address box of your browser, for instance: http://yours.server.com/cnstats/install/. As a result, a dialogue box will appear on the screen;

5. Enter the following data:

- MySql: server, login, password - data, required for the MySql server connection. The fields "Server", "Login" and "Password" are filled in with standard values ("localhost", "root" and blank password correspondingly) by default. Enter your own data or data given by your hosting providers or database administrators.
- MySql: database name - name of the database, where tables for statistics storage will be created by the MySql server. Default name is "cnstats"; it is possible to choose any.
- MySql: prefix for CNStats tables - prefix for CNStats tables names. Owing to it, you can use CNStats even if your hosting-provider supplied you with access to only one database;
- Registration domain - Domain, for which the register key is given (or will be given);
- Login - Login for the statistics interface;
- Password - Password for the statistics interface;
- Administrator's e-mail - E-Mail for receiving CNStats errors notifications; the specified address will be also used as the return address for reports, sent by e-mail;
- Save statistics for the period of - period of full data storage in days (40 days by default). Summary statistics is stored for the whole period of the site existence;
- Type of the counter - For detailed information, please, refer to "Counter Types";

Further you may change necessary data by editing config.php.

6. After clicking the "Next" button all necessary tables will be created in the database. If the database does not exist, the installation script will try to create it.

Then the contents of the configuration file will be displayed; you should create 'config.php' file in /cnstats folder on the web-server and insert these data.

7. Delete ./install/ folder from the server.

8. Indicate the path to the installed program in the browser, for instance http://yours.server.com/cnstats/. Select CNStats interface language from the pop-up menu, then enter E-Mail and password which you have specified during installation: the application`s main window should appear in the browser.

9. Get the register key at members area (for licensed version) or at a free register key page (for a trial usage);

10. Enter the obtained register key into the corresponding field at the registration page;

11. Further you should get the statistics code (mandatory) and the counter code (optionally) from the menu section "Configuration" -> "Counter code" and install it into all web-pages of your web-site. (For detailed information about types of counter code, please, refer to "Counter Types")

12. Open any web-page where you have installed the code. Check the correctness of the installation visually.

13. Enter menu section "Miscellaneous" -> "View log". Make sure that your visit has been counted and the system has started accumulating statistics.

## The next installation steps should be performed only for CNStats PRO edition.

14. Set rights for files cnstats/reports/cnstats_midnight.pl and cnstats/reports/cnstats_night.pl. These files should be run by a task planner, for example crontab. These files sould not be run by outside visitors. In Unix systems these rights are usually set with the help of chmod command:

    chmod 700 /path/to/your/site/cnstats/reports/cnstats_midnight.pl
    chmod 700 /path/to/your/site/cnstats/reports/cnstats_night.pl

15. Add the following tasks to the task planner (for example, crontab):

    0   0 * * * /path/to/your/site/cnstats/reports/cnstats_midnight.pl
    18  0 * * * /path/to/your/site/cnstats/reports/cnstats_night.pl

Perl-script cnstats_midnight.pl should be executed exaclty at midnight, it does not make vast amount of calculations and almost does not overload the server.

Perl-script cnstats_night.pl should be executed right after cnstats_midnight.pl, but it may load the server; therefore, it is recommended to run the script at the time of minimun workload of the server. As a rule, it is 3-5 a.m.

In the given example cnstats_night.pl is run at 0.18 a.m. - it is the best compromise.

Back | Manual index | Next