-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod_log_sql.spec
121 lines (92 loc) · 3.71 KB
/
mod_log_sql.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
Summary: Database logging module for Apache
Name: mod_log_sql
Version: 1.101
Release: 1%{?dist}
License: Artistic-1.0
Group: System Environment/Daemons
URL: http://www.outoforder.cc/projects/apache/mod_log_sql/
Source0: http://www.outoforder.cc/downloads/%{name}/%{name}-%{version}.tar.bz2
Patch0: mod_log_sql-1.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: mysql-devel, httpd-devel
#BuildRequires: mod_ssl
Requires: httpd, mod_ssl
%description
mod_log_sql is a logging module for Apache that logs all requests
to a database.
%prep
%setup -q
%patch0 -p1
%{__perl} -pi.orig -e 's|/lib\b|/%{_lib}|g;' configure Makefile.in
%{__cat} <<EOF >mod_log_sql.conf
### This is a very basic logging setup. I would HIGHLY recommend reading
### the documentation either at:
###
### http://www.outoforder.cc/projects/apache/mod_log_sql/docs-2.0/
### You will need to create a database for your logs. It doesn't need
### to be on the local machine. You can log remotely. There is a
### create_tables.sql script in /usr/share/mod_log_sql-%{version}/contrib/ to
### generate this table for you if you like. You should also consider
### creating a user just for apache logs. This can be done using the
### commands below.
### mysql -u root -h <hostname> -p < create_tables.sql
### mysql> grant insert,create on apachelogs.* to
### [email protected] identified by 'l0gger';
### Uncomment the lines below to load mod_log_sql
#LoadModule log_sql_module modules/mod_log_sql.so
#LoadModule log_sql_mysql_module modules/mod_log_sql_mysql.so
#<IfModule mod_ssl.c>
#LoadModule log_sql_ssl_module modules/mod_log_sql_ssl.so
#</IfModule>
### Now we need to tell apache where to send the logs.
### For remote logging, use this line.
#LogSQLLoginInfo mysql://loguser:[email protected]/apachelogs
#LogSQLDBParam port 3306
### For logging to a database on localhost, use something like this.
#LogSQLDBParam socketfile /your/path/to/mysql.sock
#LogSQLCreateTables on
### From this point on, these settings belong in the appropriate
### virtual host config section.
#<VirtualHost 1.2.3.4>
# [snip]
# LogSQLTransferLogTable access_log
# LogSQLTransferLogFormat AbHhmRSsTUuv
# [snip]
#</VirtualHost>
### Additionally mod_log_sql can be directed to ignore certain requests
### For example:
### To ignore requests from a specific domain
#LogSQLRemhostIgnore example.com
### To ignore requests for specific files (good for ignoring viruses)
# LogSQLRequestIgnore root.exe cmd.exe default.ida
### To ignore specific types of files, match the extension.
# LogSQLRequestIgnore .gif .jpg
EOF
%build
%configure \
--with-apxs="%{_sbindir}/apxs" \
--with-ssl-inc="%{_includedir}/httpd"
%{__make} %{?_smp_mflags}
%install
%{__rm} -rf %{buildroot}
%{__install} -Dp -m0755 .libs/mod_log_sql.so %{buildroot}%{_libdir}/httpd/modules/mod_log_sql.so
%{__install} -Dp -m0755 .libs/mod_log_sql_mysql.so %{buildroot}%{_libdir}/httpd/modules/mod_log_sql_mysql.so
%{__install} -Dp -m0755 .libs/mod_log_sql_ssl.so %{buildroot}%{_libdir}/httpd/modules/mod_log_sql_ssl.so
%{__install} -Dp -m0644 mod_log_sql.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/mod_log_sql.conf
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-, root, root, 0755)
%doc AUTHORS CHANGELOG contrib/ docs/* INSTALL LICENSE TODO
%config(noreplace) %{_sysconfdir}/httpd/conf.d/mod_log_sql.conf
%{_libdir}/httpd/modules/mod_log_sql.so
%{_libdir}/httpd/modules/mod_log_sql_mysql.so
%{_libdir}/httpd/modules/mod_log_sql_ssl.so
%changelog
* Fri Nov 16 2018 Mark A. Hershberger <[email protected]> - 1.101-1
- CentOS 7
- Update to 1.101
* Sat Apr 08 2006 Dries Verachtert <[email protected]> - 1.100-1.2
- Rebuild for Fedora Core 5.
* Thu Mar 03 2005 Jim Perrin <[email protected]> - 1.100-1
- Initial Package.