Skip to content

Commit 85c2e78

Browse files
committed
new, version 0.2.0
0 parents  commit 85c2e78

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

apache-mod_log_gelf.spec

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
%define mod_name log_gelf
2+
%define apxs %{_sbindir}/apxs
3+
Summary: Apache2 module for writing access logs to Graylog
4+
Name: apache-mod_%{mod_name}
5+
Version: 0.2.0
6+
Release: 1
7+
License: Apache v2.0
8+
Group: Networking/Daemons/HTTP
9+
Source0: https://github.com/graylog-labs/apache-mod_log_gelf/archive/%{version}/%{name}-%{version}.tar.gz
10+
# Source0-md5: 4aba4fd0f8e1175c39d4ac236282df10
11+
Source1: apache.conf
12+
URL: https://github.com/graylog-labs/apache-mod_log_gelf
13+
BuildRequires: %{apxs}
14+
BuildRequires: apache-devel >= 2.2
15+
BuildRequires: rpmbuild(macros) >= 1.268
16+
Requires: apache(modules-api) = %apache_modules_api
17+
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18+
19+
%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
20+
%define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
21+
22+
%description
23+
Apache2 module for writing access logs to Graylog.
24+
25+
%prep
26+
%setup -q -n apache-mod_log_gelf-%{version}
27+
28+
%build
29+
%{__make} -C src
30+
31+
%install
32+
rm -rf $RPM_BUILD_ROOT
33+
install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
34+
%{__make} -C src install \
35+
DESTDIR=$RPM_BUILD_ROOT
36+
37+
cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf
38+
39+
%clean
40+
rm -rf $RPM_BUILD_ROOT
41+
42+
%post
43+
%service -q httpd restart
44+
45+
%postun
46+
if [ "$1" = "0" ]; then
47+
%service -q httpd restart
48+
fi
49+
50+
%files
51+
%defattr(644,root,root,755)
52+
%doc README.md
53+
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
54+
%attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so

apache.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# https://github.com/graylog-labs/apache-mod_log_gelf#configuration
2+
3+
LoadModule log_gelf_module modules/mod_log_gelf.so
4+
5+
GelfEnabled Off
6+
GelfUrl "udp://127.0.0.1:12201"
7+
GelfSource "hostname"
8+
GelfFacility "apache-gelf"
9+
GelfTag "gelf-tag"
10+
GelfCookie "tracking"
11+
GelfFields "ABDhmsvRti"

0 commit comments

Comments
 (0)