You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/installation/1-postgresql.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ NetBox requires a PostgreSQL database to store data. This can be hosted locally
4
4
The installation instructions provided here have been tested to work on Ubuntu 18.04 and CentOS 7.5. The particular commands needed to install dependencies on other distributions may vary significantly. Unfortunately, this is outside the control of the NetBox maintainers. Please consult your distribution's documentation for assistance with any errors.
5
5
6
6
!!! warning
7
-
NetBox v2.2 and later requires PostgreSQL 9.4 or higher.
Copy file name to clipboardExpand all lines: docs/installation/2-netbox.md
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -212,15 +212,7 @@ Superuser created successfully.
212
212
```no-highlight
213
213
# python3 manage.py collectstatic --no-input
214
214
215
-
You have requested to collect static files at the destination
216
-
location as specified in your settings:
217
-
218
-
/opt/netbox/netbox/static
219
-
220
-
This will overwrite existing files!
221
-
Are you sure you want to do this?
222
-
223
-
Type 'yes' to continue, or 'no' to cancel: yes
215
+
959 static files copied to '/opt/netbox/netbox/static'.
224
216
```
225
217
226
218
# Load Initial Data (Optional)
@@ -254,3 +246,11 @@ Next, connect to the name or IP of the server (as defined in `ALLOWED_HOSTS`) on
254
246
255
247
!!! warning
256
248
If the test service does not run, or you cannot reach the NetBox home page, something has gone wrong. Do not proceed with the rest of this guide until the installation has been corrected.
249
+
250
+
Note that the initial UI will be locked down for non-authenticated users.
251
+
252
+

253
+
254
+
After logging in as the superuser you created earlier, all areas of the UI will be available.
255
+
256
+

Copy file name to clipboardExpand all lines: docs/installation/3-http-daemon.md
+28-84Lines changed: 28 additions & 84 deletions
Original file line number
Diff line number
Diff line change
@@ -107,99 +107,26 @@ Install gunicorn:
107
107
# pip3 install gunicorn
108
108
```
109
109
110
-
Save the following configuration in the root NetBox installation path as `gunicorn_config.py` (e.g.`/opt/netbox/gunicorn_config.py` per our example installation). Be sure to verify the location of the gunicorn executable on your server (e.g. `which gunicorn`) and to update the `pythonpath` variable if needed. If using CentOS/RHEL, change the username from `www-data`to `nginx` or `apache`. More info on `max_requests` can be found in the [gunicorn docs](https://docs.gunicorn.org/en/stable/settings.html#max-requests).
110
+
Copy `contrib/gunicorn.conf` to`/opt/netbox/gunicorn.conf`. We make a copy of this file to ensure that any changes to it do not get overwritten by a future upgrade.
111
111
112
112
```no-highlight
113
-
command = '/usr/bin/gunicorn'
114
-
pythonpath = '/opt/netbox/netbox'
115
-
bind = '127.0.0.1:8001'
116
-
workers = 3
117
-
user = 'www-data'
118
-
max_requests = 5000
119
-
max_requests_jitter = 500
113
+
# cp contrib/gunicorn.py /opt/netbox/gunicorn.py
120
114
```
121
115
122
-
# systemd configuration
123
-
124
-
Copy or link contrib/netbox.service and contrib/netbox-rq.service to /etc/systemd/system/netbox.service and /etc/systemd/system/netbox-rq.service
125
-
126
-
```no-highlight
127
-
# cp contrib/netbox.service to /etc/systemd/system/netbox.service
128
-
# cp contrib/netbox-rq.service to /etc/systemd/system/netbox-rq.service
129
-
```
130
-
131
-
Edit /etc/systemd/system/netbox.service and /etc/systemd/system/netbox-rq.service. Be sure to verify the location of the gunicorn executable on your server (e.g. `which gunicorn`). If using CentOS/RHEL, change the username from `www-data` to `nginx` or `apache`:
Copy contrib/netbox.env to /etc/sysconfig/netbox.env
143
-
144
-
```no-highlight
145
-
# cp contrib/netbox.env to /etc/sysconfig/netbox.env
146
-
```
147
-
148
-
Edit /etc/sysconfig/netbox.env and change the settings as required. Update the `WorkingDirectory` variable if needed.
149
-
150
-
```no-highlight
151
-
# Name is the Process Name
152
-
#
153
-
Name = 'Netbox'
116
+
You may wish to edit this file to change the bound IP address or port number, or to make performance-related adjustments.
154
117
155
-
# ConfigPath is the path to the gunicorn config file.
156
-
#
157
-
ConfigPath=/opt/netbox/gunicorn.conf
158
-
159
-
# WorkingDirectory is the Working Directory for Netbox.
160
-
#
161
-
WorkingDirectory=/opt/netbox/
162
-
163
-
# PidPath is the path to the pid for the netbox WSGI
164
-
#
165
-
PidPath=/var/run/netbox.pid
166
-
```
118
+
# systemd configuration
167
119
168
-
Copy contrib/gunicorn.conf to gunicorn.conf
120
+
We'll use systemd to control the daemonization of NetBox services. First, copy `contrib/netbox.service` and `contrib/netbox-rq.service` to the `/etc/systemd/system/` directory:
169
121
170
122
```no-highlight
171
-
# cp contrib/gunicorn.conf to gunicorn.conf
123
+
# cp contrib/*.service /etc/systemd/system/
172
124
```
173
125
174
-
Edit gunicorn.conf and change the settings as required.
126
+
!!! note
127
+
These service files assume that gunicorn is installed at `/usr/local/bin/gunicorn`. If the output of `which gunicorn` indicates a different path, you'll need to correct the `ExecStart` path in both files.
175
128
176
-
```
177
-
# Bind is the ip and port that the Netbox WSGI should bind to
178
-
#
179
-
bind='127.0.0.1:8001'
180
-
181
-
# Workers is the number of workers that GUnicorn should spawn.
182
-
# Workers should be: cores * 2 + 1. So if you have 8 cores, it would be 17.
183
-
#
184
-
workers=3
185
-
186
-
# Threads
187
-
# The number of threads for handling requests
188
-
# Threads should be: cores * 2 + 1. So if you have 4 cores, it would be 9.
189
-
#
190
-
threads=3
191
-
192
-
# Timeout is the timeout between gunicorn receiving a request and returning a response (or failing with a 500 error)
193
-
#
194
-
timeout=120
195
-
196
-
# ErrorLog
197
-
# ErrorLog is the logfile for the ErrorLog
198
-
#
199
-
errorlog='/opt/netbox/netbox.log'
200
-
```
201
-
202
-
Finally, start the `netbox` and `netbox-rq` services and enable them to initiate at boot time:
129
+
Then, start the `netbox` and `netbox-rq` services and enable them to initiate at boot time:
203
130
204
131
```no-highlight
205
132
# systemctl daemon-reload
@@ -209,7 +136,24 @@ Finally, start the `netbox` and `netbox-rq` services and enable them to initiate
209
136
# systemctl enable netbox-rq.service
210
137
```
211
138
212
-
At this point, you should be able to connect to the nginx HTTP service at the server name or IP address you provided. If you are unable to connect, check that the nginx service is running and properly configured. If you receive a 502 (bad gateway) error, this indicates that gunicorn is misconfigured or not running.
139
+
You can use the command `systemctl status netbox` to verify that the WSGI service is running:
At this point, you should be able to connect to the HTTP service at the server name or IP address you provided. If you are unable to connect, check that the nginx service is running and properly configured. If you receive a 502 (bad gateway) error, this indicates that gunicorn is misconfigured or not running.
213
157
214
158
!!! info
215
-
Please keep in mind that the configurations provided here are bare minimums required to get NetBox up and running. You will almost certainly want to make some changes to better suit your production environment.
159
+
Please keep in mind that the configurations provided here are bare minimums required to get NetBox up and running. You may want to make adjustments to better suit your production environment.
0 commit comments