<commit_before># Repository Installation and Administration Guide

.fx:cover

@conwet
---
## System Requirements

.fx: section-title

---

### Hardware Requirements
The following table contains the minimum resource requirements for running the Repository: 

* CPU: 1-2 cores with at least 2.4 GHZ</br>
* Physical RAM: 1G-2GB</br>
* Disk Space: 25GB The actual disk space depends on the amount of data being stored within the Repositories NoSQL database System.

---
## Operating System Support
The Repository has been tested in the following Operating Systems:

* Ubuntu 12.04, 14.04
* CentOS 6.3, 6.5, 7.0

---
## Software Requirements 
In order to have the Repository running, the following software is needed. However, these dependencies are not meant to be installed manually in this step, as they will be installed throughout the documentation:

* MongoDB 2.x - mandatory
* Java 1.8.x - mandatory
* Virtuoso 7.x - mandatory
* Application Server, Apache Tomcat 8.x - mandatory
* Repository Software - mandatory
* Mongo Shell - optional (JavaScript shell that allows you to execute commands on the internal data store of the Repository from the command line)

---
## Software Requirements 
To install the required version of Virtuoso, it is needed to compile it from its sources. In this way, the installation of Virtuoso has some extra requirements, that will be also installed throughout this document.

* autoconf
* automake
* libtool
* flex
* bison
* gperf
* gawk
* m4
* make
* openssl
* openssl-devel

---
## Software Installation

.fx: section-title

---
## Getting the Repository software

The packaged version of the Repository software can be downloaded from: 
* The FIWARE Files page (https://forge.fiware.org/frs/?group_id=7)
* The FIWARE catalgue (http://catalogue.fiware.org/enablers/downloads-10).

This package contains the war file of the Repository as well as the intallation scripts used in this document.

---
## Getting the Repository software

Alternatively, it is possible to install the Repository from the sources published in GitHub. To clone the repository, the git package is needed:

<pre>
# Ubuntu/Debian
# apt-get install git

# CentOS
# yum -y install git
</pre>
---
## Getting the Repository software
To download the source code usig git, execute the following command:

<pre>
# git clone https://github.com/conwetlab/Repository-RI.git
</pre>

---
## Installing the Repository using scripts

In order to facilitate the installation of the Repository, the script *install.sh* has been provided. This script installs all needed dependencies, configures the repository and deploys it. To use this script execute the following command:

    $ ./install.sh

---
## Installing the Repository using scripts

The installation script also optionally resolves the extra dependencies that are needed for the installation of Virtuoso.

<pre>
Some packages are needed for installing Virtuoso: autoconf, automake, libtoo, flex, bison, gperf, gawk, m4, make, openssl, openssl-devel
Do you want to install them? Y/N
</pre>

---
## Installing the Repository using scripts
Finally, the installation script allows to configure the OAuth2 user authentication.

<pre>
Do you want to activate OAuth2 authentication in the Repository? Y/N
y

The default OAuth2 enpoint is http://account.lab.fiware.org
Do you want to provide a different idm enpoint? Y/N
n

What is your FIWARE Client id?
[client id]

What is your FIWARE Client Secret?
[client secret]
</pre>

---
## Manually installing the Repository

#### Ubuntu/Debian

All the mandatory dependencies can be easily installed on a debian based Linux distribution using diferent scripts:<commit_msg>Include callback URL in an example output in the instalation guide<commit_after># Repository Installation and Administration Guide

.fx:cover

@conwet
---
## System Requirements

.fx: section-title

---

### Hardware Requirements
The following table contains the minimum resource requirements for running the Repository: 

* CPU: 1-2 cores with at least 2.4 GHZ</br>
* Physical RAM: 1G-2GB</br>
* Disk Space: 25GB The actual disk space depends on the amount of data being stored within the Repositories NoSQL database System.

---
## Operating System Support
The Repository has been tested in the following Operating Systems:

* Ubuntu 12.04, 14.04
* CentOS 6.3, 6.5, 7.0

---
## Software Requirements 
In order to have the Repository running, the following software is needed. However, these dependencies are not meant to be installed manually in this step, as they will be installed throughout the documentation:

* MongoDB 2.x - mandatory
* Java 1.8.x - mandatory
* Virtuoso 7.x - mandatory
* Application Server, Apache Tomcat 8.x - mandatory
* Repository Software - mandatory
* Mongo Shell - optional (JavaScript shell that allows you to execute commands on the internal data store of the Repository from the command line)

---
## Software Requirements 
To install the required version of Virtuoso, it is needed to compile it from its sources. In this way, the installation of Virtuoso has some extra requirements, that will be also installed throughout this document.

* autoconf
* automake
* libtool
* flex
* bison
* gperf
* gawk
* m4
* make
* openssl
* openssl-devel

---
## Software Installation

.fx: section-title

---
## Getting the Repository software

The packaged version of the Repository software can be downloaded from: 
* The FIWARE Files page (https://forge.fiware.org/frs/?group_id=7)
* The FIWARE catalgue (http://catalogue.fiware.org/enablers/downloads-10).

This package contains the war file of the Repository as well as the intallation scripts used in this document.

---
## Getting the Repository software

Alternatively, it is possible to install the Repository from the sources published in GitHub. To clone the repository, the git package is needed:

<pre>
# Ubuntu/Debian
# apt-get install git

# CentOS
# yum -y install git
</pre>
---
## Getting the Repository software
To download the source code usig git, execute the following command:

<pre>
# git clone https://github.com/conwetlab/Repository-RI.git
</pre>

---
## Installing the Repository using scripts

In order to facilitate the installation of the Repository, the script *install.sh* has been provided. This script installs all needed dependencies, configures the repository and deploys it. To use this script execute the following command:

    $ ./install.sh

---
## Installing the Repository using scripts

The installation script also optionally resolves the extra dependencies that are needed for the installation of Virtuoso.

<pre>
Some packages are needed for installing Virtuoso: autoconf, automake, libtoo, flex, bison, gperf, gawk, m4, make, openssl, openssl-devel
Do you want to install them? Y/N
</pre>

---
## Installing the Repository using scripts
Finally, the installation script allows to configure the OAuth2 user authentication.

<pre>
Do you want to activate OAuth2 authentication in the Repository? Y/N
y

The default OAuth2 enpoint is http://account.lab.fiware.org
Do you want to provide a different idm enpoint? Y/N
n

What is your FIWARE Client id?
[client id]

What is your FIWARE Client Secret?
[client secret]

What is your Callback URL?
http://[host]:[port]/FiwareRepository/v2/callback
</pre>

---
## Manually installing the Repository

#### Ubuntu/Debian

All the mandatory dependencies can be easily installed on a debian based Linux distribution using diferent scripts:
{'fraction_non_alphanumeric': 0.07350771294433266, 'fraction_numerical': 0.009523809523809525, 'mean_word_length': 4.195818815331011, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4120241', 'n_tokens_mistral': 2137, 'n_tokens_neox': 2008, 'n_words': 979}