Skip to content

Commit df5e79d

Browse files
committed
Installation instruction update
1 parent 65de2f8 commit df5e79d

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

README.md

+28-21
Original file line numberDiff line numberDiff line change
@@ -61,27 +61,6 @@ postgres=# \q
6161
```
6262

6363

64-
### Set Up Python Environment
65-
66-
Install Python:
67-
```
68-
# apt-get install -y python3.6 python3-pip
69-
```
70-
71-
Install psycopg2:
72-
```
73-
# sudo apt-get install python3-psycopg2
74-
```
75-
76-
77-
### Gunicorn Setup
78-
79-
Install Gunicorn:
80-
```
81-
# pip3 install gunicorn
82-
```
83-
84-
8564
### Ntmap Setup
8665

8766
Download the latest release from GitHub as a ZIP archive and extract it to your desired path. In this example, we'll use /opt/ntmap.
@@ -108,6 +87,34 @@ Edit Ntmap frontend settings. You need to set NETBOX_URL in settings.js to point
10887
# nano settings.js # change Netbox URL here
10988
```
11089

90+
91+
### Python & Gunicorn Setup
92+
93+
Install Python:
94+
```
95+
# apt-get install -y python3.6 python3-pip
96+
```
97+
98+
We'll use a Python virtual environment to ensure Ntmap's required packages don't conflict with anything in the base system. This will create a directory named venv in our Ntmap root.
99+
```
100+
# sudo apt-get install python3.6-venv
101+
# sudo python3.6 -m venv /opt/ntmap/venv
102+
# source /opt/ntmap/venv/bin/activate
103+
```
104+
105+
Install psycopg2:
106+
```
107+
(venv) # pip3 install psycopg2-binary
108+
```
109+
110+
Install Gunicorn:
111+
```
112+
(venv) # pip3 install gunicorn
113+
(venv) # deactivate
114+
```
115+
116+
### Service Setup
117+
111118
Add ntmap user to your system:
112119
```
113120
# groupadd --system ntmap

install/ntmap.service

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Group=ntmap
1212
PIDFile=/var/tmp/ntmap.pid
1313
WorkingDirectory=/opt/ntmap/backend
1414

15-
ExecStart=/usr/local/bin/gunicorn --pid /var/tmp/ntmap.pid --pythonpath /opt/ntmap/backend --config /opt/ntmap/backend/gunicorn.py wsgi
15+
ExecStart=/opt/ntmap/venv/bin/gunicorn --pid /var/tmp/ntmap.pid --pythonpath /opt/ntmap/backend --config /opt/ntmap/backend/gunicorn.py wsgi
1616

1717
Restart=on-failure
1818
RestartSec=30

0 commit comments

Comments
 (0)