Skip to main content

Installation et configuration HTTPS

sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
echo "deb https://packages.grafana.com/enterprise/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt-get update
sudo apt-get install grafana-enterprise
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
sudo systemctl enable grafana-server.service

On autorise dans le pare-feu.

iptables -I INPUT 7 -p tcp -m tcp --dport 3000 -j ACCEPT

On copie et modifie ensuite les permissions du certificat et de sa clé.

 cp -r /etc/apache2/ssl /etc/grafana/ssl
 cd ssl/
 chown -R grafana:grafana /etc/grafana/ssl/
 chmod g+rw -R /etc/grafana/ssl/

On modifie le fichier de configuration de Grafana.

nano /etc/grafana/grafana.ini

On décommente et modifie les lignes "protocol = https", "domain = grafana.littoral1.fr", "cert_file = /etc/apache2/ssl/apache-selfsigned.crt" et "cert_key = /etc/apache2/ssl/private/apache-selfsigned.key".

On redémarre grafana.

systemctl restart grafana

image-1616776562254.png