Windows版Grafana配置LDAP:如何修改grafana.ini中ldap.toml路径
Hey there! Since you’ve got LDAP experience on Linux but this is your first go-round with Grafana on Windows, let’s get this sorted out step by step.
Step 1: Locate the grafana.ini file
On your Windows machine, the main config file lives in the conf directory of your Grafana installation. For your version (5.2.4), that path will be:C:\Program Files\grafana-5.2.4\conf\grafana.ini
Step 2: Edit the file with admin privileges
Since this file is in the Program Files directory, you’ll need to open your text editor (like Notepad) with administrator rights to save changes. Right-click your editor and select "Run as administrator", then navigate to and open the grafana.ini file.
Step 3: Update the LDAP config path
Search for the [auth.ldap] section in the file. You’ll see a line that looks like this (it might be commented out with a # at the start):
# config_file = /etc/grafana/ldap.toml
Uncomment the line (remove the #) and replace the Linux path with your Windows ldap.toml path. You can use either double backslashes (escaped for TOML) or forward slashes:
Option 1 (double backslashes):
config_file = "C:\\Program Files\\grafana-5.2.4\\conf\\ldap.toml"
Option 2 (forward slashes, easier to write):
config_file = "C:/Program Files/grafana-5.2.4/conf/ldap.toml"
Step 4: Restart the Grafana service
To apply the changes, you need to restart the Grafana service:
- Open the Services app (press Win + R, type
services.msc, hit Enter) - Find the Grafana service (usually named
GrafanaServerorgrafana-server) - Right-click it and select Restart
Alternatively, use Command Prompt (as admin) to restart it:
net stop GrafanaServer net start GrafanaServer
Step 5: Verify the setup
After restarting, try logging into Grafana with an LDAP account to confirm it works. If you run into issues, check the Grafana logs at C:\Program Files\grafana-5.2.4\data\logs\grafana.log for error messages related to LDAP.
内容的提问来源于stack exchange,提问作者jamf

