> For the complete documentation index, see [llms.txt](https://docs.lidistat67.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lidistat67.eu/installing-dependencies-logviewer.md).

# Installing dependencies (logviewer)

{% hint style="danger" %}
As this page involves editing security rules, please follow the instructions below. Failure to do so may expose your VPS to security vulnerabilities.
{% endhint %}

## Amending subnet rules

Start by going to your instance's page on Oracle. Scroll down to Instance details and click on your Virtual cloud network.

<figure><img src="/files/bI01wmqYp5yUTtWdsAee" alt=""><figcaption></figcaption></figure>

Go to Subnets and click on your subnet.

<figure><img src="/files/lSFgIVziDODFdDBHhp6F" alt=""><figcaption></figcaption></figure>

Go to Security and click on your security list.

<figure><img src="/files/WNJkg3uSi3pvRkIgZ5Ry" alt=""><figcaption></figcaption></figure>

Click on Security rules and click on Add Ingress Rules.

<figure><img src="/files/wU8jiJzyB8rZryfhsPy7" alt=""><figcaption></figcaption></figure>

Fill in the following:

Source Type: `CIDR` \
Source CIDR: `0.0.0.0/0` \
IP Protocol: `TCP` \
Source Port Range: Blank\
Destination Port Range: `8000` (if you are planning on hosting logviewer on a different port, change this to the port of your choice.)\
Description: Blank

Click on Add Ingress Rules to save your changes.

<figure><img src="/files/8eNACgtBsfdt1H7434Bq" alt=""><figcaption></figcaption></figure>

Now move over to your VPS in order to install additional dependencies.

## Python 3.9

Logviewer needs Python 3.9 in order to run. Don't worry as pipenv automatically detects which Python version to use and this won't interfere with your Modmail installation.

Begin by adding the deadsnakes ppa:

```
sudo add-apt-repository ppa:deadsnakes/ppa
```

Install Python 3.9 and its distutils:

```
sudo apt install python3.9 python3.9-distutils
```

## Amending iptables rules.

iptables will prevent your public IP from being accessed. Solve this by running:

```
sudo iptables -I INPUT -j ACCEPT
```

Save this change permanently by doing the following:

First of all, switch to the root account by running:

```
sudo su
```

Save the iptables change by running:

```
iptables-save > /etc/iptables/rules.v4
```

Exit from the root account by running:

```
exit
```

## PM2

{% hint style="info" %}
If you installed PM2 during [Installing dependencies](/installing-dependencies.md#pm2), you may skip this step
{% endhint %}

{% hint style="warning" %}
If you're not planning on using PM2, skip this section. PM2 is required for keeping your logviewer alive 24/7.
{% endhint %}

Start by installing node.js and npm:

```
sudo apt install nodejs npm
```

{% hint style="info" %}
npm depends on a considerable amount of packages. Expect this to take some time.
{% endhint %}

Install pm2 by running:

```
sudo npm i -g pm2
```
