Would you like to learn how to configure Grafana Radius authentication on Apache? In this tutorial, we are going to show you how to authenticate Grafana users using the Apache Radius module for HTTP authentication.
• Ubuntu 18
• Ubuntu 19
• Grafana 6.4.4
• Freeradius 3.0.17
Grafana Tutorial:
On this page, we offer quick access to a list of Grafana tutorials.
Tutorial Grafana – FreeRadius Server Installation
• IP – 192.168.15.10.
• Operational System – Ubuntu 19.10
• Hostname – UBUNTU
On the Linux console, use the following commands to install the FreeRadius service.
Now, we need to add FreeRadius clients to the clients.conf;.
Locate and edit the clients.conf.
Add the following lines at the end of the clients.conf file.
In our example, we are adding 1 client device:
The client device was named GRAFANA and has the IP address 192.168.15.11.
Now, we need to add FreeRadius users to the USERS configuration file.
Locate and edit the Freeradius users configuration file.
Add the following lines at the end of the file
We created a Radius account named admin.
Restart the Freeradius server.
Test your radius server configuration file.
You have finished the Freeradius installation on Ubuntu Linux.
Tutorial – Grafana Installation
• IP – 192.168.15.11
• Operational System – Ubuntu 19.10
• Hostname – GRAFANA
On the Linux console, use the following commands to install the MySQL database service.
Access the MySQL command-line.
Create a database named grafana.
Create a database user account named grafana.
Give the SQL user named grafana permission over the database named grafana.
On the Linux console, use the following commands to configure the Grafana APT repository.
Use the following command to install Grafana.
Edit the Grafana configuration file grafana.ini.
Perform the following configuration under the [Database] and [Session] sections.
Keep in mind that you need to change the MySQL username and password to reflect your environment.
Use the following command to start the Grafana service.
The Grafana service will start listening on TCP port 3000.
To test your Grafana installation, open your browser and enter the IP address of your server plus :3000.
In our example, the following URL was entered in the Browser:
• http://192.168.15.11:3000
The Grafana web interface should be presented.
On the prompt screen, enter the Grafana Default Password login information.
• Username: admin
• Password: admin
The system will ask you to change the Grafana default password.
Congratulations! You have finished the Grafana basic installation.
Tutorial Grafana – Apache Proxy Installation
• IP – 192.168.15.11
• Operational System – Ubuntu 19.10
• Hostname – GRAFANA
Now, we need to install the Apache webserver and configure it to work as a Proxy to the Grafana service.
Install the Apache web server and the required packages.
Enable the required Apache modules.
Now, we need to configure Apache port 80 as a proxy to the Grafana service port 3000.
We also need to configure Apache to request Radius authentication to users trying to acess Grafana.
Edit the Apache 000-default.conf configuration file.
Here is the 000-default.conf file before our configuration.
Here is the 000-default.conf file after our configuration.
Restart the Apache service.
Edit the Grafana configuration file grafana.ini.
Perform the following configuration under the [auth.proxy] area.
Restart the Grafana service.
The Apache service will listen on TCP port 80, authenticate user on the Radius database and redirect users to the Grafana service on port 3000.
To test your Apache proxy installation, open your browser and enter the IP address of your server.
In our example, the following URL was entered in the Browser:
• http://192.168.15.11
The Apache proxy will request you to authenticate yourself before forwarding you to the Grafana service.
On the login screen, use the admin user and the password from the Apache htpasswd file.
• Username: admin
• Password: Enter the admin Radius password. [boss123]
After a successfull login, you will be sent directly to the Grafana dashboard.
Congratulations! You have configured the Apache Proxy authentication to Access the Grafana serice.