README.md 2.99 KB
Newer Older
Envel Le Hir's avatar
Envel Le Hir committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
## Description

Denelezh is a website that allows you to explore the gender gap in the content of Wikidata and Wikimedia projects. Data can be aggregated by Wikimedia project and/or by characteristics of human beings (year of birth, country of citizenship, and occupation).

`denelezh-core` is a PHP project. It handles both the import of the data from Wikidata (except for a little part explained later) and the visualization.

## Installation

This documentation covers the installation of Denelezh under a Linux system, at the URL `https://www.denelezh.org/`.

### Requirements

* MySQL 5.7 (compatibility with MariaDB has not been tested)
* a web server (seems OK with Apache and nginx)
* PHP 5.6 (seems OK with PHP 7.2)
* Java 8 (seems OK with Java 10)

### MySQL

Denelezh needs a MySQL database.

You can install the MySQL server using the [official repositories](https://dev.mysql.com/downloads/repo/).

Create a new database on your MySQL server:

    CREATE DATABASE `denelezh` DEFAULT CHARACTER SET 'utf8mb4';

Create a user (change the password):

    CREATE USER 'denelezh'@'localhost' IDENTIFIED BY 'xxxxxxx';

Grant to the user all rights to the database:

    GRANT ALL ON `denelezh`.* TO 'denelezh'@'localhost';

Envel Le Hir's avatar
Envel Le Hir committed
36 37 38 39
Grant to the user the right to access files:

    GRANT FILE on *.* to 'denelezh'@'localhost';

Envel Le Hir's avatar
Envel Le Hir committed
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
Initialize the schema with the script `doc/schema.sql`.

### Web server

Copy all files from the project `denelezh-core` into `/var/www/denelezh.org`.

Configure a new site on your web server, with `/var/www/denelezh.org/www` as the root directory.

An example of nginx site configuration is available in `doc/nginx.example.conf`.

### Imports

A step of the import is done by the project [`denelezh-import`](https://framagit.org/wikimedia-france/denelezh-import).

Copy the file `denelezh-import.jar` (generated by the project `denelezh-import`) into the `scripts` directory.

By default, Wikidata JSON dumps are stored in `/home/wikidata/dumpfiles` (see the project `denelezh-import` to change that). This directory must be readable and writable by the user who starts the imports.

## Configuration

Create the file `conf/conf.inc.php`, using the example `conf/conf.example.php`.

Most important variables are:

* `DB_HOST`: host of the MySQL server
* `DB_USER`: MySQL user
* `DB_PASSWORD`: password of the MySQL user
* `DB_NAME`: name of the schema
* `SITE_DIR`: URL of Denelezh
* `SITE_STATIC_DIR`: URL of the directory with static web resources of Denelezh

## Imports

To start an import, go into the `scripts` directory and use the following command:

    bash import.sh

By default, the import use the last JSON dump, downloading it if it is not already present on the server.

You can import another dump by specifying the date of the dump as a parameter:

    bash import.sh 20180604

In that case, the JSON dump must be already present on the server.

## Copyright

This project is under AGPLv3 license. See LICENSE and NOTICE files.

## See also

* [denelezh-import](https://framagit.org/wikimedia-france/denelezh-import)