From f178bb01838689e977f6fce7a2f9f10c9938930e Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 29 Dec 2018 18:04:33 +0100 Subject: Improve netdata snippet(s). --- apache2/conf-available/local-netdata.conf | 56 ----------------------- netdata/apache2/conf-available/local-netdata.conf | 56 +++++++++++++++++++++++ netdata/netdata.conf | 11 +++++ 3 files changed, 67 insertions(+), 56 deletions(-) delete mode 100644 apache2/conf-available/local-netdata.conf create mode 100644 netdata/apache2/conf-available/local-netdata.conf create mode 100644 netdata/netdata.conf diff --git a/apache2/conf-available/local-netdata.conf b/apache2/conf-available/local-netdata.conf deleted file mode 100644 index bd3a6ef..0000000 --- a/apache2/conf-available/local-netdata.conf +++ /dev/null @@ -1,56 +0,0 @@ -# Apache2 snippet to proxy netdata service -# -# example uses: -# -# -# ServerName simple.example.org -# -# Include conf-available/local-netdata.conf -# -# -# -# ServerName complex.example.org -# -# Define _NETDATA_SOCKET /var/lib/netdata/netdata.socket -# -# DefineExternalAuth pwauth pipe /usr/sbin/pwauth -# -# AuthType Basic -# AuthName "Netdata service access" -# AuthBasicProvider external -# AuthExternal pwauth -# AllowOverride None -# Require valid-user -# -# -# Include conf-available/local-netdata.conf -# -# UnDefine _NETDATA_SOCKET -# UnDefine _NETDATA_PORT -# UnDefine _NETDATA_PREFIX -# - -# Netdata port to proxy into (fake, if Unix socket also provided) - - Define _NETDATA_PORT 19999 - - -# path prefix - - Define _NETDATA_PREFIX /netdata - - - - - ProxyPass unix:${_NETDATA_SOCKET}|http://localhost:${_NETDATA_PORT}/ connectiontimeout=5 timeout=30 keepalive=on - ProxyPassReverse unix:${_NETDATA_SOCKET}|http://localhost:${_NETDATA_PORT}/ - - - - - ProxyPass http://localhost:${_NETDATA_PORT}/ connectiontimeout=5 timeout=30 keepalive=on - ProxyPassReverse http://localhost:${_NETDATA_PORT}/ - - - -RedirectMatch permanent ${_NETDATA_PREFIX} ${_NETDATA_PREFIX}/ diff --git a/netdata/apache2/conf-available/local-netdata.conf b/netdata/apache2/conf-available/local-netdata.conf new file mode 100644 index 0000000..bd3a6ef --- /dev/null +++ b/netdata/apache2/conf-available/local-netdata.conf @@ -0,0 +1,56 @@ +# Apache2 snippet to proxy netdata service +# +# example uses: +# +# +# ServerName simple.example.org +# +# Include conf-available/local-netdata.conf +# +# +# +# ServerName complex.example.org +# +# Define _NETDATA_SOCKET /var/lib/netdata/netdata.socket +# +# DefineExternalAuth pwauth pipe /usr/sbin/pwauth +# +# AuthType Basic +# AuthName "Netdata service access" +# AuthBasicProvider external +# AuthExternal pwauth +# AllowOverride None +# Require valid-user +# +# +# Include conf-available/local-netdata.conf +# +# UnDefine _NETDATA_SOCKET +# UnDefine _NETDATA_PORT +# UnDefine _NETDATA_PREFIX +# + +# Netdata port to proxy into (fake, if Unix socket also provided) + + Define _NETDATA_PORT 19999 + + +# path prefix + + Define _NETDATA_PREFIX /netdata + + + + + ProxyPass unix:${_NETDATA_SOCKET}|http://localhost:${_NETDATA_PORT}/ connectiontimeout=5 timeout=30 keepalive=on + ProxyPassReverse unix:${_NETDATA_SOCKET}|http://localhost:${_NETDATA_PORT}/ + + + + + ProxyPass http://localhost:${_NETDATA_PORT}/ connectiontimeout=5 timeout=30 keepalive=on + ProxyPassReverse http://localhost:${_NETDATA_PORT}/ + + + +RedirectMatch permanent ${_NETDATA_PREFIX} ${_NETDATA_PREFIX}/ diff --git a/netdata/netdata.conf b/netdata/netdata.conf new file mode 100644 index 0000000..5a19366 --- /dev/null +++ b/netdata/netdata.conf @@ -0,0 +1,11 @@ +[global] + run as user = netdata + web files owner = root + web files group = root + # Netdata is not designed to be exposed to potentially hostile + # networks.See https://github.com/netdata/netdata/issues/164 +# bind socket to IP = 0.0.0.0 + access log = none +[web] + bind to = unix:/var/lib/netdata/netdata.socket + enable gzip compression = no -- cgit v1.2.3