您如何在Ubuntu 16.04.6中设置capcap以允许Grafana绑定到端口80? [英] How do you setcap in Ubuntu 16.04.6 to allow Grafana to bind to port 80?
问题描述
Grafana配置文档指出要使用端口80需要...授予Grafana二进制权限."当我运行指示的命令
The Grafana config docs state that "To use port 80 you need to ... give the Grafana binary permission." When I run the instructed command
sudo setcap 'cap_net_bind_service=+ep' /usr/sbin/grafana-server
我知道
Failed to set capabilities on file `/usr/sbin/grafana-server' (Invalid argument)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file
我跑步时
sudo setcap ‘cap_net_bind_service=+ep’ /usr/sbin/grafana-server
我知道
fatal error: Invalid argument
usage: setcap [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]
Note <filename> must be a regular (non-symlink) file.
如何允许Grafana绑定到端口80?
How do I allow Grafana to bind to port 80?
推荐答案
当遵循"/usr/sbin/包含一个名为grafana
的文件,但没有一个名为grafana-server
的文件.我将命令更改为
When one follows the "Install from APT repository" instructions, I notice that /usr/sbin/
contains a file called grafana
but not one named grafana-server
. I changed the command to
sudo setcap cap_net_bind_service=+ep /usr/sbin/grafana
在/etc/grafana/grafana.ini
# The HTTP port to use
http_port = 80
然后再次启动服务器,
sudo systemctl start grafana-server
,它工作正常.也许这是最近的更改,正在等待Grafana文档中的更新.或者,按照"安装.deb软件包 仪器.
and it works fine. Perhaps this is a recent change that is awaiting an update in the Grafana docs. Alternatively, follow the "Install .deb package" instrucitons.
这篇关于您如何在Ubuntu 16.04.6中设置capcap以允许Grafana绑定到端口80?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!