This repository has been archived by the owner on Jun 2, 2021. It is now read-only.
forked from infusion/mod_mysql_accesslog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
56 lines (45 loc) · 1.67 KB
/
README
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
1. Copy mod_mysql_accesslog.c into the src directory.
2. Apply the autotools patch:
patch -p1 < lighttpd-1.4.33.patch
3. Run the following command to regenerate configure script:
./autogen.sh
4. Run the following commands in the base directory of lighttpd:
./configure --with-mysql ...
make clean
make
make install
5. Create the database table
CREATE TABLE accesslog (
remote_host int(10) unsigned,
remote_user varchar(2048),
timestamp int(10) unsigned,
request_line varchar(2048),
status smallint(5) unsigned,
bytes_body int(10) unsigned,
header varchar(2048),
environment varchar(2048),
filename varchar(2048),
request_protocol enum('VERSION_1_0','VERSION_1_1'),
request_method enum('GET','POST','HEAD','OPTIONS','PROPFIND','MKCOL','PUT','DELETE','COPY','MOVE','PROPPATCH','REPORT','CHECKOUT','CHECKIN','VERSION_CONTROL','UNCHECKOUT','MKACTIVITY','MERGE','LOCK','UNLOCK','LABEL','CONNECT'),
server_port smallint(5) unsigned,
query_string varchar(2048),
time_used smallint(5) unsigned,
url varchar(2048),
server_name varchar(2048),
http_host varchar(2048),
keep_alive tinyint(3) unsigned,
bytes_in int(10) unsigned,
bytes_out int(10) unsigned,
response_header varchar(2048)
)
5. Apply the following configuration to your lighttpd.conf
# MySQL Accesslog authentification
mysql-accesslog.user = "peter"
mysql-accesslog.pass = "secret"
# MySQL database
mysql-accesslog.data = "pipe"
# MySQL socket or host
mysql-accesslog.sock = "/tmp/mysql.sock"
#mysql-accesslog.host = "192.168.10.100"
# MySQL query to be executed
mysql-accesslog.query = "INSERT INTO accesslog SET remote_host=%h, timestamp=%t, status=%s, header=%{User-Agent}i, query_string=%q, url=%U"