First of all, apologies for reopening this, but itâs the only thread regarding Linode Longview.
I was wondering if you might be kind enough to help me understand what Iâm doing wrong here @gnowland
I have a deployed, up and running production site using the whole Roots stack. Following your lead, I created a file at trellis/nginx-includes/linode-longview.conf.child
- creating the nginx-includes
directory along the way; and pasted in:
{% extends 'roles/nginx/templates/nginx.conf.j2' %}
{% block http_begin -%}
server {
listen 127.0.0.1:80;
server_name 127.0.0.1;
location /nginx_status {
stub_status on;
allow 127.0.0.1;
deny all;
}
}
{% endblock %}
I edited trellis/group_vars/production/main.yml
and added nginx_conf: nginx-includes/linode-longview.conf.child
to make the whole file like this:
mysql_root_password: "{{ vault_mysql_root_password }}" # Define this variable in group_vars/production/vault.yml
nginx_conf: nginx-includes/linode-longview.conf.child
I committed the changes to my master branch and pushed them to my repo; then ran ansible-playbook server.yml -e env=production --tags nginx-includes
At this point I went to the Linode Manager and created a new Longview instance, copied the install code, ssh into my production server, ran the code and installed the Longview Agent.
Unfortunately I get nothing - not even basic reporting. The Longview page for this agent just keeps spinning and waiting for connection. Could this be something to do with a port not being open?
While on the server, I checked the /etc/nginx
directory and I donât see any includes.d
directory there either.
Just for the hell of it I did try a complete reprovision, but that changes nothing. Does anyone have any ideas what I could try?
Many thanks!
UPDATE
So it appears that the conf inside trellis/nginx-includes/linode-longview.conf.child
is indeed being included in the /etc/nginx/nginx.conf
on the server, and not placed in a includes.d
directory, so at least its there. Does anyone know why Longview may still be be unable to connect?
http {
server {
listen 127.0.0.1:80;
server_name 127.0.0.1;
location /nginx_status {
stub_status on;
allow 127.0.0.1;
deny all;
}
}
UPDATE
OK, I figured this out. Iâll lay it out from the start as I understand it for anyone else stuck with this. In this case, Iâm adding Longview to my Production server.
-
Create a new file at trellis/nginx-includes/all/linode-longview.conf.child
, creating any missing directories as required.
-
Paste the following into that file:
{% extends 'roles/nginx/templates/nginx.conf.j2' %}
{% block http_begin -%}
server {
listen 127.0.0.1:80;
server_name 127.0.0.1;
location /nginx_status {
stub_status on;
allow 127.0.0.1;
deny all;
}
}
{% endblock %}
- Edit
trellis/group_vars/production/main.yml
and add nginx_conf: nginx-includes/linode-longview.conf.child
at the end, to make it like so:
mysql_root_password: "{{ vault_mysql_root_password }}" # Define this variable in group_vars/production/vault.yml
nginx_conf: nginx-includes/all/linode-longview.conf.child
-
Commit and push the changes to your repo, and reprovision the Production server ansible-playbook server.yml -e env=production
-
Visit the Linode Manager and create a new instance of Longview. Copy the install code.
-
SSH into your production server, and paste the installation command in and run it. If you are asked if you would like it to autoconfigure, select âNoâ.
-
Restart nginx systemctl restart nginx.service
I hope that works for you!