summaryrefslogtreecommitdiffstats
path: root/Documentation/documentation.lyx
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/documentation.lyx')
-rw-r--r--Documentation/documentation.lyx333
1 files changed, 245 insertions, 88 deletions
diff --git a/Documentation/documentation.lyx b/Documentation/documentation.lyx
index a678315..dfbf353 100644
--- a/Documentation/documentation.lyx
+++ b/Documentation/documentation.lyx
@@ -1,5 +1,5 @@
1#LyX 1.2 created this file. For more info see http://www.lyx.org/ 1#LyX 1.3 created this file. For more info see http://www.lyx.org/
2\lyxformat 220 2\lyxformat 221
3\textclass article 3\textclass article
4\language english 4\language english
5\inputencoding default 5\inputencoding default
@@ -162,7 +162,7 @@ Note which directives go in the 'main server config' and which directives
162 This is made clear in the directive documentation. 162 This is made clear in the directive documentation.
163\layout Itemize 163\layout Itemize
164 164
165The 'time_stamp' field is stored in an UNSIGNED INTEGER column, in the standard 165The 'time_stamp' field is stored in an UNSIGNED INTEGER format, in the standard
166 unix 166 unix
167\begin_inset Quotes eld 167\begin_inset Quotes eld
168\end_inset 168\end_inset
@@ -173,9 +173,9 @@ seconds since the epoch
173 173
174 format. 174 format.
175 This is superior to storing the access time as a string due to size requirement 175 This is superior to storing the access time as a string due to size requirement
176s: an UNSIGNED INT requires 4 bytes, whereas an Apache date string -- e.g. 176s: an UNSIGNED INT requires 4 bytes, whereas an Apache date string (e.g.
177 "18/Nov/2001:13:59:52 -0800" -- requires 26 bytes: those extra 22 bytes 177 "18/Nov/2001:13:59:52 -0800") requires 26 bytes: those extra 22 bytes become
178 become significant when multiplied by thousands of accesses on a busy server. 178 significant when multiplied by thousands of accesses on a busy server.
179 Besides, an INT type is far more flexible for comparisons, etc. 179 Besides, an INT type is far more flexible for comparisons, etc.
180\begin_deeper 180\begin_deeper
181\layout Standard 181\layout Standard
@@ -301,6 +301,11 @@ These installation documents assume a relatively modern GNU/Linux scenario.
301 compiling the module for those platforms. 301 compiling the module for those platforms.
302\layout Subsubsection 302\layout Subsubsection
303 303
304
305\begin_inset LatexCommand \label{sub:Solaris}
306
307\end_inset
308
304Solaris 309Solaris
305\layout Standard 310\layout Standard
306 311
@@ -387,6 +392,143 @@ contact
387\end_inset 392\end_inset
388 393
389 and help fill in this section. 394 and help fill in this section.
395\layout Subsubsection
396
397OS X
398\layout Standard
399
400mod_log_sql should compile and work out-of-the-box on this platform.
401 Here are some notes from a user successfully running the module on OS X:
402\layout Quote
403
404
405\emph on
406The only changes I had to make were to where I had the various libraries
407 installed.
408\layout Quote
409
410
411\emph on
412Here are the changes I made to the head of the Makefile:
413\layout LyX-Code
414
415APACHESOURCE = /usr/local/src/apache_1.3.27
416\layout Quote
417
418
419\emph on
420(Wasn't sure if this was really needed or not, so I downloaded the Apache
421 source just in case)
422\layout LyX-Code
423
424APACHEINSTALLED = /usr/sbin
425\layout LyX-Code
426
427APACHEHEADERS = /usr/include/httpd
428\layout LyX-Code
429
430APXS = $(APACHEINSTALLED)/apxs
431\layout LyX-Code
432
433MYSQLLIBRARIES = /usr/local/mysql/lib
434\layout LyX-Code
435
436MYSQLHEADERS = /usr/local/mysql/include
437\layout Quote
438
439
440\emph on
441I'm using a binary installation of MySQL and the default apache installation
442 on OS X Client 10.2.3, the locations of these files may vary depending on
443 how you've installed MySQL and will almost certainly be different if you're
444 using OS X Server.
445\layout Standard
446
447My thanks to Tom Wiebe for being the first (to my knowlege) mod_log_sql
448 user on OS X and for providing these notes.
449\layout Subsubsection
450
451Digital Unix
452\layout Standard
453
454Digital Unix, like Solaris, needs to be linked against librt; see section
455
456\begin_inset LatexCommand \ref{sub:Solaris}
457
458\end_inset
459
460.
461 Here are further notes from a user successfully running the module on Digital
462 Unix:
463\layout Quote
464
465
466\emph on
467Instead of trying to get the module to remember where the MySQL libraries
468 were, I instead compiled apache with the information:
469\layout Quote
470
471
472\emph on
473LDFLAGS='-rpath /isp/mysql/lib/mysql' ./configure ...
474\layout Quote
475
476
477\emph on
478Everything worked as expected after that.
479 (The error I got without this was "/sbin/loader: Fatal Error: cannot map
480 libmysqlclient.so" )
481\layout Quote
482
483
484\emph on
485Digital Unix (v4.0f, at least ) appears to follow the same requirements needed
486 by Solaris, so simply adding librt to the module made it compile without
487 errors.
488\layout Quote
489
490
491\emph on
492As for the warnings, here's the text:
493\layout LyX-Code
494
495
496\emph on
497mod_log_sql.c: In function `extract_request_duration':
498\layout LyX-Code
499
500
501\emph on
502mod_log_sql.c:292: warning: long int format, different type arg (arg 4)
503\layout LyX-Code
504
505
506\emph on
507mod_log_sql.c: In function `extract_request_timestamp':
508\layout LyX-Code
509
510
511\emph on
512mod_log_sql.c:497: warning: long int format, different type arg (arg 4)
513\layout Quote
514
515
516\emph on
517Poking around in the code, it looks like the compiler was complaining that
518 what time() is returning doesn't play nicely with %ld by default.
519 I just typecast them as (long)'s and the warnings went away ( not that
520 the module wasn't working correctly without them ).
521\layout Quote
522
523
524\emph on
525The module works very well so far in testing...
526 hasn't dropped a single log entry yet.
527
528\layout Standard
529
530My thanks to Jim Turner for permitting me to quote him here, and for being
531 the first known user of mod_log_sql on Digital Unix.
390\layout Subsection 532\layout Subsection
391 533
392Do I want a DSO or a static module? 534Do I want a DSO or a static module?
@@ -4817,24 +4959,29 @@ Context: virtual host
4817In HTTP, cookies have names to distinguish them from each other. 4959In HTTP, cookies have names to distinguish them from each other.
4818 Using mod_usertrack, for example, you can give your user-tracking cookies 4960 Using mod_usertrack, for example, you can give your user-tracking cookies
4819 a name with the CookieName directive. 4961 a name with the CookieName directive.
4962
4820\layout Standard 4963\layout Standard
4821 4964
4822You must include a 'c' character in 4965mod_log_sql allows you to log cookie information.
4823\noun on 4966
4824LogSQLTransferLogFormat
4825\noun default
4826 for this directive to take effect; once you specify 'c',
4827\noun on 4967\noun on
4828LogSQLWhichCookie 4968 LogSQLWhichCookie
4829\noun default 4969\noun default
4830 tells mod_log_sql which cookie to log. 4970 tells mod_log_sql which cookie to log.
4831 This is necessary because you will usually be setting and receiving more 4971 This is necessary because you will usually be setting and receiving more
4832 than one cookie from a client; this cookie designates which one to log. 4972 than one cookie from a client.
4973\layout Standard
4974
4975You must include a 'c' character in
4976\noun on
4977LogSQLTransferLogFormat
4978\noun default
4979 for this directive to take effect.
4833\layout Standard 4980\layout Standard
4834 4981
4835Note: although this was intended for people who are using mod_usertrack 4982Note: although this was origintally intended for people using mod_usertrack
4836 to set user-tracking cookies, you aren't restricted in any way. 4983 to create user-tracking cookies, you aren't restricted in any way.
4837 You can choose which cookie you wish to log to the database --any cookie 4984 You can choose which cookie you wish to log to the database -- any cookie
4838 at all -- and it doesn't necessarily have to have anything to do with mod_usert 4985 at all -- and it doesn't necessarily have to have anything to do with mod_usert
4839rack. 4986rack.
4840\layout Subsubsection 4987\layout Subsubsection
@@ -5742,7 +5889,7 @@ Please contact
5742Problems 5889Problems
5743\layout Subsubsection 5890\layout Subsubsection
5744 5891
5745Apache segfaults when using PHP and mod_log_sql 5892Apache segfaults or has other problems when using PHP and mod_log_sql
5746\layout Standard 5893\layout Standard
5747 5894
5748This occurs if you compiled PHP with MySQL database support. 5895This occurs if you compiled PHP with MySQL database support.
@@ -5759,8 +5906,9 @@ real
5759 5906
5760\layout Standard 5907\layout Standard
5761 5908
5762The solution is to configure PHP to link against the real MySQL libraries 5909PHP and mod_log_sql can be configured to happily coexist.
5763 and recompile mod_php. 5910 The solution is to configure PHP to link against the real MySQL libraries:
5911 recompile PHP using --with-mysql=/your/path.
5764 Apache will run properly once the modules are all using the same version 5912 Apache will run properly once the modules are all using the same version
5765 of the MySQL libraries. 5913 of the MySQL libraries.
5766\layout Subsubsection 5914\layout Subsubsection
@@ -5983,6 +6131,83 @@ Reference:
5983\end_inset 6131\end_inset
5984 6132
5985 6133
6134\layout Subsubsection
6135
6136Sometimes a single VirtualHost gets logged to two different tables (e.g.
6137 access_foo_com, access_www_foo_com).
6138 Or, accesses to an unqualified hostname (e.g.
6139
6140\begin_inset Quotes eld
6141\end_inset
6142
6143http://intranet/index.html
6144\begin_inset Quotes erd
6145\end_inset
6146
6147) get logged in separate tables.
6148\layout Standard
6149
6150Proper usage of the Apache runtime
6151\noun on
6152ServerName
6153\noun default
6154 directive and the directive
6155\noun on
6156UseCanonicalName On
6157\noun default
6158(or
6159\noun on
6160DNS
6161\noun default
6162) are necessary to prevent this problem.
6163
6164\begin_inset Quotes eld
6165\end_inset
6166
6167On
6168\begin_inset Quotes erd
6169\end_inset
6170
6171 is the default for
6172\noun on
6173UseCanonicalName
6174\noun default
6175, and specifies that self-referential URLs are generated from the
6176\noun on
6177ServerName
6178\noun default
6179part of your VirtualHost:
6180\layout Quote
6181
6182With UseCanonicalName on (and in all versions prior to 1.3) Apache will use
6183 the ServerName and Port directives to construct the canonical name for
6184 the server.
6185 With UseCanonicalName off Apache will form self-referential URLs using
6186 the hostname and port supplied by the client if any are supplied (otherwise
6187 it will use the canonical name, as defined above).
6188 [From
6189\begin_inset LatexCommand \url[the Apache documentation]{http://httpd.apache.org/docs/mod/core.html#usecanonicalname}
6190
6191\end_inset
6192
6193]
6194\layout Standard
6195
6196The module inherits Apache's
6197\begin_inset Quotes eld
6198\end_inset
6199
6200knowledge
6201\begin_inset Quotes erd
6202\end_inset
6203
6204 about the server name being accessed.
6205 As long as those two directives are properly configured, mod_log_sql will
6206 log to only one table per virtual host while using
6207\noun on
6208LogSQLMassVirtualHosting
6209\noun default
6210.
5986\layout Subsection 6211\layout Subsection
5987 6212
5988Performance and Tuning 6213Performance and Tuning
@@ -6236,7 +6461,7 @@ not
6236correct 6461correct
6237\series default 6462\series default
6238 to assume that 20 Apache children with a VSZ of 7MB each equals 6463 to assume that 20 Apache children with a VSZ of 7MB each equals
6239\begin_inset Formula $(20\times 7MB)$ 6464\begin_inset Formula $(20\times7MB)$
6240\end_inset 6465\end_inset
6241 6466
6242 of memory consumption -- the real answer is much, much lower. 6467 of memory consumption -- the real answer is much, much lower.
@@ -6359,74 +6584,6 @@ How do I...?
6359 -- accomplishing certain tasks 6584 -- accomplishing certain tasks
6360\layout Subsubsection 6585\layout Subsubsection
6361 6586
6362I am using LogSQLMassVirtualHosting, and sometimes a single VirtualHost
6363 gets logged to two different tables.
6364 How do I prevent that?
6365\layout Standard
6366
6367Proper usage of the Apache runtime
6368\noun on
6369ServerName
6370\noun default
6371 directive and the directive
6372\noun on
6373UseCanonicalName On
6374\noun default
6375(or
6376\noun on
6377DNS
6378\noun default
6379) are necessary to prevent this problem.
6380
6381\begin_inset Quotes eld
6382\end_inset
6383
6384On
6385\begin_inset Quotes erd
6386\end_inset
6387
6388 is the default for
6389\noun on
6390UseCanonicalName
6391\noun default
6392, and specifies that self-referential URLs are generated from the
6393\noun on
6394ServerName
6395\noun default
6396part of your VirtualHost:
6397\layout Quote
6398
6399With UseCanonicalName on (and in all versions prior to 1.3) Apache will use
6400 the ServerName and Port directives to construct the canonical name for
6401 the server.
6402 With UseCanonicalName off Apache will form self-referential URLs using
6403 the hostname and port supplied by the client if any are supplied (otherwise
6404 it will use the canonical name, as defined above).
6405 [From
6406\begin_inset LatexCommand \url[the Apache documentation]{http://httpd.apache.org/docs/mod/core.html#usecanonicalname}
6407
6408\end_inset
6409
6410]
6411\layout Standard
6412
6413The module inherits Apache's
6414\begin_inset Quotes eld
6415\end_inset
6416
6417knowledge
6418\begin_inset Quotes erd
6419\end_inset
6420
6421 about the server name being accessed.
6422 As long as those two directives are properly configured, mod_log_sql will
6423 log to only one table per virtual host while using
6424\noun on
6425LogSQLMassVirtualHosting
6426\noun default
6427.
6428\layout Subsubsection
6429
6430How do I extract the data in a format that my analysis tool can understand? 6587How do I extract the data in a format that my analysis tool can understand?
6431\layout Standard 6588\layout Standard
6432 6589