> 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
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lidistat67.eu/installing-dependencies-logviewer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
