diff options
| author | 2011-07-21 19:10:20 -0400 | |
|---|---|---|
| committer | 2011-07-21 19:10:38 -0400 | |
| commit | f1fd1c9714256bb9b212462dd31ca6dc56ea31ef (patch) | |
| tree | 6d3aaaf843f758f5cd7dd2dc7641dca6ed4badca /docs | |
add in project web page
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/contents.png | bin | 0 -> 278 bytes | |||
| -rw-r--r-- | docs/crossref.png | bin | 0 -> 147 bytes | |||
| -rw-r--r-- | docs/documentation.css | 33 | ||||
| -rw-r--r-- | docs/documentation.html | 269 | ||||
| -rw-r--r-- | docs/img1.png | bin | 0 -> 154 bytes | |||
| -rw-r--r-- | docs/img2.png | bin | 0 -> 214 bytes | |||
| -rw-r--r-- | docs/img3.png | bin | 0 -> 318 bytes | |||
| -rw-r--r-- | docs/img4.png | bin | 0 -> 564 bytes | |||
| -rw-r--r-- | docs/index.html | 269 | ||||
| -rw-r--r-- | docs/next.png | bin | 0 -> 245 bytes | |||
| -rw-r--r-- | docs/next_g.png | bin | 0 -> 272 bytes | |||
| -rw-r--r-- | docs/node1.html | 128 | ||||
| -rw-r--r-- | docs/node2.html | 276 | ||||
| -rw-r--r-- | docs/node3.html | 664 | ||||
| -rw-r--r-- | docs/node4.html | 2014 | ||||
| -rw-r--r-- | docs/node5.html | 1270 | ||||
| -rw-r--r-- | docs/node6.html | 74 | ||||
| -rw-r--r-- | docs/prev.png | bin | 0 -> 279 bytes | |||
| -rw-r--r-- | docs/prev_g.png | bin | 0 -> 327 bytes | |||
| -rw-r--r-- | docs/style_1.css | 33 | ||||
| -rw-r--r-- | docs/up.png | bin | 0 -> 211 bytes | |||
| -rw-r--r-- | docs/up_g.png | bin | 0 -> 231 bytes |
22 files changed, 5030 insertions, 0 deletions
diff --git a/docs/contents.png b/docs/contents.png new file mode 100644 index 0000000..0c752c6 --- /dev/null +++ b/docs/contents.png | |||
| Binary files differ | |||
diff --git a/docs/crossref.png b/docs/crossref.png new file mode 100644 index 0000000..7dd2ddd --- /dev/null +++ b/docs/crossref.png | |||
| Binary files differ | |||
diff --git a/docs/documentation.css b/docs/documentation.css new file mode 100644 index 0000000..f12a3af --- /dev/null +++ b/docs/documentation.css | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | body { | ||
| 2 | margin-left: 3%; | ||
| 3 | background-color: #ccccFF; | ||
| 4 | font-family: sans-serif; | ||
| 5 | } | ||
| 6 | |||
| 7 | h1 { | ||
| 8 | text-align: center; | ||
| 9 | } | ||
| 10 | |||
| 11 | h2 { | ||
| 12 | margin-left: -1%; | ||
| 13 | font-size: 150%; | ||
| 14 | } | ||
| 15 | |||
| 16 | h3 { | ||
| 17 | margin-left: -1%; | ||
| 18 | } | ||
| 19 | |||
| 20 | h4 { | ||
| 21 | text-align: center; | ||
| 22 | } | ||
| 23 | |||
| 24 | p { | ||
| 25 | } | ||
| 26 | |||
| 27 | pre { | ||
| 28 | font-family: monospace; | ||
| 29 | } | ||
| 30 | |||
| 31 | DD { | ||
| 32 | font-family: monospace; | ||
| 33 | } \ No newline at end of file | ||
diff --git a/docs/documentation.html b/docs/documentation.html new file mode 100644 index 0000000..d63b31f --- /dev/null +++ b/docs/documentation.html | |||
| @@ -0,0 +1,269 @@ | |||
| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | ||
| 2 | |||
| 3 | <!--Converted with LaTeX2HTML 2002-1 (1.68) | ||
| 4 | original version by: Nikos Drakos, CBLU, University of Leeds | ||
| 5 | * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan | ||
| 6 | * with significant contributions from: | ||
| 7 | Jens Lippmann, Marek Rouchal, Martin Wilck and others --> | ||
| 8 | <HTML> | ||
| 9 | <HEAD> | ||
| 10 | <TITLE>Installing and Running mod_log_sql</TITLE> | ||
| 11 | <META NAME="description" CONTENT="Installing and Running mod_log_sql"> | ||
| 12 | <META NAME="keywords" CONTENT="documentation"> | ||
| 13 | <META NAME="resource-type" CONTENT="document"> | ||
| 14 | <META NAME="distribution" CONTENT="global"> | ||
| 15 | |||
| 16 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> | ||
| 17 | <META NAME="Generator" CONTENT="LaTeX2HTML v2002-1"> | ||
| 18 | <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> | ||
| 19 | |||
| 20 | <LINK REL="STYLESHEET" HREF="documentation.css"> | ||
| 21 | |||
| 22 | <LINK REL="next" HREF="node1.html"> | ||
| 23 | </HEAD> | ||
| 24 | |||
| 25 | <BODY > | ||
| 26 | <!--Navigation Panel--> | ||
| 27 | <A NAME="tex2html6" | ||
| 28 | HREF="node1.html"> | ||
| 29 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> | ||
| 30 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_g.png"> | ||
| 31 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev_g.png"> | ||
| 32 | <A NAME="tex2html4" | ||
| 33 | HREF="node1.html"> | ||
| 34 | <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> | ||
| 35 | <BR> | ||
| 36 | <B> Next:</B> <A NAME="tex2html7" | ||
| 37 | HREF="node1.html">Contents</A> | ||
| 38 | <B> <A NAME="tex2html5" | ||
| 39 | HREF="node1.html">Contents</A></B> | ||
| 40 | <BR> | ||
| 41 | <BR> | ||
| 42 | <!--End of Navigation Panel--> | ||
| 43 | |||
| 44 | <P> | ||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | |||
| 49 | <P> | ||
| 50 | |||
| 51 | <P> | ||
| 52 | <H1 ALIGN="CENTER">Installing and Running mod_log_sql</H1> | ||
| 53 | <P ALIGN="CENTER"><STRONG>Christopher Powell, <chris@grubbybaby.com> </STRONG></P> | ||
| 54 | <BR><HR> | ||
| 55 | <!--Table of Child-Links--> | ||
| 56 | <A NAME="CHILD_LINKS"></A> | ||
| 57 | |||
| 58 | <UL> | ||
| 59 | <LI><A NAME="tex2html8" | ||
| 60 | HREF="node1.html">Contents</A> | ||
| 61 | <LI><A NAME="tex2html9" | ||
| 62 | HREF="node2.html">1 Introduction</A> | ||
| 63 | <UL> | ||
| 64 | <LI><A NAME="tex2html10" | ||
| 65 | HREF="node2.html#SECTION00021000000000000000">1.1 Homepage </A> | ||
| 66 | <LI><A NAME="tex2html11" | ||
| 67 | HREF="node2.html#SECTION00022000000000000000">1.2 Summary</A> | ||
| 68 | <LI><A NAME="tex2html12" | ||
| 69 | HREF="node2.html#SECTION00023000000000000000">1.3 Approach</A> | ||
| 70 | <LI><A NAME="tex2html13" | ||
| 71 | HREF="node2.html#SECTION00024000000000000000">1.4 What gets logged by default? </A> | ||
| 72 | <LI><A NAME="tex2html14" | ||
| 73 | HREF="node2.html#SECTION00025000000000000000">1.5 Miscellaneous Notes</A> | ||
| 74 | <LI><A NAME="tex2html15" | ||
| 75 | HREF="node2.html#SECTION00026000000000000000">1.6 Author / Maintainer</A> | ||
| 76 | </UL> | ||
| 77 | <BR> | ||
| 78 | <LI><A NAME="tex2html16" | ||
| 79 | HREF="node3.html">2 Installation</A> | ||
| 80 | <UL> | ||
| 81 | <LI><A NAME="tex2html17" | ||
| 82 | HREF="node3.html#SECTION00031000000000000000">2.1 Requirements</A> | ||
| 83 | <LI><A NAME="tex2html18" | ||
| 84 | HREF="node3.html#SECTION00032000000000000000">2.2 Platform-specific notes</A> | ||
| 85 | <UL> | ||
| 86 | <LI><A NAME="tex2html19" | ||
| 87 | HREF="node3.html#SECTION00032100000000000000">2.2.1 Solaris</A> | ||
| 88 | <LI><A NAME="tex2html20" | ||
| 89 | HREF="node3.html#SECTION00032200000000000000">2.2.2 BSD</A> | ||
| 90 | <LI><A NAME="tex2html21" | ||
| 91 | HREF="node3.html#SECTION00032300000000000000">2.2.3 Win32</A> | ||
| 92 | </UL> | ||
| 93 | <LI><A NAME="tex2html22" | ||
| 94 | HREF="node3.html#SECTION00033000000000000000">2.3 Do I want a DSO or a static module?</A> | ||
| 95 | <LI><A NAME="tex2html23" | ||
| 96 | HREF="node3.html#SECTION00034000000000000000">2.4 Installation as an Apache DSO (Preferred) </A> | ||
| 97 | <LI><A NAME="tex2html24" | ||
| 98 | HREF="node3.html#SECTION00035000000000000000">2.5 Installation as a static module compiled into | ||
| 99 | httpd</A> | ||
| 100 | </UL> | ||
| 101 | <BR> | ||
| 102 | <LI><A NAME="tex2html25" | ||
| 103 | HREF="node4.html">3 Configuration</A> | ||
| 104 | <UL> | ||
| 105 | <LI><A NAME="tex2html26" | ||
| 106 | HREF="node4.html#SECTION00041000000000000000">3.1 Preparing MySQL for logging</A> | ||
| 107 | <LI><A NAME="tex2html27" | ||
| 108 | HREF="node4.html#SECTION00042000000000000000">3.2 A very basic logging setup in Apache</A> | ||
| 109 | <LI><A NAME="tex2html28" | ||
| 110 | HREF="node4.html#SECTION00043000000000000000">3.3 Testing the basic setup</A> | ||
| 111 | <LI><A NAME="tex2html29" | ||
| 112 | HREF="node4.html#SECTION00044000000000000000">3.4 How to tune logging with run-time directives</A> | ||
| 113 | <UL> | ||
| 114 | <LI><A NAME="tex2html30" | ||
| 115 | HREF="node4.html#SECTION00044100000000000000">3.4.1 Instructing the module what to log</A> | ||
| 116 | <LI><A NAME="tex2html31" | ||
| 117 | HREF="node4.html#SECTION00044200000000000000">3.4.2 Instructing the module what NOT to log using filtering | ||
| 118 | directives</A> | ||
| 119 | </UL> | ||
| 120 | <LI><A NAME="tex2html32" | ||
| 121 | HREF="node4.html#SECTION00045000000000000000">3.5 Advanced logging scenarios</A> | ||
| 122 | <UL> | ||
| 123 | <LI><A NAME="tex2html33" | ||
| 124 | HREF="node4.html#SECTION00045100000000000000">3.5.1 Using the module in an ISP environment</A> | ||
| 125 | <LI><A NAME="tex2html34" | ||
| 126 | HREF="node4.html#SECTION00045200000000000000">3.5.2 Logging many-to-one data in separate tables</A> | ||
| 127 | <LI><A NAME="tex2html35" | ||
| 128 | HREF="node4.html#SECTION00045300000000000000">3.5.3 Using the same database for production and test</A> | ||
| 129 | <LI><A NAME="tex2html36" | ||
| 130 | HREF="node4.html#SECTION00045400000000000000">3.5.4 Optimizing for a busy database</A> | ||
| 131 | </UL> | ||
| 132 | <LI><A NAME="tex2html37" | ||
| 133 | HREF="node4.html#SECTION00046000000000000000">3.6 Configuration directive reference</A> | ||
| 134 | <UL> | ||
| 135 | <LI><A NAME="tex2html38" | ||
| 136 | HREF="node4.html#SECTION00046100000000000000">3.6.1 LogSQLCookieLogTable</A> | ||
| 137 | <LI><A NAME="tex2html39" | ||
| 138 | HREF="node4.html#SECTION00046200000000000000">3.6.2 LogSQLCreateTables</A> | ||
| 139 | <LI><A NAME="tex2html40" | ||
| 140 | HREF="node4.html#SECTION00046300000000000000">3.6.3 LogSQLDatabase </A> | ||
| 141 | <LI><A NAME="tex2html41" | ||
| 142 | HREF="node4.html#SECTION00046400000000000000">3.6.4 LogSQLForcePreserve</A> | ||
| 143 | <LI><A NAME="tex2html42" | ||
| 144 | HREF="node4.html#SECTION00046500000000000000">3.6.5 LogSQLHeadersInLogTable</A> | ||
| 145 | <LI><A NAME="tex2html43" | ||
| 146 | HREF="node4.html#SECTION00046600000000000000">3.6.6 LogSQLHeadersOutLogTable</A> | ||
| 147 | <LI><A NAME="tex2html44" | ||
| 148 | HREF="node4.html#SECTION00046700000000000000">3.6.7 LogSQLLoginInfo </A> | ||
| 149 | <LI><A NAME="tex2html45" | ||
| 150 | HREF="node4.html#SECTION00046800000000000000">3.6.8 LogSQLMachineID</A> | ||
| 151 | <LI><A NAME="tex2html46" | ||
| 152 | HREF="node4.html#SECTION00046900000000000000">3.6.9 LogSQLMassVirtualHosting</A> | ||
| 153 | <LI><A NAME="tex2html47" | ||
| 154 | HREF="node4.html#SECTION000461000000000000000">3.6.10 LogSQLNotesLogTable</A> | ||
| 155 | <LI><A NAME="tex2html48" | ||
| 156 | HREF="node4.html#SECTION000461100000000000000">3.6.11 LogSQLPreserveFile</A> | ||
| 157 | <LI><A NAME="tex2html49" | ||
| 158 | HREF="node4.html#SECTION000461200000000000000">3.6.12 LogSQLRemhostIgnore</A> | ||
| 159 | <LI><A NAME="tex2html50" | ||
| 160 | HREF="node4.html#SECTION000461300000000000000">3.6.13 LogSQLRequestAccept</A> | ||
| 161 | <LI><A NAME="tex2html51" | ||
| 162 | HREF="node4.html#SECTION000461400000000000000">3.6.14 LogSQLRequestIgnore</A> | ||
| 163 | <LI><A NAME="tex2html52" | ||
| 164 | HREF="node4.html#SECTION000461500000000000000">3.6.15 LogSQLSocketFile </A> | ||
| 165 | <LI><A NAME="tex2html53" | ||
| 166 | HREF="node4.html#SECTION000461600000000000000">3.6.16 LogSQLTCPPort</A> | ||
| 167 | <LI><A NAME="tex2html54" | ||
| 168 | HREF="node4.html#SECTION000461700000000000000">3.6.17 LogSQLTransferLogFormat </A> | ||
| 169 | <LI><A NAME="tex2html55" | ||
| 170 | HREF="node4.html#SECTION000461800000000000000">3.6.18 LogSQLTransferLogTable</A> | ||
| 171 | <LI><A NAME="tex2html56" | ||
| 172 | HREF="node4.html#SECTION000461900000000000000">3.6.19 LogSQLWhichCookie</A> | ||
| 173 | <LI><A NAME="tex2html57" | ||
| 174 | HREF="node4.html#SECTION000462000000000000000">3.6.20 LogSQLWhichCookies</A> | ||
| 175 | <LI><A NAME="tex2html58" | ||
| 176 | HREF="node4.html#SECTION000462100000000000000">3.6.21 LogSQLWhichHeadersIn</A> | ||
| 177 | <LI><A NAME="tex2html59" | ||
| 178 | HREF="node4.html#SECTION000462200000000000000">3.6.22 LogSQLWhichHeadersOut</A> | ||
| 179 | <LI><A NAME="tex2html60" | ||
| 180 | HREF="node4.html#SECTION000462300000000000000">3.6.23 LogSQLWhichNotes</A> | ||
| 181 | </UL> | ||
| 182 | </UL> | ||
| 183 | <BR> | ||
| 184 | <LI><A NAME="tex2html61" | ||
| 185 | HREF="node5.html">4 FAQ</A> | ||
| 186 | <UL> | ||
| 187 | <LI><A NAME="tex2html62" | ||
| 188 | HREF="node5.html#SECTION00051000000000000000">4.1 General module questions</A> | ||
| 189 | <UL> | ||
| 190 | <LI><A NAME="tex2html63" | ||
| 191 | HREF="node5.html#SECTION00051100000000000000">4.1.1 Why log to an SQL database?</A> | ||
| 192 | <LI><A NAME="tex2html64" | ||
| 193 | HREF="node5.html#SECTION00051200000000000000">4.1.2 Why use MySQL? Are there alternatives?</A> | ||
| 194 | <LI><A NAME="tex2html65" | ||
| 195 | HREF="node5.html#SECTION00051300000000000000">4.1.3 Is this code production-ready?</A> | ||
| 196 | <LI><A NAME="tex2html66" | ||
| 197 | HREF="node5.html#SECTION00051400000000000000">4.1.4 Who's using mod_log_sql?</A> | ||
| 198 | <LI><A NAME="tex2html67" | ||
| 199 | HREF="node5.html#SECTION00051500000000000000">4.1.5 Why doesn't the module also replace the Apache ErrorLog?</A> | ||
| 200 | <LI><A NAME="tex2html68" | ||
| 201 | HREF="node5.html#SECTION00051600000000000000">4.1.6 Does mod_log_sql work with Apache 2.x?</A> | ||
| 202 | <LI><A NAME="tex2html69" | ||
| 203 | HREF="node5.html#SECTION00051700000000000000">4.1.7 Does mod_log_sql connect to MySQL via TCP/IP or a socket?</A> | ||
| 204 | <LI><A NAME="tex2html70" | ||
| 205 | HREF="node5.html#SECTION00051800000000000000">4.1.8 I have discovered a bug. Who can I contact?</A> | ||
| 206 | </UL> | ||
| 207 | <LI><A NAME="tex2html71" | ||
| 208 | HREF="node5.html#SECTION00052000000000000000">4.2 Problems</A> | ||
| 209 | <UL> | ||
| 210 | <LI><A NAME="tex2html72" | ||
| 211 | HREF="node5.html#SECTION00052100000000000000">4.2.1 Apache segfaults when using PHP and mod_log_sql</A> | ||
| 212 | <LI><A NAME="tex2html73" | ||
| 213 | HREF="node5.html#SECTION00052200000000000000">4.2.2 Apache appears to start up fine, but nothing | ||
| 214 | is getting logged in the database</A> | ||
| 215 | <LI><A NAME="tex2html74" | ||
| 216 | HREF="node5.html#SECTION00052300000000000000">4.2.3 Why do I get the message ``insufficient configuration info to | ||
| 217 | establish database link'' in my Apache error log?</A> | ||
| 218 | <LI><A NAME="tex2html75" | ||
| 219 | HREF="node5.html#SECTION00052400000000000000">4.2.4 My database cannot handle all the open connections from mod_log_sql, | ||
| 220 | is there anything I can do?</A> | ||
| 221 | <LI><A NAME="tex2html76" | ||
| 222 | HREF="node5.html#SECTION00052500000000000000">4.2.5 Why do I occasionally see a ``lost connection to MySQL server'' | ||
| 223 | message in my Apache error log?</A> | ||
| 224 | </UL> | ||
| 225 | <LI><A NAME="tex2html77" | ||
| 226 | HREF="node5.html#SECTION00053000000000000000">4.3 Performance and Tuning</A> | ||
| 227 | <UL> | ||
| 228 | <LI><A NAME="tex2html78" | ||
| 229 | HREF="node5.html#SECTION00053100000000000000">4.3.1 How well does it perform?</A> | ||
| 230 | <LI><A NAME="tex2html79" | ||
| 231 | HREF="node5.html#SECTION00053200000000000000">4.3.2 Do I need to be worried about all the running MySQL children? Will | ||
| 232 | holding open <I>n</I> Apache-to-MySQL connections consume a lot of | ||
| 233 | memory? </A> | ||
| 234 | <LI><A NAME="tex2html80" | ||
| 235 | HREF="node5.html#SECTION00053300000000000000">4.3.3 My webserver cannot handle all the traffic that my site receives, | ||
| 236 | is there anything I can do?</A> | ||
| 237 | <LI><A NAME="tex2html81" | ||
| 238 | HREF="node5.html#SECTION00053400000000000000">4.3.4 What is the issue with activating delayed | ||
| 239 | inserts?</A> | ||
| 240 | </UL> | ||
| 241 | <LI><A NAME="tex2html82" | ||
| 242 | HREF="node5.html#SECTION00054000000000000000">4.4 ``How do I...?'' - accomplishing certain tasks</A> | ||
| 243 | <UL> | ||
| 244 | <LI><A NAME="tex2html83" | ||
| 245 | HREF="node5.html#SECTION00054100000000000000">4.4.1 I am using LogSQLMassVirtualHosting, and sometimes a single VirtualHost | ||
| 246 | gets logged to two different tables. How do I prevent that?</A> | ||
| 247 | <LI><A NAME="tex2html84" | ||
| 248 | HREF="node5.html#SECTION00054200000000000000">4.4.2 How do I extract the data in a format that my analysis tool can understand?</A> | ||
| 249 | <LI><A NAME="tex2html85" | ||
| 250 | HREF="node5.html#SECTION00054300000000000000">4.4.3 How can I log mod_usertrack cookies?</A> | ||
| 251 | <LI><A NAME="tex2html86" | ||
| 252 | HREF="node5.html#SECTION00054400000000000000">4.4.4 What if I want to log more than one cookie? What is the difference | ||
| 253 | between LogSQLWhichCookie and LogSQLWhichCookies?</A> | ||
| 254 | <LI><A NAME="tex2html87" | ||
| 255 | HREF="node5.html#SECTION00054500000000000000">4.4.5 What are the SSL logging features, and how do I activate them?</A> | ||
| 256 | </UL> | ||
| 257 | </UL> | ||
| 258 | <BR> | ||
| 259 | <LI><A NAME="tex2html88" | ||
| 260 | HREF="node6.html">About this document ...</A> | ||
| 261 | </UL> | ||
| 262 | <!--End of Table of Child-Links--> | ||
| 263 | <BR><HR> | ||
| 264 | <ADDRESS> | ||
| 265 | Chris Powell | ||
| 266 | 2002-12-18 | ||
| 267 | </ADDRESS> | ||
| 268 | </BODY> | ||
| 269 | </HTML> | ||
diff --git a/docs/img1.png b/docs/img1.png new file mode 100644 index 0000000..d34217e --- /dev/null +++ b/docs/img1.png | |||
| Binary files differ | |||
diff --git a/docs/img2.png b/docs/img2.png new file mode 100644 index 0000000..df51a7c --- /dev/null +++ b/docs/img2.png | |||
| Binary files differ | |||
diff --git a/docs/img3.png b/docs/img3.png new file mode 100644 index 0000000..1cd68cf --- /dev/null +++ b/docs/img3.png | |||
| Binary files differ | |||
diff --git a/docs/img4.png b/docs/img4.png new file mode 100644 index 0000000..1e2543f --- /dev/null +++ b/docs/img4.png | |||
| Binary files differ | |||
diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..d63b31f --- /dev/null +++ b/docs/index.html | |||
| @@ -0,0 +1,269 @@ | |||
| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | ||
| 2 | |||
| 3 | <!--Converted with LaTeX2HTML 2002-1 (1.68) | ||
| 4 | original version by: Nikos Drakos, CBLU, University of Leeds | ||
| 5 | * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan | ||
| 6 | * with significant contributions from: | ||
| 7 | Jens Lippmann, Marek Rouchal, Martin Wilck and others --> | ||
| 8 | <HTML> | ||
| 9 | <HEAD> | ||
| 10 | <TITLE>Installing and Running mod_log_sql</TITLE> | ||
| 11 | <META NAME="description" CONTENT="Installing and Running mod_log_sql"> | ||
| 12 | <META NAME="keywords" CONTENT="documentation"> | ||
| 13 | <META NAME="resource-type" CONTENT="document"> | ||
| 14 | <META NAME="distribution" CONTENT="global"> | ||
| 15 | |||
| 16 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> | ||
| 17 | <META NAME="Generator" CONTENT="LaTeX2HTML v2002-1"> | ||
| 18 | <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> | ||
| 19 | |||
| 20 | <LINK REL="STYLESHEET" HREF="documentation.css"> | ||
| 21 | |||
| 22 | <LINK REL="next" HREF="node1.html"> | ||
| 23 | </HEAD> | ||
| 24 | |||
| 25 | <BODY > | ||
| 26 | <!--Navigation Panel--> | ||
| 27 | <A NAME="tex2html6" | ||
| 28 | HREF="node1.html"> | ||
| 29 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> | ||
| 30 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_g.png"> | ||
| 31 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev_g.png"> | ||
| 32 | <A NAME="tex2html4" | ||
| 33 | HREF="node1.html"> | ||
| 34 | <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> | ||
| 35 | <BR> | ||
| 36 | <B> Next:</B> <A NAME="tex2html7" | ||
| 37 | HREF="node1.html">Contents</A> | ||
| 38 | <B> <A NAME="tex2html5" | ||
| 39 | HREF="node1.html">Contents</A></B> | ||
| 40 | <BR> | ||
| 41 | <BR> | ||
| 42 | <!--End of Navigation Panel--> | ||
| 43 | |||
| 44 | <P> | ||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | |||
| 49 | <P> | ||
| 50 | |||
| 51 | <P> | ||
| 52 | <H1 ALIGN="CENTER">Installing and Running mod_log_sql</H1> | ||
| 53 | <P ALIGN="CENTER"><STRONG>Christopher Powell, <chris@grubbybaby.com> </STRONG></P> | ||
| 54 | <BR><HR> | ||
| 55 | <!--Table of Child-Links--> | ||
| 56 | <A NAME="CHILD_LINKS"></A> | ||
| 57 | |||
| 58 | <UL> | ||
| 59 | <LI><A NAME="tex2html8" | ||
| 60 | HREF="node1.html">Contents</A> | ||
| 61 | <LI><A NAME="tex2html9" | ||
| 62 | HREF="node2.html">1 Introduction</A> | ||
| 63 | <UL> | ||
| 64 | <LI><A NAME="tex2html10" | ||
| 65 | HREF="node2.html#SECTION00021000000000000000">1.1 Homepage </A> | ||
| 66 | <LI><A NAME="tex2html11" | ||
| 67 | HREF="node2.html#SECTION00022000000000000000">1.2 Summary</A> | ||
| 68 | <LI><A NAME="tex2html12" | ||
| 69 | HREF="node2.html#SECTION00023000000000000000">1.3 Approach</A> | ||
| 70 | <LI><A NAME="tex2html13" | ||
| 71 | HREF="node2.html#SECTION00024000000000000000">1.4 What gets logged by default? </A> | ||
| 72 | <LI><A NAME="tex2html14" | ||
| 73 | HREF="node2.html#SECTION00025000000000000000">1.5 Miscellaneous Notes</A> | ||
| 74 | <LI><A NAME="tex2html15" | ||
| 75 | HREF="node2.html#SECTION00026000000000000000">1.6 Author / Maintainer</A> | ||
| 76 | </UL> | ||
| 77 | <BR> | ||
| 78 | <LI><A NAME="tex2html16" | ||
| 79 | HREF="node3.html">2 Installation</A> | ||
| 80 | <UL> | ||
| 81 | <LI><A NAME="tex2html17" | ||
| 82 | HREF="node3.html#SECTION00031000000000000000">2.1 Requirements</A> | ||
| 83 | <LI><A NAME="tex2html18" | ||
| 84 | HREF="node3.html#SECTION00032000000000000000">2.2 Platform-specific notes</A> | ||
| 85 | <UL> | ||
| 86 | <LI><A NAME="tex2html19" | ||
| 87 | HREF="node3.html#SECTION00032100000000000000">2.2.1 Solaris</A> | ||
| 88 | <LI><A NAME="tex2html20" | ||
| 89 | HREF="node3.html#SECTION00032200000000000000">2.2.2 BSD</A> | ||
| 90 | <LI><A NAME="tex2html21" | ||
| 91 | HREF="node3.html#SECTION00032300000000000000">2.2.3 Win32</A> | ||
| 92 | </UL> | ||
| 93 | <LI><A NAME="tex2html22" | ||
| 94 | HREF="node3.html#SECTION00033000000000000000">2.3 Do I want a DSO or a static module?</A> | ||
| 95 | <LI><A NAME="tex2html23" | ||
| 96 | HREF="node3.html#SECTION00034000000000000000">2.4 Installation as an Apache DSO (Preferred) </A> | ||
| 97 | <LI><A NAME="tex2html24" | ||
| 98 | HREF="node3.html#SECTION00035000000000000000">2.5 Installation as a static module compiled into | ||
| 99 | httpd</A> | ||
| 100 | </UL> | ||
| 101 | <BR> | ||
| 102 | <LI><A NAME="tex2html25" | ||
| 103 | HREF="node4.html">3 Configuration</A> | ||
| 104 | <UL> | ||
| 105 | <LI><A NAME="tex2html26" | ||
| 106 | HREF="node4.html#SECTION00041000000000000000">3.1 Preparing MySQL for logging</A> | ||
| 107 | <LI><A NAME="tex2html27" | ||
| 108 | HREF="node4.html#SECTION00042000000000000000">3.2 A very basic logging setup in Apache</A> | ||
| 109 | <LI><A NAME="tex2html28" | ||
| 110 | HREF="node4.html#SECTION00043000000000000000">3.3 Testing the basic setup</A> | ||
| 111 | <LI><A NAME="tex2html29" | ||
| 112 | HREF="node4.html#SECTION00044000000000000000">3.4 How to tune logging with run-time directives</A> | ||
| 113 | <UL> | ||
| 114 | <LI><A NAME="tex2html30" | ||
| 115 | HREF="node4.html#SECTION00044100000000000000">3.4.1 Instructing the module what to log</A> | ||
| 116 | <LI><A NAME="tex2html31" | ||
| 117 | HREF="node4.html#SECTION00044200000000000000">3.4.2 Instructing the module what NOT to log using filtering | ||
| 118 | directives</A> | ||
| 119 | </UL> | ||
| 120 | <LI><A NAME="tex2html32" | ||
| 121 | HREF="node4.html#SECTION00045000000000000000">3.5 Advanced logging scenarios</A> | ||
| 122 | <UL> | ||
| 123 | <LI><A NAME="tex2html33" | ||
| 124 | HREF="node4.html#SECTION00045100000000000000">3.5.1 Using the module in an ISP environment</A> | ||
| 125 | <LI><A NAME="tex2html34" | ||
| 126 | HREF="node4.html#SECTION00045200000000000000">3.5.2 Logging many-to-one data in separate tables</A> | ||
| 127 | <LI><A NAME="tex2html35" | ||
| 128 | HREF="node4.html#SECTION00045300000000000000">3.5.3 Using the same database for production and test</A> | ||
| 129 | <LI><A NAME="tex2html36" | ||
| 130 | HREF="node4.html#SECTION00045400000000000000">3.5.4 Optimizing for a busy database</A> | ||
| 131 | </UL> | ||
| 132 | <LI><A NAME="tex2html37" | ||
| 133 | HREF="node4.html#SECTION00046000000000000000">3.6 Configuration directive reference</A> | ||
| 134 | <UL> | ||
| 135 | <LI><A NAME="tex2html38" | ||
| 136 | HREF="node4.html#SECTION00046100000000000000">3.6.1 LogSQLCookieLogTable</A> | ||
| 137 | <LI><A NAME="tex2html39" | ||
| 138 | HREF="node4.html#SECTION00046200000000000000">3.6.2 LogSQLCreateTables</A> | ||
| 139 | <LI><A NAME="tex2html40" | ||
| 140 | HREF="node4.html#SECTION00046300000000000000">3.6.3 LogSQLDatabase </A> | ||
| 141 | <LI><A NAME="tex2html41" | ||
| 142 | HREF="node4.html#SECTION00046400000000000000">3.6.4 LogSQLForcePreserve</A> | ||
| 143 | <LI><A NAME="tex2html42" | ||
| 144 | HREF="node4.html#SECTION00046500000000000000">3.6.5 LogSQLHeadersInLogTable</A> | ||
| 145 | <LI><A NAME="tex2html43" | ||
| 146 | HREF="node4.html#SECTION00046600000000000000">3.6.6 LogSQLHeadersOutLogTable</A> | ||
| 147 | <LI><A NAME="tex2html44" | ||
| 148 | HREF="node4.html#SECTION00046700000000000000">3.6.7 LogSQLLoginInfo </A> | ||
| 149 | <LI><A NAME="tex2html45" | ||
| 150 | HREF="node4.html#SECTION00046800000000000000">3.6.8 LogSQLMachineID</A> | ||
| 151 | <LI><A NAME="tex2html46" | ||
| 152 | HREF="node4.html#SECTION00046900000000000000">3.6.9 LogSQLMassVirtualHosting</A> | ||
| 153 | <LI><A NAME="tex2html47" | ||
| 154 | HREF="node4.html#SECTION000461000000000000000">3.6.10 LogSQLNotesLogTable</A> | ||
| 155 | <LI><A NAME="tex2html48" | ||
| 156 | HREF="node4.html#SECTION000461100000000000000">3.6.11 LogSQLPreserveFile</A> | ||
| 157 | <LI><A NAME="tex2html49" | ||
| 158 | HREF="node4.html#SECTION000461200000000000000">3.6.12 LogSQLRemhostIgnore</A> | ||
| 159 | <LI><A NAME="tex2html50" | ||
| 160 | HREF="node4.html#SECTION000461300000000000000">3.6.13 LogSQLRequestAccept</A> | ||
| 161 | <LI><A NAME="tex2html51" | ||
| 162 | HREF="node4.html#SECTION000461400000000000000">3.6.14 LogSQLRequestIgnore</A> | ||
| 163 | <LI><A NAME="tex2html52" | ||
| 164 | HREF="node4.html#SECTION000461500000000000000">3.6.15 LogSQLSocketFile </A> | ||
| 165 | <LI><A NAME="tex2html53" | ||
| 166 | HREF="node4.html#SECTION000461600000000000000">3.6.16 LogSQLTCPPort</A> | ||
| 167 | <LI><A NAME="tex2html54" | ||
| 168 | HREF="node4.html#SECTION000461700000000000000">3.6.17 LogSQLTransferLogFormat </A> | ||
| 169 | <LI><A NAME="tex2html55" | ||
| 170 | HREF="node4.html#SECTION000461800000000000000">3.6.18 LogSQLTransferLogTable</A> | ||
| 171 | <LI><A NAME="tex2html56" | ||
| 172 | HREF="node4.html#SECTION000461900000000000000">3.6.19 LogSQLWhichCookie</A> | ||
| 173 | <LI><A NAME="tex2html57" | ||
| 174 | HREF="node4.html#SECTION000462000000000000000">3.6.20 LogSQLWhichCookies</A> | ||
| 175 | <LI><A NAME="tex2html58" | ||
| 176 | HREF="node4.html#SECTION000462100000000000000">3.6.21 LogSQLWhichHeadersIn</A> | ||
| 177 | <LI><A NAME="tex2html59" | ||
| 178 | HREF="node4.html#SECTION000462200000000000000">3.6.22 LogSQLWhichHeadersOut</A> | ||
| 179 | <LI><A NAME="tex2html60" | ||
| 180 | HREF="node4.html#SECTION000462300000000000000">3.6.23 LogSQLWhichNotes</A> | ||
| 181 | </UL> | ||
| 182 | </UL> | ||
| 183 | <BR> | ||
| 184 | <LI><A NAME="tex2html61" | ||
| 185 | HREF="node5.html">4 FAQ</A> | ||
| 186 | <UL> | ||
| 187 | <LI><A NAME="tex2html62" | ||
| 188 | HREF="node5.html#SECTION00051000000000000000">4.1 General module questions</A> | ||
| 189 | <UL> | ||
| 190 | <LI><A NAME="tex2html63" | ||
| 191 | HREF="node5.html#SECTION00051100000000000000">4.1.1 Why log to an SQL database?</A> | ||
| 192 | <LI><A NAME="tex2html64" | ||
| 193 | HREF="node5.html#SECTION00051200000000000000">4.1.2 Why use MySQL? Are there alternatives?</A> | ||
| 194 | <LI><A NAME="tex2html65" | ||
| 195 | HREF="node5.html#SECTION00051300000000000000">4.1.3 Is this code production-ready?</A> | ||
| 196 | <LI><A NAME="tex2html66" | ||
| 197 | HREF="node5.html#SECTION00051400000000000000">4.1.4 Who's using mod_log_sql?</A> | ||
| 198 | <LI><A NAME="tex2html67" | ||
| 199 | HREF="node5.html#SECTION00051500000000000000">4.1.5 Why doesn't the module also replace the Apache ErrorLog?</A> | ||
| 200 | <LI><A NAME="tex2html68" | ||
| 201 | HREF="node5.html#SECTION00051600000000000000">4.1.6 Does mod_log_sql work with Apache 2.x?</A> | ||
| 202 | <LI><A NAME="tex2html69" | ||
| 203 | HREF="node5.html#SECTION00051700000000000000">4.1.7 Does mod_log_sql connect to MySQL via TCP/IP or a socket?</A> | ||
| 204 | <LI><A NAME="tex2html70" | ||
| 205 | HREF="node5.html#SECTION00051800000000000000">4.1.8 I have discovered a bug. Who can I contact?</A> | ||
| 206 | </UL> | ||
| 207 | <LI><A NAME="tex2html71" | ||
| 208 | HREF="node5.html#SECTION00052000000000000000">4.2 Problems</A> | ||
| 209 | <UL> | ||
| 210 | <LI><A NAME="tex2html72" | ||
| 211 | HREF="node5.html#SECTION00052100000000000000">4.2.1 Apache segfaults when using PHP and mod_log_sql</A> | ||
| 212 | <LI><A NAME="tex2html73" | ||
| 213 | HREF="node5.html#SECTION00052200000000000000">4.2.2 Apache appears to start up fine, but nothing | ||
| 214 | is getting logged in the database</A> | ||
| 215 | <LI><A NAME="tex2html74" | ||
| 216 | HREF="node5.html#SECTION00052300000000000000">4.2.3 Why do I get the message ``insufficient configuration info to | ||
| 217 | establish database link'' in my Apache error log?</A> | ||
| 218 | <LI><A NAME="tex2html75" | ||
| 219 | HREF="node5.html#SECTION00052400000000000000">4.2.4 My database cannot handle all the open connections from mod_log_sql, | ||
| 220 | is there anything I can do?</A> | ||
| 221 | <LI><A NAME="tex2html76" | ||
| 222 | HREF="node5.html#SECTION00052500000000000000">4.2.5 Why do I occasionally see a ``lost connection to MySQL server'' | ||
| 223 | message in my Apache error log?</A> | ||
| 224 | </UL> | ||
| 225 | <LI><A NAME="tex2html77" | ||
| 226 | HREF="node5.html#SECTION00053000000000000000">4.3 Performance and Tuning</A> | ||
| 227 | <UL> | ||
| 228 | <LI><A NAME="tex2html78" | ||
| 229 | HREF="node5.html#SECTION00053100000000000000">4.3.1 How well does it perform?</A> | ||
| 230 | <LI><A NAME="tex2html79" | ||
| 231 | HREF="node5.html#SECTION00053200000000000000">4.3.2 Do I need to be worried about all the running MySQL children? Will | ||
| 232 | holding open <I>n</I> Apache-to-MySQL connections consume a lot of | ||
| 233 | memory? </A> | ||
| 234 | <LI><A NAME="tex2html80" | ||
| 235 | HREF="node5.html#SECTION00053300000000000000">4.3.3 My webserver cannot handle all the traffic that my site receives, | ||
| 236 | is there anything I can do?</A> | ||
| 237 | <LI><A NAME="tex2html81" | ||
| 238 | HREF="node5.html#SECTION00053400000000000000">4.3.4 What is the issue with activating delayed | ||
| 239 | inserts?</A> | ||
| 240 | </UL> | ||
| 241 | <LI><A NAME="tex2html82" | ||
| 242 | HREF="node5.html#SECTION00054000000000000000">4.4 ``How do I...?'' - accomplishing certain tasks</A> | ||
| 243 | <UL> | ||
| 244 | <LI><A NAME="tex2html83" | ||
| 245 | HREF="node5.html#SECTION00054100000000000000">4.4.1 I am using LogSQLMassVirtualHosting, and sometimes a single VirtualHost | ||
| 246 | gets logged to two different tables. How do I prevent that?</A> | ||
| 247 | <LI><A NAME="tex2html84" | ||
| 248 | HREF="node5.html#SECTION00054200000000000000">4.4.2 How do I extract the data in a format that my analysis tool can understand?</A> | ||
| 249 | <LI><A NAME="tex2html85" | ||
| 250 | HREF="node5.html#SECTION00054300000000000000">4.4.3 How can I log mod_usertrack cookies?</A> | ||
| 251 | <LI><A NAME="tex2html86" | ||
| 252 | HREF="node5.html#SECTION00054400000000000000">4.4.4 What if I want to log more than one cookie? What is the difference | ||
| 253 | between LogSQLWhichCookie and LogSQLWhichCookies?</A> | ||
| 254 | <LI><A NAME="tex2html87" | ||
| 255 | HREF="node5.html#SECTION00054500000000000000">4.4.5 What are the SSL logging features, and how do I activate them?</A> | ||
| 256 | </UL> | ||
| 257 | </UL> | ||
| 258 | <BR> | ||
| 259 | <LI><A NAME="tex2html88" | ||
| 260 | HREF="node6.html">About this document ...</A> | ||
| 261 | </UL> | ||
| 262 | <!--End of Table of Child-Links--> | ||
| 263 | <BR><HR> | ||
| 264 | <ADDRESS> | ||
| 265 | Chris Powell | ||
| 266 | 2002-12-18 | ||
| 267 | </ADDRESS> | ||
| 268 | </BODY> | ||
| 269 | </HTML> | ||
diff --git a/docs/next.png b/docs/next.png new file mode 100644 index 0000000..1628652 --- /dev/null +++ b/docs/next.png | |||
| Binary files differ | |||
diff --git a/docs/next_g.png b/docs/next_g.png new file mode 100644 index 0000000..9d3f591 --- /dev/null +++ b/docs/next_g.png | |||
| Binary files differ | |||
diff --git a/docs/node1.html b/docs/node1.html new file mode 100644 index 0000000..0238180 --- /dev/null +++ b/docs/node1.html | |||
| @@ -0,0 +1,128 @@ | |||
| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | ||
| 2 | |||
| 3 | <!--Converted with LaTeX2HTML 2002-1 (1.68) | ||
| 4 | original version by: Nikos Drakos, CBLU, University of Leeds | ||
| 5 | * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan | ||
| 6 | * with significant contributions from: | ||
| 7 | Jens Lippmann, Marek Rouchal, Martin Wilck and others --> | ||
| 8 | <HTML> | ||
| 9 | <HEAD> | ||
| 10 | <TITLE>Contents</TITLE> | ||
| 11 | <META NAME="description" CONTENT="Contents"> | ||
| 12 | <META NAME="keywords" CONTENT="documentation"> | ||
| 13 | <META NAME="resource-type" CONTENT="document"> | ||
| 14 | <META NAME="distribution" CONTENT="global"> | ||
| 15 | |||
| 16 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> | ||
| 17 | <META NAME="Generator" CONTENT="LaTeX2HTML v2002-1"> | ||
| 18 | <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> | ||
| 19 | |||
| 20 | <LINK REL="STYLESHEET" HREF="documentation.css"> | ||
| 21 | |||
| 22 | <LINK REL="next" HREF="node2.html"> | ||
| 23 | <LINK REL="previous" HREF="documentation.html"> | ||
| 24 | <LINK REL="up" HREF="documentation.html"> | ||
| 25 | <LINK REL="next" HREF="node2.html"> | ||
| 26 | </HEAD> | ||
| 27 | |||
| 28 | <BODY > | ||
| 29 | <!--Navigation Panel--> | ||
| 30 | <A NAME="tex2html97" | ||
| 31 | HREF="node2.html"> | ||
| 32 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> | ||
| 33 | <A NAME="tex2html95" | ||
| 34 | HREF="documentation.html"> | ||
| 35 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> | ||
| 36 | <A NAME="tex2html89" | ||
| 37 | HREF="documentation.html"> | ||
| 38 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> | ||
| 39 | <BR> | ||
| 40 | <B> Next:</B> <A NAME="tex2html98" | ||
| 41 | HREF="node2.html">1 Introduction</A> | ||
| 42 | <B> Up:</B> <A NAME="tex2html96" | ||
| 43 | HREF="documentation.html">Installing and Running mod_log_sql</A> | ||
| 44 | <B> Previous:</B> <A NAME="tex2html90" | ||
| 45 | HREF="documentation.html">Installing and Running mod_log_sql</A> | ||
| 46 | <BR> | ||
| 47 | <BR> | ||
| 48 | <!--End of Navigation Panel--> | ||
| 49 | <BR> | ||
| 50 | |||
| 51 | <H2><A NAME="SECTION00010000000000000000"> | ||
| 52 | Contents</A> | ||
| 53 | </H2> | ||
| 54 | <!--Table of Contents--> | ||
| 55 | |||
| 56 | <UL> | ||
| 57 | <LI><A NAME="tex2html99" | ||
| 58 | HREF="node2.html">1 Introduction</A> | ||
| 59 | <UL> | ||
| 60 | <LI><A NAME="tex2html100" | ||
| 61 | HREF="node2.html#SECTION00021000000000000000">1.1 Homepage </A> | ||
| 62 | <LI><A NAME="tex2html101" | ||
| 63 | HREF="node2.html#SECTION00022000000000000000">1.2 Summary</A> | ||
| 64 | <LI><A NAME="tex2html102" | ||
| 65 | HREF="node2.html#SECTION00023000000000000000">1.3 Approach</A> | ||
| 66 | <LI><A NAME="tex2html103" | ||
| 67 | HREF="node2.html#SECTION00024000000000000000">1.4 What gets logged by default? </A> | ||
| 68 | <LI><A NAME="tex2html104" | ||
| 69 | HREF="node2.html#SECTION00025000000000000000">1.5 Miscellaneous Notes</A> | ||
| 70 | <LI><A NAME="tex2html105" | ||
| 71 | HREF="node2.html#SECTION00026000000000000000">1.6 Author / Maintainer</A> | ||
| 72 | </UL> | ||
| 73 | <BR> | ||
| 74 | <LI><A NAME="tex2html106" | ||
| 75 | HREF="node3.html">2 Installation</A> | ||
| 76 | <UL> | ||
| 77 | <LI><A NAME="tex2html107" | ||
| 78 | HREF="node3.html#SECTION00031000000000000000">2.1 Requirements</A> | ||
| 79 | <LI><A NAME="tex2html108" | ||
| 80 | HREF="node3.html#SECTION00032000000000000000">2.2 Platform-specific notes</A> | ||
| 81 | <LI><A NAME="tex2html109" | ||
| 82 | HREF="node3.html#SECTION00033000000000000000">2.3 Do I want a DSO or a static module?</A> | ||
| 83 | <LI><A NAME="tex2html110" | ||
| 84 | HREF="node3.html#SECTION00034000000000000000">2.4 Installation as an Apache DSO (Preferred) </A> | ||
| 85 | <LI><A NAME="tex2html111" | ||
| 86 | HREF="node3.html#SECTION00035000000000000000">2.5 Installation as a static module compiled into | ||
| 87 | httpd</A> | ||
| 88 | </UL> | ||
| 89 | <BR> | ||
| 90 | <LI><A NAME="tex2html112" | ||
| 91 | HREF="node4.html">3 Configuration</A> | ||
| 92 | <UL> | ||
| 93 | <LI><A NAME="tex2html113" | ||
| 94 | HREF="node4.html#SECTION00041000000000000000">3.1 Preparing MySQL for logging</A> | ||
| 95 | <LI><A NAME="tex2html114" | ||
| 96 | HREF="node4.html#SECTION00042000000000000000">3.2 A very basic logging setup in Apache</A> | ||
| 97 | <LI><A NAME="tex2html115" | ||
| 98 | HREF="node4.html#SECTION00043000000000000000">3.3 Testing the basic setup</A> | ||
| 99 | <LI><A NAME="tex2html116" | ||
| 100 | HREF="node4.html#SECTION00044000000000000000">3.4 How to tune logging with run-time directives</A> | ||
| 101 | <LI><A NAME="tex2html117" | ||
| 102 | HREF="node4.html#SECTION00045000000000000000">3.5 Advanced logging scenarios</A> | ||
| 103 | <LI><A NAME="tex2html118" | ||
| 104 | HREF="node4.html#SECTION00046000000000000000">3.6 Configuration directive reference</A> | ||
| 105 | </UL> | ||
| 106 | <BR> | ||
| 107 | <LI><A NAME="tex2html119" | ||
| 108 | HREF="node5.html">4 FAQ</A> | ||
| 109 | <UL> | ||
| 110 | <LI><A NAME="tex2html120" | ||
| 111 | HREF="node5.html#SECTION00051000000000000000">4.1 General module questions</A> | ||
| 112 | <LI><A NAME="tex2html121" | ||
| 113 | HREF="node5.html#SECTION00052000000000000000">4.2 Problems</A> | ||
| 114 | <LI><A NAME="tex2html122" | ||
| 115 | HREF="node5.html#SECTION00053000000000000000">4.3 Performance and Tuning</A> | ||
| 116 | <LI><A NAME="tex2html123" | ||
| 117 | HREF="node5.html#SECTION00054000000000000000">4.4 ``How do I...?'' - accomplishing certain tasks</A> | ||
| 118 | </UL></UL> | ||
| 119 | <!--End of Table of Contents--> | ||
| 120 | |||
| 121 | <P> | ||
| 122 | <BR><HR> | ||
| 123 | <ADDRESS> | ||
| 124 | Chris Powell | ||
| 125 | 2002-12-18 | ||
| 126 | </ADDRESS> | ||
| 127 | </BODY> | ||
| 128 | </HTML> | ||
diff --git a/docs/node2.html b/docs/node2.html new file mode 100644 index 0000000..33a2849 --- /dev/null +++ b/docs/node2.html | |||
| @@ -0,0 +1,276 @@ | |||
| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | ||
| 2 | |||
| 3 | <!--Converted with LaTeX2HTML 2002-1 (1.68) | ||
| 4 | original version by: Nikos Drakos, CBLU, University of Leeds | ||
| 5 | * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan | ||
| 6 | * with significant contributions from: | ||
| 7 | Jens Lippmann, Marek Rouchal, Martin Wilck and others --> | ||
| 8 | <HTML> | ||
| 9 | <HEAD> | ||
| 10 | <TITLE>1 Introduction</TITLE> | ||
| 11 | <META NAME="description" CONTENT="1 Introduction"> | ||
| 12 | <META NAME="keywords" CONTENT="documentation"> | ||
| 13 | <META NAME="resource-type" CONTENT="document"> | ||
| 14 | <META NAME="distribution" CONTENT="global"> | ||
| 15 | |||
| 16 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> | ||
| 17 | <META NAME="Generator" CONTENT="LaTeX2HTML v2002-1"> | ||
| 18 | <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> | ||
| 19 | |||
| 20 | <LINK REL="STYLESHEET" HREF="documentation.css"> | ||
| 21 | |||
| 22 | <LINK REL="next" HREF="node3.html"> | ||
| 23 | <LINK REL="previous" HREF="node1.html"> | ||
| 24 | <LINK REL="up" HREF="documentation.html"> | ||
| 25 | <LINK REL="next" HREF="node3.html"> | ||
| 26 | </HEAD> | ||
| 27 | |||
| 28 | <BODY > | ||
| 29 | <!--Navigation Panel--> | ||
| 30 | <A NAME="tex2html134" | ||
| 31 | HREF="node3.html"> | ||
| 32 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> | ||
| 33 | <A NAME="tex2html130" | ||
| 34 | HREF="documentation.html"> | ||
| 35 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> | ||
| 36 | <A NAME="tex2html124" | ||
| 37 | HREF="node1.html"> | ||
| 38 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> | ||
| 39 | <A NAME="tex2html132" | ||
| 40 | HREF="node1.html"> | ||
| 41 | <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> | ||
| 42 | <BR> | ||
| 43 | <B> Next:</B> <A NAME="tex2html135" | ||
| 44 | HREF="node3.html">2 Installation</A> | ||
| 45 | <B> Up:</B> <A NAME="tex2html131" | ||
| 46 | HREF="documentation.html">Installing and Running mod_log_sql</A> | ||
| 47 | <B> Previous:</B> <A NAME="tex2html125" | ||
| 48 | HREF="node1.html">Contents</A> | ||
| 49 | <B> <A NAME="tex2html133" | ||
| 50 | HREF="node1.html">Contents</A></B> | ||
| 51 | <BR> | ||
| 52 | <BR> | ||
| 53 | <!--End of Navigation Panel--> | ||
| 54 | <!--Table of Child-Links--> | ||
| 55 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A> | ||
| 56 | |||
| 57 | <UL> | ||
| 58 | <LI><A NAME="tex2html136" | ||
| 59 | HREF="node2.html#SECTION00021000000000000000">1.1 Homepage </A> | ||
| 60 | <LI><A NAME="tex2html137" | ||
| 61 | HREF="node2.html#SECTION00022000000000000000">1.2 Summary</A> | ||
| 62 | <LI><A NAME="tex2html138" | ||
| 63 | HREF="node2.html#SECTION00023000000000000000">1.3 Approach</A> | ||
| 64 | <LI><A NAME="tex2html139" | ||
| 65 | HREF="node2.html#SECTION00024000000000000000">1.4 What gets logged by default? </A> | ||
| 66 | <LI><A NAME="tex2html140" | ||
| 67 | HREF="node2.html#SECTION00025000000000000000">1.5 Miscellaneous Notes</A> | ||
| 68 | <LI><A NAME="tex2html141" | ||
| 69 | HREF="node2.html#SECTION00026000000000000000">1.6 Author / Maintainer</A> | ||
| 70 | </UL> | ||
| 71 | <!--End of Table of Child-Links--> | ||
| 72 | <HR> | ||
| 73 | |||
| 74 | <H1><A NAME="SECTION00020000000000000000"> | ||
| 75 | 1 Introduction</A> | ||
| 76 | </H1> | ||
| 77 | |||
| 78 | <P> | ||
| 79 | |||
| 80 | <H2><A NAME="SECTION00021000000000000000"> | ||
| 81 | 1.1 Homepage </A> | ||
| 82 | </H2> | ||
| 83 | |||
| 84 | <P> | ||
| 85 | |||
| 86 | <DL COMPACT> | ||
| 87 | <DT> | ||
| 88 | <DD>http://www.grubbybaby.com/mod_log_sql/ | ||
| 89 | </DD> | ||
| 90 | </DL> | ||
| 91 | <P> | ||
| 92 | |||
| 93 | <H2><A NAME="SECTION00022000000000000000"> | ||
| 94 | 1.2 Summary</A> | ||
| 95 | </H2> | ||
| 96 | |||
| 97 | <P> | ||
| 98 | This Apache module will permit you to log to a SQL database; it can | ||
| 99 | log each access request as well as data associated with each request: | ||
| 100 | cookies, notes, and inbound/outbound headers. Unlike logging to a | ||
| 101 | flat text file - which is standard in Apache - a SQL-based log exhibits | ||
| 102 | tremendous flexibility and power of data extraction. (See section | ||
| 103 | <A HREF="node5.html#sub:why">4.1.1</A> in the FAQ for further discussion and examples of the | ||
| 104 | advantages to SQL.) | ||
| 105 | |||
| 106 | <P> | ||
| 107 | This module can either replace or happily coexist with mod_log_config, | ||
| 108 | Apache's text file logging facility. In addition to being more configurable | ||
| 109 | than the standard module, mod_log_sql is much more flexible. | ||
| 110 | |||
| 111 | <P> | ||
| 112 | |||
| 113 | <H2><A NAME="SECTION00023000000000000000"> | ||
| 114 | 1.3 Approach</A> | ||
| 115 | </H2> | ||
| 116 | |||
| 117 | <P> | ||
| 118 | This project was formerly known as ``mod_log_mysql.'' It was | ||
| 119 | renamed ``mod_log_sql'' in order to reflect the project goal | ||
| 120 | of database-inspecificity. The module currently supports MySQL, but | ||
| 121 | support for other database backends is underway. | ||
| 122 | |||
| 123 | <P> | ||
| 124 | In order to save speed and overhead, links are kept alive in between | ||
| 125 | queries. This module uses one dedicated SQL link per httpd child, | ||
| 126 | opened by each child process when it is born. Among other things, | ||
| 127 | this means that this module supports logging into only one MySQL server, | ||
| 128 | and for now, also, only one SQL database. But that's a small tradeoff | ||
| 129 | compared to the blinding speed of this module. Error reporting is | ||
| 130 | robust throughout the module and will inform the administrator of | ||
| 131 | database issues in the Apache E<SMALL>RROR</SMALL>L<SMALL>OG</SMALL> for the server/virtual | ||
| 132 | server. | ||
| 133 | |||
| 134 | <P> | ||
| 135 | Virtual hosts are supported in the same manner they are in the regular | ||
| 136 | logging modules. The administrator defines some basic 'global' directives | ||
| 137 | in the main server config, then defines more specific 'local' directives | ||
| 138 | inside each VirtualHost stanza. | ||
| 139 | |||
| 140 | <P> | ||
| 141 | A robust "preserve" capability has now been implemented. | ||
| 142 | This permits the module to preserve any failed INSERT commands to | ||
| 143 | a local file on its machine. In any situation that the database is | ||
| 144 | unavailable - e.g. the network fails or the database host is rebooted | ||
| 145 | - mod_log_sql will note this in the error log and begin appending | ||
| 146 | its log entries to the preserve file (which is created with the user | ||
| 147 | & group ID of the running Apache process, e.g. "nobody/nobody" | ||
| 148 | on many Linux installations). When database availablity returns, mod_log_sql | ||
| 149 | seamlessly resumes logging to it. When convenient for the sysadmin, | ||
| 150 | he/she can easily import the preserve file into the database because | ||
| 151 | it is simply a series of SQL insert statements. | ||
| 152 | |||
| 153 | <P> | ||
| 154 | |||
| 155 | <H2><A NAME="SECTION00024000000000000000"> | ||
| 156 | 1.4 What gets logged by default? </A> | ||
| 157 | </H2> | ||
| 158 | |||
| 159 | <P> | ||
| 160 | All the data that would be contained in the "Combined Log | ||
| 161 | Format" is logged by default, plus a little extra. Your best | ||
| 162 | bet is to begin by accepting this default, then later customize the | ||
| 163 | log configuration based on your needs. | ||
| 164 | |||
| 165 | <P> | ||
| 166 | The documentation of the run-time directives includes a full explanation | ||
| 167 | of what you can log, including examples - see section <A HREF="node4.html#sec:ConfRef">3.6</A>. | ||
| 168 | |||
| 169 | <P> | ||
| 170 | |||
| 171 | <H2><A NAME="SECTION00025000000000000000"> | ||
| 172 | 1.5 Miscellaneous Notes</A> | ||
| 173 | </H2> | ||
| 174 | |||
| 175 | <P> | ||
| 176 | |||
| 177 | <UL> | ||
| 178 | <LI>Note which directives go in the 'main server config' and which directives | ||
| 179 | apply to the 'virtual host config'. This is made clear in the directive | ||
| 180 | documentation. | ||
| 181 | </LI> | ||
| 182 | <LI>The 'time_stamp' field is stored in an UNSIGNED INTEGER column, in | ||
| 183 | the standard unix ``seconds since the epoch'' format. This is | ||
| 184 | superior to storing the access time as a string due to size requirements: | ||
| 185 | an UNSIGNED INT requires 4 bytes, whereas an Apache date string - | ||
| 186 | e.g. "18/Nov/2001:13:59:52 -0800" - requires 26 | ||
| 187 | bytes: those extra 22 bytes become significant when multiplied by | ||
| 188 | thousands of accesses on a busy server. Besides, an INT type is far | ||
| 189 | more flexible for comparisons, etc. | ||
| 190 | |||
| 191 | <P> | ||
| 192 | In MySQL 3.21 and above you can easily convert this to a human readable | ||
| 193 | format using from_unixtime(), e.g.: | ||
| 194 | |||
| 195 | <P> | ||
| 196 | |||
| 197 | <DL COMPACT> | ||
| 198 | <DT> | ||
| 199 | <DD>select remote_host,request_uri,from_unixtime(time_stamp) from access_log; | ||
| 200 | </DD> | ||
| 201 | </DL>The enclosed perl program ``make_combined_log.pl'' extracts | ||
| 202 | your access log in a format that is completely compatible with the | ||
| 203 | Combined Log Format. You can then feed this to your favorite web log | ||
| 204 | analysis tool. | ||
| 205 | |||
| 206 | <P> | ||
| 207 | </LI> | ||
| 208 | <LI>The table's string values can be CHAR or VARCHAR, at a length of your | ||
| 209 | choice. VARCHAR is superior because it truncates long strings; CHAR | ||
| 210 | types are fixed-length and will be padded with spaces, resulting in | ||
| 211 | waste. Just like the time_stamp issue described above, that kind | ||
| 212 | of space waste multiplies over thousands of records. | ||
| 213 | </LI> | ||
| 214 | <LI>Be careful not to go overboard setting fields to NOT NULL. If a field | ||
| 215 | is marked NOT NULL then it must contain data in the INSERT statement, | ||
| 216 | or the INSERT will fail. These mysterious failures can be quite frustrating | ||
| 217 | and difficult to debug. | ||
| 218 | </LI> | ||
| 219 | <LI>When Apache logs a numeric field, it uses a '-' character to mean | ||
| 220 | ``not applicable,'' e.g. the number of bytes returned on a 304 | ||
| 221 | (unchanged) request. Since '-' is an illegal character in an SQL numeric | ||
| 222 | field, such fields are assigned the value 0 instead of '-' which, | ||
| 223 | of course, makes perfect sense anyway. | ||
| 224 | </LI> | ||
| 225 | </UL> | ||
| 226 | |||
| 227 | <P> | ||
| 228 | |||
| 229 | <H2><A NAME="SECTION00026000000000000000"> | ||
| 230 | 1.6 Author / Maintainer</A> | ||
| 231 | </H2> | ||
| 232 | |||
| 233 | <P> | ||
| 234 | The actual logging code was taken from the already existing flat file | ||
| 235 | text modules, so all that credit goes to the Apache Server group. | ||
| 236 | |||
| 237 | <P> | ||
| 238 | The MySQL routines and directives were added by Zeev Suraski <bourbon@netvision.net.il>. | ||
| 239 | |||
| 240 | <P> | ||
| 241 | All changes from 1.06+ and the new documentation were added by Chris | ||
| 242 | Powell <chris@grubbybaby.com>. It seems that the module had fallen | ||
| 243 | into the "unmaintained" category - it hadn't been | ||
| 244 | updated since 1998 - so Chris adopted it as the new maintainer. | ||
| 245 | |||
| 246 | <P> | ||
| 247 | <HR> | ||
| 248 | <!--Navigation Panel--> | ||
| 249 | <A NAME="tex2html134" | ||
| 250 | HREF="node3.html"> | ||
| 251 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> | ||
| 252 | <A NAME="tex2html130" | ||
| 253 | HREF="documentation.html"> | ||
| 254 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> | ||
| 255 | <A NAME="tex2html124" | ||
| 256 | HREF="node1.html"> | ||
| 257 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> | ||
| 258 | <A NAME="tex2html132" | ||
| 259 | HREF="node1.html"> | ||
| 260 | <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> | ||
| 261 | <BR> | ||
| 262 | <B> Next:</B> <A NAME="tex2html135" | ||
| 263 | HREF="node3.html">2 Installation</A> | ||
| 264 | <B> Up:</B> <A NAME="tex2html131" | ||
| 265 | HREF="documentation.html">Installing and Running mod_log_sql</A> | ||
| 266 | <B> Previous:</B> <A NAME="tex2html125" | ||
| 267 | HREF="node1.html">Contents</A> | ||
| 268 | <B> <A NAME="tex2html133" | ||
| 269 | HREF="node1.html">Contents</A></B> | ||
| 270 | <!--End of Navigation Panel--> | ||
| 271 | <ADDRESS> | ||
| 272 | Chris Powell | ||
| 273 | 2002-12-18 | ||
| 274 | </ADDRESS> | ||
| 275 | </BODY> | ||
| 276 | </HTML> | ||
diff --git a/docs/node3.html b/docs/node3.html new file mode 100644 index 0000000..e832759 --- /dev/null +++ b/docs/node3.html | |||
| @@ -0,0 +1,664 @@ | |||
| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | ||
| 2 | |||
| 3 | <!--Converted with LaTeX2HTML 2002-1 (1.68) | ||
| 4 | original version by: Nikos Drakos, CBLU, University of Leeds | ||
| 5 | * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan | ||
| 6 | * with significant contributions from: | ||
| 7 | Jens Lippmann, Marek Rouchal, Martin Wilck and others --> | ||
| 8 | <HTML> | ||
| 9 | <HEAD> | ||
| 10 | <TITLE>2 Installation</TITLE> | ||
| 11 | <META NAME="description" CONTENT="2 Installation"> | ||
| 12 | <META NAME="keywords" CONTENT="documentation"> | ||
| 13 | <META NAME="resource-type" CONTENT="document"> | ||
| 14 | <META NAME="distribution" CONTENT="global"> | ||
| 15 | |||
| 16 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> | ||
| 17 | <META NAME="Generator" CONTENT="LaTeX2HTML v2002-1"> | ||
| 18 | <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> | ||
| 19 | |||
| 20 | <LINK REL="STYLESHEET" HREF="documentation.css"> | ||
| 21 | |||
| 22 | <LINK REL="next" HREF="node4.html"> | ||
| 23 | <LINK REL="previous" HREF="node2.html"> | ||
| 24 | <LINK REL="up" HREF="documentation.html"> | ||
| 25 | <LINK REL="next" HREF="node4.html"> | ||
| 26 | </HEAD> | ||
| 27 | |||
| 28 | <BODY > | ||
| 29 | <!--Navigation Panel--> | ||
| 30 | <A NAME="tex2html152" | ||
| 31 | HREF="node4.html"> | ||
| 32 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> | ||
| 33 | <A NAME="tex2html148" | ||
| 34 | HREF="documentation.html"> | ||
| 35 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> | ||
| 36 | <A NAME="tex2html142" | ||
| 37 | HREF="node2.html"> | ||
| 38 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> | ||
| 39 | <A NAME="tex2html150" | ||
| 40 | HREF="node1.html"> | ||
| 41 | <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> | ||
| 42 | <BR> | ||
| 43 | <B> Next:</B> <A NAME="tex2html153" | ||
| 44 | HREF="node4.html">3 Configuration</A> | ||
| 45 | <B> Up:</B> <A NAME="tex2html149" | ||
| 46 | HREF="documentation.html">Installing and Running mod_log_sql</A> | ||
| 47 | <B> Previous:</B> <A NAME="tex2html143" | ||
| 48 | HREF="node2.html">1 Introduction</A> | ||
| 49 | <B> <A NAME="tex2html151" | ||
| 50 | HREF="node1.html">Contents</A></B> | ||
| 51 | <BR> | ||
| 52 | <BR> | ||
| 53 | <!--End of Navigation Panel--> | ||
| 54 | <!--Table of Child-Links--> | ||
| 55 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A> | ||
| 56 | |||
| 57 | <UL> | ||
| 58 | <LI><A NAME="tex2html154" | ||
| 59 | HREF="node3.html#SECTION00031000000000000000">2.1 Requirements</A> | ||
| 60 | <LI><A NAME="tex2html155" | ||
| 61 | HREF="node3.html#SECTION00032000000000000000">2.2 Platform-specific notes</A> | ||
| 62 | <UL> | ||
| 63 | <LI><A NAME="tex2html156" | ||
| 64 | HREF="node3.html#SECTION00032100000000000000">2.2.1 Solaris</A> | ||
| 65 | <LI><A NAME="tex2html157" | ||
| 66 | HREF="node3.html#SECTION00032200000000000000">2.2.2 BSD</A> | ||
| 67 | <LI><A NAME="tex2html158" | ||
| 68 | HREF="node3.html#SECTION00032300000000000000">2.2.3 Win32</A> | ||
| 69 | </UL> | ||
| 70 | <BR> | ||
| 71 | <LI><A NAME="tex2html159" | ||
| 72 | HREF="node3.html#SECTION00033000000000000000">2.3 Do I want a DSO or a static module?</A> | ||
| 73 | <LI><A NAME="tex2html160" | ||
| 74 | HREF="node3.html#SECTION00034000000000000000">2.4 Installation as an Apache DSO (Preferred) </A> | ||
| 75 | <LI><A NAME="tex2html161" | ||
| 76 | HREF="node3.html#SECTION00035000000000000000">2.5 Installation as a static module compiled into | ||
| 77 | httpd</A> | ||
| 78 | </UL> | ||
| 79 | <!--End of Table of Child-Links--> | ||
| 80 | <HR> | ||
| 81 | |||
| 82 | <H1><A NAME="SECTION00030000000000000000"> | ||
| 83 | 2 Installation</A> | ||
| 84 | </H1> | ||
| 85 | |||
| 86 | <P> | ||
| 87 | |||
| 88 | <H2><A NAME="SECTION00031000000000000000"> | ||
| 89 | 2.1 Requirements</A> | ||
| 90 | </H2> | ||
| 91 | |||
| 92 | <P> | ||
| 93 | |||
| 94 | <UL> | ||
| 95 | <LI>A compatible system. mod_log_sql was authored and tested on systems | ||
| 96 | based on Red Hat Linux (Red Hat, Mandrake), but the module should | ||
| 97 | easily adapt to any modern distribution. mod_log_sql has also been | ||
| 98 | ported successfully to Solaris and FreeBSD. | ||
| 99 | </LI> | ||
| 100 | <LI>Apache 1.2 or 1.3. Ideally you should already have successfully compiled | ||
| 101 | Apache and understand the process, but this document tries to make | ||
| 102 | it simple for beginners. | ||
| 103 | </LI> | ||
| 104 | <LI>The MySQL development headers. This package is called different things | ||
| 105 | on different distros. For example, Red Hat 6.x calls this RPM ``MySQL-devel'' | ||
| 106 | whereas Mandrake calls it ``libmysql10-devel.'' | ||
| 107 | </LI> | ||
| 108 | <LI>MySQL >= 3.23.15 configured, installed and running on either localhost | ||
| 109 | or an accessible networked machine. You should already have a basic | ||
| 110 | understanding of MySQL and how it functions. | ||
| 111 | </LI> | ||
| 112 | <LI>Optionally, if you want to be able to log SSL information such as | ||
| 113 | keysize or cipher, you need OpenSSL and mod_ssl installed. | ||
| 114 | </LI> | ||
| 115 | </UL> | ||
| 116 | |||
| 117 | <P> | ||
| 118 | |||
| 119 | <H2><A NAME="SECTION00032000000000000000"> | ||
| 120 | 2.2 Platform-specific notes</A> | ||
| 121 | </H2> | ||
| 122 | |||
| 123 | <P> | ||
| 124 | These installation documents assume a relatively modern GNU/Linux | ||
| 125 | scenario. mod_log_sql has been ported to other platforms; following | ||
| 126 | are notes on compiling the module for those platforms. | ||
| 127 | |||
| 128 | <P> | ||
| 129 | |||
| 130 | <H3><A NAME="SECTION00032100000000000000"> | ||
| 131 | 2.2.1 Solaris</A> | ||
| 132 | </H3> | ||
| 133 | |||
| 134 | <P> | ||
| 135 | The nanosleep() function used in mod_log_sql relies on linking aginst | ||
| 136 | the librt library. Make the following alterations before proceeding: | ||
| 137 | |||
| 138 | <P> | ||
| 139 | |||
| 140 | <OL> | ||
| 141 | <LI>In Makefile, search for the string ``-lmysqlclient -lz'' and change | ||
| 142 | it to read ``-lmysqlclient -lz -lrt'' | ||
| 143 | </LI> | ||
| 144 | <LI>In part <A HREF="node3.html#step:Linking">8a</A> of section <A HREF="node3.html#sec:Static">2.5</A> below, change | ||
| 145 | ``-lmysqlclient -lm -lz'' to read ``-lmysqlclient -lm -lz -lrt'' | ||
| 146 | </LI> | ||
| 147 | </OL> | ||
| 148 | |||
| 149 | <P> | ||
| 150 | |||
| 151 | <H3><A NAME="SECTION00032200000000000000"> | ||
| 152 | 2.2.2 BSD</A> | ||
| 153 | </H3> | ||
| 154 | |||
| 155 | <P> | ||
| 156 | No notes are available at present, but they are desired. If you have | ||
| 157 | successfully ported mod_log_sql to BSD, <I>please</I> contact the maintaniner, Chris Powell (chris@grubbybaby.com) | ||
| 158 | and help fill in this section. | ||
| 159 | |||
| 160 | <P> | ||
| 161 | |||
| 162 | <H3><A NAME="SECTION00032300000000000000"> | ||
| 163 | 2.2.3 Win32</A> | ||
| 164 | </H3> | ||
| 165 | |||
| 166 | <P> | ||
| 167 | No notes are available at present, but they are desired. If you have | ||
| 168 | successfully ported mod_log_sql to Win32, <I>please</I> contact | ||
| 169 | the maintaniner, Chris Powell (chris@grubbybaby.com) and help | ||
| 170 | fill in this section. | ||
| 171 | |||
| 172 | <P> | ||
| 173 | |||
| 174 | <H2><A NAME="SECTION00033000000000000000"> | ||
| 175 | 2.3 Do I want a DSO or a static module?</A> | ||
| 176 | </H2> | ||
| 177 | |||
| 178 | <P> | ||
| 179 | You need to know the answer to this question before you proceed. The | ||
| 180 | answer is pretty straightforward: what have you done in the past? | ||
| 181 | If you like all your Apache modules to be dynamic, then you should | ||
| 182 | keep doing that. If you're more of an old-school type and prefer to | ||
| 183 | compile the modules right into apache, do that. Both methods work | ||
| 184 | equally well. | ||
| 185 | |||
| 186 | <P> | ||
| 187 | FWIW, the DSO method is more modern and increasing in popularity because | ||
| 188 | apxs takes care of a lot of dirty little details for you. As you'll | ||
| 189 | see below, the static-module method is a little more complex. | ||
| 190 | |||
| 191 | <P> | ||
| 192 | |||
| 193 | <H2><A NAME="SECTION00034000000000000000"> | ||
| 194 | 2.4 Installation as an Apache DSO (Preferred) </A> | ||
| 195 | </H2> | ||
| 196 | |||
| 197 | <P> | ||
| 198 | |||
| 199 | <OL> | ||
| 200 | <LI>Perform all the following steps as root so that you have install privs, | ||
| 201 | etc. Unpack the archive into a working directory. | ||
| 202 | |||
| 203 | <P> | ||
| 204 | |||
| 205 | <DL COMPACT> | ||
| 206 | <DT> | ||
| 207 | <DD># tar zxf mod_log_sql.tar.gz -C /usr/local/src | ||
| 208 | |||
| 209 | <P> | ||
| 210 | # cd /usr/local/src/mod_log_sql | ||
| 211 | </DD> | ||
| 212 | </DL> | ||
| 213 | </LI> | ||
| 214 | <LI>Edit Makefile and change the values of the variables in the first | ||
| 215 | section. | ||
| 216 | |||
| 217 | <P> | ||
| 218 | |||
| 219 | <OL> | ||
| 220 | <LI>These paths are <B>necessary:</B> | ||
| 221 | |||
| 222 | <P> | ||
| 223 | <DL> | ||
| 224 | <DT><STRONG>APACHEINSTALLED:</STRONG></DT> | ||
| 225 | <DD>the location where you installed Apache - usually | ||
| 226 | /usr/local/apache, 'locate apxs' can help you find it. | ||
| 227 | </DD> | ||
| 228 | <DT><STRONG>APACHEHEADERS:</STRONG></DT> | ||
| 229 | <DD>The location of your Apache header files, find using | ||
| 230 | 'locate httpd.h' | ||
| 231 | </DD> | ||
| 232 | <DT><STRONG>MYSQLLIBRARIES:</STRONG></DT> | ||
| 233 | <DD>The location of your MySQL libraries, find using | ||
| 234 | 'locate libmysqlclient.so' | ||
| 235 | </DD> | ||
| 236 | <DT><STRONG>MYSQLHEADERS:</STRONG></DT> | ||
| 237 | <DD>The location of your MySQL header files, find using | ||
| 238 | 'locate mysql.h' | ||
| 239 | </DD> | ||
| 240 | </DL> | ||
| 241 | </LI> | ||
| 242 | <LI><B>Optional</B>: if you compiled mod_ssl for Apache and want to | ||
| 243 | log SSL data such as 'keysize' and 'cipher type': | ||
| 244 | |||
| 245 | <P> | ||
| 246 | <DL> | ||
| 247 | <DT><STRONG>MODSSLHEADERS:</STRONG></DT> | ||
| 248 | <DD>the location of your mod_ssl header files, find | ||
| 249 | using 'locate mod_ssl.h' | ||
| 250 | </DD> | ||
| 251 | <DT><STRONG>DB1HEADERS:</STRONG></DT> | ||
| 252 | <DD>the location of your db1 header files, find using 'locate | ||
| 253 | ndbm.h' | ||
| 254 | </DD> | ||
| 255 | </DL> | ||
| 256 | </LI> | ||
| 257 | </OL> | ||
| 258 | You do <B>not</B> need to compile SSL support into mod_log_sql | ||
| 259 | in order to simply use it with a secure site. You only need to compile | ||
| 260 | SSL support into mod_log_sql <B>if you want to log SSL-specific | ||
| 261 | data</B> such as the cipher type. | ||
| 262 | |||
| 263 | <P> | ||
| 264 | </LI> | ||
| 265 | <LI>IMPORTANT: If you are not logging SSL info, comment out MODSSLHDRS | ||
| 266 | by putting a # character in front of it: | ||
| 267 | |||
| 268 | <P> | ||
| 269 | |||
| 270 | <DL COMPACT> | ||
| 271 | <DT> | ||
| 272 | <DD>#MODSSLHDRS=/usr/include/... | ||
| 273 | </DD> | ||
| 274 | </DL> | ||
| 275 | </LI> | ||
| 276 | <LI>Instruct apxs to compile the module as a DSO. | ||
| 277 | |||
| 278 | <P> | ||
| 279 | |||
| 280 | <DL COMPACT> | ||
| 281 | <DT> | ||
| 282 | <DD># make dso | ||
| 283 | </DD> | ||
| 284 | </DL>You should see output similar to the following: | ||
| 285 | |||
| 286 | <P> | ||
| 287 | |||
| 288 | <DL COMPACT> | ||
| 289 | <DT> | ||
| 290 | <DD>/usr/local/Apache/bin/apxs -Wc,-O2 -Wc,-Wall -Wc,-DEAPI -c -I/usr/... | ||
| 291 | |||
| 292 | <P> | ||
| 293 | gcc -DLINUX=22 -DNO_DBM_REWRITEMAP -DMOD_SSL=208111 -DUSE_HS... | ||
| 294 | |||
| 295 | <P> | ||
| 296 | gcc -shared -o mod_log_sql.so mod_log_sql.o -Wc,-O2 -Wc,-Wall -Wc... | ||
| 297 | </DD> | ||
| 298 | </DL>You should see no errors and have a new file called "mod_log_sql.so" | ||
| 299 | in your directory. | ||
| 300 | |||
| 301 | <P> | ||
| 302 | </LI> | ||
| 303 | <LI>Instruct apxs to install the DSO. | ||
| 304 | |||
| 305 | <P> | ||
| 306 | |||
| 307 | <DL COMPACT> | ||
| 308 | <DT> | ||
| 309 | <DD># make dsoinstall | ||
| 310 | </DD> | ||
| 311 | </DL>You should see output similar to the following: | ||
| 312 | |||
| 313 | <P> | ||
| 314 | |||
| 315 | <DL COMPACT> | ||
| 316 | <DT> | ||
| 317 | <DD>/usr/local/Apache/bin/apxs -i mod_log_sql.so | ||
| 318 | |||
| 319 | <P> | ||
| 320 | cp mod_log_sql.so /usr/local/Apache/libexec/mod_log_sql.so | ||
| 321 | |||
| 322 | <P> | ||
| 323 | chmod 755 /usr/local/Apache/libexec/mod_log_sql.so | ||
| 324 | </DD> | ||
| 325 | </DL> | ||
| 326 | </LI> | ||
| 327 | <LI>Load and activate the module in httpd.conf: | ||
| 328 | |||
| 329 | <P> | ||
| 330 | |||
| 331 | <OL> | ||
| 332 | <LI>Insert this line in the same area as other logging modules, e.g. near | ||
| 333 | ``LoadModule config_log_module'': | ||
| 334 | |||
| 335 | <P> | ||
| 336 | |||
| 337 | <DL COMPACT> | ||
| 338 | <DT> | ||
| 339 | <DD>LoadModule sql_log_module libexec/mod_log_sql.so | ||
| 340 | </DD> | ||
| 341 | </DL> | ||
| 342 | </LI> | ||
| 343 | <LI>Insert this line in the same area as other logging modules, e.g. near | ||
| 344 | ``AddModule mod_log_config.c'': | ||
| 345 | |||
| 346 | <P> | ||
| 347 | |||
| 348 | <DL COMPACT> | ||
| 349 | <DT> | ||
| 350 | <DD>AddModule mod_log_sql.c | ||
| 351 | </DD> | ||
| 352 | </DL> | ||
| 353 | </LI> | ||
| 354 | </OL> | ||
| 355 | </LI> | ||
| 356 | <LI>Module ordering within httpd.conf is important if you are logging | ||
| 357 | SSL information. Please ensure that | ||
| 358 | |||
| 359 | <P> | ||
| 360 | |||
| 361 | <DL COMPACT> | ||
| 362 | <DT> | ||
| 363 | <DD>LoadModule ssl_module libexec/libssl.so | ||
| 364 | </DD> | ||
| 365 | </DL>comes before | ||
| 366 | |||
| 367 | <P> | ||
| 368 | |||
| 369 | <DL COMPACT> | ||
| 370 | <DT> | ||
| 371 | <DD>LoadModule sql_log_module libexec/mod_log_sql.so | ||
| 372 | </DD> | ||
| 373 | </DL>in your httpd.conf file. If they are out of order, simply cut-and-paste | ||
| 374 | the ``ssl_module'' section so that it is at the top. If you do | ||
| 375 | not, you will get this error when you start Apache: | ||
| 376 | |||
| 377 | <P> | ||
| 378 | |||
| 379 | <DL COMPACT> | ||
| 380 | <DT> | ||
| 381 | <DD>/usr/local/apache/libexec/mod_log_mysql.so: undefined symbol: ssl_var_lookup | ||
| 382 | |||
| 383 | <P> | ||
| 384 | /usr/local/apache/bin/apachectl startssl: httpd could not be started | ||
| 385 | </DD> | ||
| 386 | </DL>(mod_log_sql has a dependency on mod_ssl for SSL symbols. If the | ||
| 387 | statements are out of order, mod_log_sql cannot recognize those | ||
| 388 | symbols.) | ||
| 389 | |||
| 390 | <P> | ||
| 391 | Now skip below to section <A HREF="node4.html#sec:Configuration">3</A>, <B>Configuration</B>. | ||
| 392 | |||
| 393 | <P> | ||
| 394 | </LI> | ||
| 395 | </OL> | ||
| 396 | |||
| 397 | <P> | ||
| 398 | |||
| 399 | <H2><A NAME="SECTION00035000000000000000"></A><A NAME="sec:Static"></A> | ||
| 400 | <BR> | ||
| 401 | 2.5 Installation as a static module compiled into | ||
| 402 | httpd | ||
| 403 | </H2> | ||
| 404 | |||
| 405 | <P> | ||
| 406 | |||
| 407 | <OL> | ||
| 408 | <LI>Perform all the following steps as root so that you have install privs, | ||
| 409 | etc. | ||
| 410 | </LI> | ||
| 411 | <LI>Unpack the archive into a working directory. | ||
| 412 | |||
| 413 | <P> | ||
| 414 | |||
| 415 | <DL COMPACT> | ||
| 416 | <DT> | ||
| 417 | <DD># tar zxf mod_log_sql.tar.gz -C /usr/local/src | ||
| 418 | |||
| 419 | <P> | ||
| 420 | # cd /usr/local/src/mod_log_sql | ||
| 421 | </DD> | ||
| 422 | </DL> | ||
| 423 | </LI> | ||
| 424 | <LI><A NAME="step:editMF"></A>Edit Makefile and change the values of the variables | ||
| 425 | in the first section. | ||
| 426 | |||
| 427 | <P> | ||
| 428 | |||
| 429 | <OL> | ||
| 430 | <LI>These are <B>necessary:</B> | ||
| 431 | |||
| 432 | <P> | ||
| 433 | <DL> | ||
| 434 | <DT><STRONG>APACHEINSTALLED:</STRONG></DT> | ||
| 435 | <DD>the location where you installed Apache - usually | ||
| 436 | /usr/local/apache, 'locate apxs' can help you find it. | ||
| 437 | </DD> | ||
| 438 | <DT><STRONG>APACHESOURCE:</STRONG></DT> | ||
| 439 | <DD>the location of your Apache <B>sources</B>, find | ||
| 440 | using 'locate ABOUT_APACHE' | ||
| 441 | </DD> | ||
| 442 | <DT><STRONG>APACHEHEADERS:</STRONG></DT> | ||
| 443 | <DD>the location of your Apache header files, find using | ||
| 444 | 'locate httpd.h' | ||
| 445 | </DD> | ||
| 446 | <DT><STRONG>MYSQLLIBRARIES:</STRONG></DT> | ||
| 447 | <DD>the location of your MySQL libraries, find using | ||
| 448 | 'locate libmysqlclient.so' | ||
| 449 | </DD> | ||
| 450 | <DT><STRONG>MYSQLHEADERS:</STRONG></DT> | ||
| 451 | <DD>the location of your MySQL header files, find using | ||
| 452 | 'locate mysql.h' | ||
| 453 | </DD> | ||
| 454 | </DL> | ||
| 455 | </LI> | ||
| 456 | <LI><B>Optional</B>: if you compiled mod_ssl for Apache and want to | ||
| 457 | log SSL data such as 'keysize' and 'cipher type': | ||
| 458 | |||
| 459 | <P> | ||
| 460 | <DL> | ||
| 461 | <DT><STRONG>MODSSLHEADERS:</STRONG></DT> | ||
| 462 | <DD>the location of your mod_ssl header files, find | ||
| 463 | using 'locate mod_ssl.h' | ||
| 464 | </DD> | ||
| 465 | <DT><STRONG>DB1HEADERS:</STRONG></DT> | ||
| 466 | <DD>the location of your db1 header files, find using 'locate | ||
| 467 | ndbm.h' | ||
| 468 | </DD> | ||
| 469 | </DL> | ||
| 470 | </LI> | ||
| 471 | </OL> | ||
| 472 | You do <B>not</B> need to compile SSL support into mod_log_sql | ||
| 473 | in order to simply use it with a secure site. You only need to compile | ||
| 474 | SSL support into mod_log_sql <B>if you want to log SSL-specific | ||
| 475 | data</B> such as the cipher type. | ||
| 476 | |||
| 477 | <P> | ||
| 478 | </LI> | ||
| 479 | <LI>IMPORTANT: If you are not logging SSL info, comment out MODSSLHDRS | ||
| 480 | by putting a # character in front of it: | ||
| 481 | |||
| 482 | <P> | ||
| 483 | |||
| 484 | <DL COMPACT> | ||
| 485 | <DT> | ||
| 486 | <DD>#MODSSLHDRS=/usr/include/... | ||
| 487 | </DD> | ||
| 488 | </DL> | ||
| 489 | </LI> | ||
| 490 | <LI>Compile the module. | ||
| 491 | |||
| 492 | <P> | ||
| 493 | |||
| 494 | <DL COMPACT> | ||
| 495 | <DT> | ||
| 496 | <DD># make static | ||
| 497 | </DD> | ||
| 498 | </DL>You should see output similar to the following: | ||
| 499 | |||
| 500 | <P> | ||
| 501 | |||
| 502 | <DL COMPACT> | ||
| 503 | <DT> | ||
| 504 | <DD>gcc -fpic -O2 -Wall -I/usr/local/Apache/include -I/usr/include/mysql -I/usr/lo... | ||
| 505 | </DD> | ||
| 506 | </DL>You should see no errors and have a new file called "mod_log_sql.o" | ||
| 507 | in your directory. | ||
| 508 | |||
| 509 | <P> | ||
| 510 | </LI> | ||
| 511 | <LI>Install the module. | ||
| 512 | |||
| 513 | <P> | ||
| 514 | |||
| 515 | <DL COMPACT> | ||
| 516 | <DT> | ||
| 517 | <DD># make statinstall | ||
| 518 | </DD> | ||
| 519 | </DL> | ||
| 520 | </LI> | ||
| 521 | <LI>Change to your Apache source directory. | ||
| 522 | |||
| 523 | <P> | ||
| 524 | |||
| 525 | <DL COMPACT> | ||
| 526 | <DT> | ||
| 527 | <DD># cd /usr/local/src/apache-1.3.22/src | ||
| 528 | </DD> | ||
| 529 | </DL> | ||
| 530 | </LI> | ||
| 531 | <LI>Re-compile your httpd binary as follows. | ||
| 532 | |||
| 533 | <P> | ||
| 534 | |||
| 535 | <OL> | ||
| 536 | <LI><A NAME="step:Linking"></A>Make these changes to Configuration.apaci: | ||
| 537 | |||
| 538 | <P> | ||
| 539 | |||
| 540 | <UL> | ||
| 541 | <LI>Append the following string to the EXTRA_LIBS= line. ("/usr/lib/mysql" | ||
| 542 | is from step <A HREF="node3.html#step:editMF">3</A>, and is where your MySQL libraries | ||
| 543 | live): | ||
| 544 | </LI> | ||
| 545 | </UL> | ||
| 546 | |||
| 547 | <DL COMPACT> | ||
| 548 | <DT> | ||
| 549 | <DD>-L/usr/lib/mysql -lmysqlclient -lm -lz | ||
| 550 | </DD> | ||
| 551 | </DL> | ||
| 552 | <UL> | ||
| 553 | <LI>Find the mod_log_config.o line, and insert this line immediately | ||
| 554 | after it: | ||
| 555 | </LI> | ||
| 556 | </UL> | ||
| 557 | |||
| 558 | <DL COMPACT> | ||
| 559 | <DT> | ||
| 560 | <DD>AddModule modules/sql/mod_log_sql.o | ||
| 561 | </DD> | ||
| 562 | </DL> | ||
| 563 | </LI> | ||
| 564 | <LI># cp Configuration.apaci Configuration | ||
| 565 | </LI> | ||
| 566 | <LI># ./Configure | ||
| 567 | </LI> | ||
| 568 | <LI># make | ||
| 569 | </LI> | ||
| 570 | <LI># strip httpd | ||
| 571 | </LI> | ||
| 572 | </OL> | ||
| 573 | </LI> | ||
| 574 | <LI>Test your new apache binary: | ||
| 575 | |||
| 576 | <P> | ||
| 577 | |||
| 578 | <DL COMPACT> | ||
| 579 | <DT> | ||
| 580 | <DD># ./httpd -l | ||
| 581 | </DD> | ||
| 582 | </DL>You should see something like: | ||
| 583 | |||
| 584 | <P> | ||
| 585 | |||
| 586 | <DL COMPACT> | ||
| 587 | <DT> | ||
| 588 | <DD>Compiled-in modules: | ||
| 589 | |||
| 590 | <P> | ||
| 591 | http_core.c | ||
| 592 | |||
| 593 | <P> | ||
| 594 | mod_log_sql.c <- That's the line you're looking for. | ||
| 595 | |||
| 596 | <P> | ||
| 597 | mod_env.c | ||
| 598 | |||
| 599 | <P> | ||
| 600 | mod_log_config.c | ||
| 601 | |||
| 602 | <P> | ||
| 603 | mod_mime.c | ||
| 604 | |||
| 605 | <P> | ||
| 606 | mod_negotiation.c | ||
| 607 | |||
| 608 | <P> | ||
| 609 | etc... | ||
| 610 | </DD> | ||
| 611 | </DL> | ||
| 612 | </LI> | ||
| 613 | <LI>Install your httpd binary. Copy it over your old httpd binary, wherever | ||
| 614 | it lives. You can and should rename your old httpd first so that you | ||
| 615 | can easily revert to that working version in case of bugs with the | ||
| 616 | new version. | ||
| 617 | |||
| 618 | <P> | ||
| 619 | |||
| 620 | <DL COMPACT> | ||
| 621 | <DT> | ||
| 622 | <DD># /etc/rc.d/init.d/httpd stop | ||
| 623 | |||
| 624 | <P> | ||
| 625 | # mv /usr/local/Apache/bin/httpd ~/httpd-save | ||
| 626 | |||
| 627 | <P> | ||
| 628 | # cp -f ./httpd /usr/local/Apache/bin/ | ||
| 629 | </DD> | ||
| 630 | </DL> | ||
| 631 | </LI> | ||
| 632 | </OL> | ||
| 633 | |||
| 634 | <P> | ||
| 635 | <HR> | ||
| 636 | <!--Navigation Panel--> | ||
| 637 | <A NAME="tex2html152" | ||
| 638 | HREF="node4.html"> | ||
| 639 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> | ||
| 640 | <A NAME="tex2html148" | ||
| 641 | HREF="documentation.html"> | ||
| 642 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> | ||
| 643 | <A NAME="tex2html142" | ||
| 644 | HREF="node2.html"> | ||
| 645 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> | ||
| 646 | <A NAME="tex2html150" | ||
| 647 | HREF="node1.html"> | ||
| 648 | <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> | ||
| 649 | <BR> | ||
| 650 | <B> Next:</B> <A NAME="tex2html153" | ||
| 651 | HREF="node4.html">3 Configuration</A> | ||
| 652 | <B> Up:</B> <A NAME="tex2html149" | ||
| 653 | HREF="documentation.html">Installing and Running mod_log_sql</A> | ||
| 654 | <B> Previous:</B> <A NAME="tex2html143" | ||
| 655 | HREF="node2.html">1 Introduction</A> | ||
| 656 | <B> <A NAME="tex2html151" | ||
| 657 | HREF="node1.html">Contents</A></B> | ||
| 658 | <!--End of Navigation Panel--> | ||
| 659 | <ADDRESS> | ||
| 660 | Chris Powell | ||
| 661 | 2002-12-18 | ||
| 662 | </ADDRESS> | ||
| 663 | </BODY> | ||
| 664 | </HTML> | ||
diff --git a/docs/node4.html b/docs/node4.html new file mode 100644 index 0000000..287333c --- /dev/null +++ b/docs/node4.html | |||
| @@ -0,0 +1,2014 @@ | |||
| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | ||
| 2 | |||
| 3 | <!--Converted with LaTeX2HTML 2002-1 (1.68) | ||
| 4 | original version by: Nikos Drakos, CBLU, University of Leeds | ||
| 5 | * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan | ||
| 6 | * with significant contributions from: | ||
| 7 | Jens Lippmann, Marek Rouchal, Martin Wilck and others --> | ||
| 8 | <HTML> | ||
| 9 | <HEAD> | ||
| 10 | <TITLE>3 Configuration</TITLE> | ||
| 11 | <META NAME="description" CONTENT="3 Configuration"> | ||
| 12 | <META NAME="keywords" CONTENT="documentation"> | ||
| 13 | <META NAME="resource-type" CONTENT="document"> | ||
| 14 | <META NAME="distribution" CONTENT="global"> | ||
| 15 | |||
| 16 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> | ||
| 17 | <META NAME="Generator" CONTENT="LaTeX2HTML v2002-1"> | ||
| 18 | <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> | ||
| 19 | |||
| 20 | <LINK REL="STYLESHEET" HREF="documentation.css"> | ||
| 21 | |||
| 22 | <LINK REL="next" HREF="node5.html"> | ||
| 23 | <LINK REL="previous" HREF="node3.html"> | ||
| 24 | <LINK REL="up" HREF="documentation.html"> | ||
| 25 | <LINK REL="next" HREF="node5.html"> | ||
| 26 | </HEAD> | ||
| 27 | |||
| 28 | <BODY > | ||
| 29 | <!--Navigation Panel--> | ||
| 30 | <A NAME="tex2html172" | ||
| 31 | HREF="node5.html"> | ||
| 32 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> | ||
| 33 | <A NAME="tex2html168" | ||
| 34 | HREF="documentation.html"> | ||
| 35 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> | ||
| 36 | <A NAME="tex2html162" | ||
| 37 | HREF="node3.html"> | ||
| 38 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> | ||
| 39 | <A NAME="tex2html170" | ||
| 40 | HREF="node1.html"> | ||
| 41 | <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> | ||
| 42 | <BR> | ||
| 43 | <B> Next:</B> <A NAME="tex2html173" | ||
| 44 | HREF="node5.html">4 FAQ</A> | ||
| 45 | <B> Up:</B> <A NAME="tex2html169" | ||
| 46 | HREF="documentation.html">Installing and Running mod_log_sql</A> | ||
| 47 | <B> Previous:</B> <A NAME="tex2html163" | ||
| 48 | HREF="node3.html">2 Installation</A> | ||
| 49 | <B> <A NAME="tex2html171" | ||
| 50 | HREF="node1.html">Contents</A></B> | ||
| 51 | <BR> | ||
| 52 | <BR> | ||
| 53 | <!--End of Navigation Panel--> | ||
| 54 | <!--Table of Child-Links--> | ||
| 55 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A> | ||
| 56 | |||
| 57 | <UL> | ||
| 58 | <LI><A NAME="tex2html174" | ||
| 59 | HREF="node4.html#SECTION00041000000000000000">3.1 Preparing MySQL for logging</A> | ||
| 60 | <LI><A NAME="tex2html175" | ||
| 61 | HREF="node4.html#SECTION00042000000000000000">3.2 A very basic logging setup in Apache</A> | ||
| 62 | <LI><A NAME="tex2html176" | ||
| 63 | HREF="node4.html#SECTION00043000000000000000">3.3 Testing the basic setup</A> | ||
| 64 | <LI><A NAME="tex2html177" | ||
| 65 | HREF="node4.html#SECTION00044000000000000000">3.4 How to tune logging with run-time directives</A> | ||
| 66 | <UL> | ||
| 67 | <LI><A NAME="tex2html178" | ||
| 68 | HREF="node4.html#SECTION00044100000000000000">3.4.1 Instructing the module what to log</A> | ||
| 69 | <LI><A NAME="tex2html179" | ||
| 70 | HREF="node4.html#SECTION00044200000000000000">3.4.2 Instructing the module what NOT to log using filtering | ||
| 71 | directives</A> | ||
| 72 | </UL> | ||
| 73 | <BR> | ||
| 74 | <LI><A NAME="tex2html180" | ||
| 75 | HREF="node4.html#SECTION00045000000000000000">3.5 Advanced logging scenarios</A> | ||
| 76 | <UL> | ||
| 77 | <LI><A NAME="tex2html181" | ||
| 78 | HREF="node4.html#SECTION00045100000000000000">3.5.1 Using the module in an ISP environment</A> | ||
| 79 | <LI><A NAME="tex2html182" | ||
| 80 | HREF="node4.html#SECTION00045200000000000000">3.5.2 Logging many-to-one data in separate tables</A> | ||
| 81 | <LI><A NAME="tex2html183" | ||
| 82 | HREF="node4.html#SECTION00045300000000000000">3.5.3 Using the same database for production and test</A> | ||
| 83 | <LI><A NAME="tex2html184" | ||
| 84 | HREF="node4.html#SECTION00045400000000000000">3.5.4 Optimizing for a busy database</A> | ||
| 85 | </UL> | ||
| 86 | <BR> | ||
| 87 | <LI><A NAME="tex2html185" | ||
| 88 | HREF="node4.html#SECTION00046000000000000000">3.6 Configuration directive reference</A> | ||
| 89 | <UL> | ||
| 90 | <LI><A NAME="tex2html186" | ||
| 91 | HREF="node4.html#SECTION00046100000000000000">3.6.1 LogSQLCookieLogTable</A> | ||
| 92 | <LI><A NAME="tex2html187" | ||
| 93 | HREF="node4.html#SECTION00046200000000000000">3.6.2 LogSQLCreateTables</A> | ||
| 94 | <LI><A NAME="tex2html188" | ||
| 95 | HREF="node4.html#SECTION00046300000000000000">3.6.3 LogSQLDatabase </A> | ||
| 96 | <LI><A NAME="tex2html189" | ||
| 97 | HREF="node4.html#SECTION00046400000000000000">3.6.4 LogSQLForcePreserve</A> | ||
| 98 | <LI><A NAME="tex2html190" | ||
| 99 | HREF="node4.html#SECTION00046500000000000000">3.6.5 LogSQLHeadersInLogTable</A> | ||
| 100 | <LI><A NAME="tex2html191" | ||
| 101 | HREF="node4.html#SECTION00046600000000000000">3.6.6 LogSQLHeadersOutLogTable</A> | ||
| 102 | <LI><A NAME="tex2html192" | ||
| 103 | HREF="node4.html#SECTION00046700000000000000">3.6.7 LogSQLLoginInfo </A> | ||
| 104 | <LI><A NAME="tex2html193" | ||
| 105 | HREF="node4.html#SECTION00046800000000000000">3.6.8 LogSQLMachineID</A> | ||
| 106 | <LI><A NAME="tex2html194" | ||
| 107 | HREF="node4.html#SECTION00046900000000000000">3.6.9 LogSQLMassVirtualHosting</A> | ||
| 108 | <LI><A NAME="tex2html195" | ||
| 109 | HREF="node4.html#SECTION000461000000000000000">3.6.10 LogSQLNotesLogTable</A> | ||
| 110 | <LI><A NAME="tex2html196" | ||
| 111 | HREF="node4.html#SECTION000461100000000000000">3.6.11 LogSQLPreserveFile</A> | ||
| 112 | <LI><A NAME="tex2html197" | ||
| 113 | HREF="node4.html#SECTION000461200000000000000">3.6.12 LogSQLRemhostIgnore</A> | ||
| 114 | <LI><A NAME="tex2html198" | ||
| 115 | HREF="node4.html#SECTION000461300000000000000">3.6.13 LogSQLRequestAccept</A> | ||
| 116 | <LI><A NAME="tex2html199" | ||
| 117 | HREF="node4.html#SECTION000461400000000000000">3.6.14 LogSQLRequestIgnore</A> | ||
| 118 | <LI><A NAME="tex2html200" | ||
| 119 | HREF="node4.html#SECTION000461500000000000000">3.6.15 LogSQLSocketFile </A> | ||
| 120 | <LI><A NAME="tex2html201" | ||
| 121 | HREF="node4.html#SECTION000461600000000000000">3.6.16 LogSQLTCPPort</A> | ||
| 122 | <LI><A NAME="tex2html202" | ||
| 123 | HREF="node4.html#SECTION000461700000000000000">3.6.17 LogSQLTransferLogFormat </A> | ||
| 124 | <LI><A NAME="tex2html203" | ||
| 125 | HREF="node4.html#SECTION000461800000000000000">3.6.18 LogSQLTransferLogTable</A> | ||
| 126 | <LI><A NAME="tex2html204" | ||
| 127 | HREF="node4.html#SECTION000461900000000000000">3.6.19 LogSQLWhichCookie</A> | ||
| 128 | <LI><A NAME="tex2html205" | ||
| 129 | HREF="node4.html#SECTION000462000000000000000">3.6.20 LogSQLWhichCookies</A> | ||
| 130 | <LI><A NAME="tex2html206" | ||
| 131 | HREF="node4.html#SECTION000462100000000000000">3.6.21 LogSQLWhichHeadersIn</A> | ||
| 132 | <LI><A NAME="tex2html207" | ||
| 133 | HREF="node4.html#SECTION000462200000000000000">3.6.22 LogSQLWhichHeadersOut</A> | ||
| 134 | <LI><A NAME="tex2html208" | ||
| 135 | HREF="node4.html#SECTION000462300000000000000">3.6.23 LogSQLWhichNotes</A> | ||
| 136 | </UL></UL> | ||
| 137 | <!--End of Table of Child-Links--> | ||
| 138 | <HR> | ||
| 139 | |||
| 140 | <H1><A NAME="SECTION00040000000000000000"></A><A NAME="sec:Configuration"></A> | ||
| 141 | <BR> | ||
| 142 | 3 Configuration | ||
| 143 | </H1> | ||
| 144 | |||
| 145 | <P> | ||
| 146 | |||
| 147 | <H2><A NAME="SECTION00041000000000000000"></A><A NAME="sub:PrepDb"></A> | ||
| 148 | <BR> | ||
| 149 | 3.1 Preparing MySQL for logging | ||
| 150 | </H2> | ||
| 151 | |||
| 152 | <P> | ||
| 153 | You have to prepare the database to receive data from mod_log_sql, | ||
| 154 | and set up run-time directives in httpd.conf to control how and what | ||
| 155 | mod_log_sql logs. | ||
| 156 | |||
| 157 | <P> | ||
| 158 | This section will discuss how to get started with a basic config. | ||
| 159 | Full documentation of all available run-time directives is available | ||
| 160 | in section <A HREF="node4.html#sec:ConfRef">3.6</A>. | ||
| 161 | |||
| 162 | <P> | ||
| 163 | |||
| 164 | <OL> | ||
| 165 | <LI>mod_log_sql can make its own tables on-the-fly, or you can pre-make | ||
| 166 | the tables by hand. The advantage of letting the module make the tables | ||
| 167 | is ease-of-use, but for raw performance you will want to pre-make | ||
| 168 | the tables in order to save some overhead. In this basic setup we'll | ||
| 169 | just let the module create tables for us. | ||
| 170 | </LI> | ||
| 171 | <LI>We still need to have a logging database created and ready, so run | ||
| 172 | the MySQL command line client and create a database: | ||
| 173 | |||
| 174 | <P> | ||
| 175 | |||
| 176 | <DL COMPACT> | ||
| 177 | <DT> | ||
| 178 | <DD># mysql -uadmin -pmypassword | ||
| 179 | |||
| 180 | <P> | ||
| 181 | Enter password: | ||
| 182 | |||
| 183 | <P> | ||
| 184 | mysql> create database apachelogs; | ||
| 185 | </DD> | ||
| 186 | </DL> | ||
| 187 | </LI> | ||
| 188 | <LI><A NAME="part:CrTbl"></A>If you want to hand-create the tables, run the | ||
| 189 | enclosed 'create-tables' SQL script as follows: | ||
| 190 | |||
| 191 | <P> | ||
| 192 | |||
| 193 | <DL COMPACT> | ||
| 194 | <DT> | ||
| 195 | <DD>mysql> source create_tables.sql | ||
| 196 | </DD> | ||
| 197 | </DL> | ||
| 198 | </LI> | ||
| 199 | <LI>Create a specific MySQL userid that httpd will use to authenticate | ||
| 200 | and enter data. This userid need not be an actual Unix user. It is | ||
| 201 | a userid internal to MySQL with specific privileges. In the following | ||
| 202 | example command, "apachelogs" is the database, "loguser" | ||
| 203 | is the userid to create, "my.apachemachine.com" | ||
| 204 | is the name of the Apache machine, and "l0gger" | ||
| 205 | is the password to assign. Choose values that are different from these | ||
| 206 | examples. | ||
| 207 | |||
| 208 | <P> | ||
| 209 | |||
| 210 | <DL COMPACT> | ||
| 211 | <DT> | ||
| 212 | <DD>mysql> grant insert,create on apachelogs.* to loguser@my.apachemachine.com | ||
| 213 | |||
| 214 | <P> | ||
| 215 | identified by 'l0gger'; | ||
| 216 | </DD> | ||
| 217 | </DL> | ||
| 218 | </LI> | ||
| 219 | <LI>You may be especially security-paranoid and want "loguser" | ||
| 220 | to <I>not</I> have "create" capability within the | ||
| 221 | "apachelogs" database. You can disable that privilege, | ||
| 222 | but the cost is that you will not be able to use the module's on-the-fly | ||
| 223 | table creation feature. If that cost is acceptable, hand-create the | ||
| 224 | tables as described in step <A HREF="node4.html#part:CrTbl">3</A> and use the following | ||
| 225 | GRANT statement instead of the one above: | ||
| 226 | |||
| 227 | <P> | ||
| 228 | |||
| 229 | <DL COMPACT> | ||
| 230 | <DT> | ||
| 231 | <DD>mysql> grant insert on apachelogs.* to loguser@my.apachemachine.com | ||
| 232 | |||
| 233 | <P> | ||
| 234 | identified by 'l0gger'; | ||
| 235 | </DD> | ||
| 236 | </DL> | ||
| 237 | </LI> | ||
| 238 | <LI><A NAME="step:EnaLog"></A>Enable full logging of your MySQL daemon (at least | ||
| 239 | temporarily for debugging purposes) if you don't do this already. | ||
| 240 | Edit /etc/my.cnf and add the following line to your [mysqld] section: | ||
| 241 | |||
| 242 | <P> | ||
| 243 | |||
| 244 | <DL COMPACT> | ||
| 245 | <DT> | ||
| 246 | <DD>log=/var/log/mysql-messages | ||
| 247 | </DD> | ||
| 248 | </DL>Then restart MySQL. | ||
| 249 | |||
| 250 | <P> | ||
| 251 | |||
| 252 | <DL COMPACT> | ||
| 253 | <DT> | ||
| 254 | <DD># /etc/rc.d/init.d/mysql restart | ||
| 255 | </DD> | ||
| 256 | </DL> | ||
| 257 | </LI> | ||
| 258 | </OL> | ||
| 259 | |||
| 260 | <P> | ||
| 261 | |||
| 262 | <H2><A NAME="SECTION00042000000000000000"> | ||
| 263 | 3.2 A very basic logging setup in Apache</A> | ||
| 264 | </H2> | ||
| 265 | |||
| 266 | <P> | ||
| 267 | |||
| 268 | <OL> | ||
| 269 | <LI>Tell the module what database to use and the appropriate authentication | ||
| 270 | information. | ||
| 271 | |||
| 272 | <P> | ||
| 273 | So, edit httpd.conf and insert the following lines somewhere after | ||
| 274 | any LoadModule / AddModule statements. <I>Make sure these statements | ||
| 275 | are ``global,'' i.e. not inside any VirtualHost stanza</I>. You will | ||
| 276 | also note that you are embedding a password in the file. Therefore | ||
| 277 | you are advised to ``chmod 660 httpd.conf'' to prevent unauthorized | ||
| 278 | regular users from viewing your database user and password. | ||
| 279 | |||
| 280 | <P> | ||
| 281 | <B>Example</B>: Use the MySQL database called "apachelogs" | ||
| 282 | running on "dbmachine.foo.com". Use username "loguser" | ||
| 283 | and password "l0gg3r" to authenticate to the database. | ||
| 284 | Permit the module create tables for us. | ||
| 285 | |||
| 286 | <P> | ||
| 287 | |||
| 288 | <DL COMPACT> | ||
| 289 | <DT> | ||
| 290 | <DD>LogSQLLoginInfo dbmachine.foo.com loguser l0gg3r | ||
| 291 | |||
| 292 | <P> | ||
| 293 | LogSQLDatabase apachelogs | ||
| 294 | |||
| 295 | <P> | ||
| 296 | LogSQLCreateTables on | ||
| 297 | </DD> | ||
| 298 | </DL>If your database resides on localhost instead of another host, specify | ||
| 299 | the MySQL server's socket file as follows: | ||
| 300 | |||
| 301 | <P> | ||
| 302 | |||
| 303 | <DL COMPACT> | ||
| 304 | <DT> | ||
| 305 | <DD>LogSQLSocketFile /your/path/to/mysql.sock | ||
| 306 | </DD> | ||
| 307 | </DL>If your database is listening on a port other than 3306, specify the | ||
| 308 | correct TCP port as follows: | ||
| 309 | |||
| 310 | <P> | ||
| 311 | |||
| 312 | <DL COMPACT> | ||
| 313 | <DT> | ||
| 314 | <DD>LogSQLTCPPort 1234 | ||
| 315 | </DD> | ||
| 316 | </DL> | ||
| 317 | </LI> | ||
| 318 | <LI>The actual logging is set up on a virtual-host-by-host basis. So, | ||
| 319 | skip down to the virtual host you want to set up. Instruct this virtual | ||
| 320 | host to log entries to the table ``access_log'' by inserting | ||
| 321 | a L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>T<SMALL>ABLE</SMALL> directive. (The L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>T<SMALL>ABLE</SMALL> | ||
| 322 | directive is the minimum required to log - other directives that | ||
| 323 | you'll learn about later simply tune the module's behavior.) | ||
| 324 | |||
| 325 | <P> | ||
| 326 | |||
| 327 | <DL COMPACT> | ||
| 328 | <DT> | ||
| 329 | <DD><VirtualHost 1.2.3.4> | ||
| 330 | |||
| 331 | <P> | ||
| 332 | [snip] | ||
| 333 | |||
| 334 | <P> | ||
| 335 | LogSQLTransferLogTable access_log | ||
| 336 | |||
| 337 | <P> | ||
| 338 | [snip] | ||
| 339 | |||
| 340 | <P> | ||
| 341 | </VirtualHost> | ||
| 342 | </DD> | ||
| 343 | </DL> | ||
| 344 | </LI> | ||
| 345 | <LI>Restart apache. | ||
| 346 | |||
| 347 | <P> | ||
| 348 | |||
| 349 | <DL COMPACT> | ||
| 350 | <DT> | ||
| 351 | <DD># /etc/rc.d/init.d/httpd stop | ||
| 352 | |||
| 353 | <P> | ||
| 354 | # /etc/rc.d/init.d/httpd start | ||
| 355 | </DD> | ||
| 356 | </DL> | ||
| 357 | </LI> | ||
| 358 | </OL> | ||
| 359 | |||
| 360 | <P> | ||
| 361 | |||
| 362 | <H2><A NAME="SECTION00043000000000000000"> | ||
| 363 | 3.3 Testing the basic setup</A> | ||
| 364 | </H2> | ||
| 365 | |||
| 366 | <P> | ||
| 367 | |||
| 368 | <OL> | ||
| 369 | <LI>Visit your web site in a browser to trigger some hits, then confirm | ||
| 370 | that the entries are being successfully logged: | ||
| 371 | |||
| 372 | <P> | ||
| 373 | |||
| 374 | <DL COMPACT> | ||
| 375 | <DT> | ||
| 376 | <DD># mysql -hdbmachine.foo.com -umysqladmin -p -e "select * from access_log" apachelogs | ||
| 377 | |||
| 378 | <P> | ||
| 379 | Enter password: | ||
| 380 | </DD> | ||
| 381 | </DL>Several lines of output should follow, corresponding to your hits | ||
| 382 | on the site. You now have basic functionality. Don't disable your | ||
| 383 | regular Apache logs until you feel comfortable that the database is | ||
| 384 | behaving as you'd like and that things are going well. If you do not | ||
| 385 | see any entries in the access_log, please consult section <A HREF="node5.html#faq:NothingLogged">4.2.2</A> | ||
| 386 | of the FAQ on how to debug and fix the situation. | ||
| 387 | |||
| 388 | <P> | ||
| 389 | </LI> | ||
| 390 | <LI>You can now activate the advanced features of mod_log_sql, which | ||
| 391 | are described in the next section. | ||
| 392 | </LI> | ||
| 393 | </OL> | ||
| 394 | |||
| 395 | <P> | ||
| 396 | |||
| 397 | <H2><A NAME="SECTION00044000000000000000"> | ||
| 398 | 3.4 How to tune logging with run-time directives</A> | ||
| 399 | </H2> | ||
| 400 | |||
| 401 | <P> | ||
| 402 | |||
| 403 | <H3><A NAME="SECTION00044100000000000000"> | ||
| 404 | 3.4.1 Instructing the module what to log</A> | ||
| 405 | </H3> | ||
| 406 | |||
| 407 | <P> | ||
| 408 | The most basic directive for the module is L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL>, | ||
| 409 | which tells the module which information to send to the database; | ||
| 410 | logging to the database will not take place without it. Place a L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL> | ||
| 411 | directive in the VirtualHost stanza of each virtual host that you | ||
| 412 | want to activate. | ||
| 413 | |||
| 414 | <P> | ||
| 415 | After L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL> you supply a string of characters | ||
| 416 | that tell the module what information to log. In the configuration | ||
| 417 | directive reference (section <A HREF="node4.html#sub:Frmat">3.6.17</A>) there is a table which | ||
| 418 | clearly defines all the possible things to log. Let's say you want | ||
| 419 | to log only the ``request time,'' the ``remote host,'' and | ||
| 420 | the ``request''; you'd use: | ||
| 421 | |||
| 422 | <P> | ||
| 423 | |||
| 424 | <DL COMPACT> | ||
| 425 | <DT> | ||
| 426 | <DD>LogSQLTransferLogFormat hUS | ||
| 427 | </DD> | ||
| 428 | </DL>But a more appropriate string to use is | ||
| 429 | |||
| 430 | <P> | ||
| 431 | |||
| 432 | <DL COMPACT> | ||
| 433 | <DT> | ||
| 434 | <DD>LogSQLTransferLogFormat AbHhmRSsTUuv | ||
| 435 | </DD> | ||
| 436 | </DL>which logs all the information required to be compatible with the | ||
| 437 | Combined Log Format (CLF). | ||
| 438 | |||
| 439 | <P> | ||
| 440 | If you don't choose to log everything that is available, that's fine. | ||
| 441 | Fields in the unused columns in your table will simply contain NULL. | ||
| 442 | |||
| 443 | <P> | ||
| 444 | Some of the L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL> characters require a | ||
| 445 | little extra configuration: | ||
| 446 | |||
| 447 | <P> | ||
| 448 | |||
| 449 | <UL> | ||
| 450 | <LI>If you specify 'c' to indicate that you want to log the cookie value, | ||
| 451 | you must also tell the module which cookie you mean by using L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>C<SMALL>OOKIE</SMALL> | ||
| 452 | - after all, there could be many cookies associated with a given | ||
| 453 | request. Fail to specify L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>C<SMALL>OOKIE</SMALL>, and no cookie | ||
| 454 | information at all will be logged. | ||
| 455 | </LI> | ||
| 456 | <LI>If you specify 'M' to indicate that you want to log the machine ID, | ||
| 457 | you must also tell the module this machine's identity using the L<SMALL>OG</SMALL>SQLM<SMALL>ACHINE</SMALL>ID | ||
| 458 | directive. Fail to specify L<SMALL>OG</SMALL>SQLM<SMALL>ACHINE</SMALL>ID, and a simple | ||
| 459 | '-' character will be logged in the machine_id column. | ||
| 460 | </LI> | ||
| 461 | </UL> | ||
| 462 | |||
| 463 | <P> | ||
| 464 | |||
| 465 | <H3><A NAME="SECTION00044200000000000000"></A><A NAME="sub:Ignore"></A> | ||
| 466 | <BR> | ||
| 467 | 3.4.2 Instructing the module what NOT to log using filtering | ||
| 468 | directives | ||
| 469 | </H3> | ||
| 470 | |||
| 471 | <P> | ||
| 472 | One ``accept'' and two ``ignore'' directives allow you to | ||
| 473 | fine-tune what the module should not log. These are very handy for | ||
| 474 | keeping your database as uncluttered as possible and keeping your | ||
| 475 | statistics free of unneeded numbers. Think of each one as a gatekeeper. | ||
| 476 | |||
| 477 | <P> | ||
| 478 | <I>It is important to remember that each of these three directives | ||
| 479 | is purely optional. mod_log_sql's default is to log everything. </I> | ||
| 480 | |||
| 481 | <P> | ||
| 482 | When a request comes in, the contents of L<SMALL>OG</SMALL>SQLR<SMALL>EQUEST</SMALL>A<SMALL>CCEPT</SMALL> | ||
| 483 | are evaluated first. This optional, ``blanket'' directive lets | ||
| 484 | you specify that only certain things are to be accepted for logging, | ||
| 485 | and everything else discarded. Because it is evaluated before L<SMALL>OG</SMALL>SQLR<SMALL>EQUEST</SMALL>I<SMALL>GNORE</SMALL> | ||
| 486 | and L<SMALL>OG</SMALL>SQLR<SMALL>EMHOST</SMALL>I<SMALL>GNORE</SMALL> it can halt logging before those | ||
| 487 | two filtering directives ``get their chance.'' | ||
| 488 | |||
| 489 | <P> | ||
| 490 | Once a request makes it past L<SMALL>OG</SMALL>SQLR<SMALL>EQUEST</SMALL>A<SMALL>CCEPT</SMALL>, it still | ||
| 491 | can be excluded based on L<SMALL>OG</SMALL>SQLR<SMALL>EMHOST</SMALL>I<SMALL>GNORE</SMALL> and L<SMALL>OG</SMALL>SQLR<SMALL>EQUEST</SMALL>I<SMALL>GNORE</SMALL>. | ||
| 492 | A good way to use L<SMALL>OG</SMALL>SQLR<SMALL>EMHOST</SMALL>I<SMALL>GNORE</SMALL> is to prevent the module | ||
| 493 | from logging the traffic that your internal hosts generate. L<SMALL>OG</SMALL>SQLR<SMALL>EQUEST</SMALL>I<SMALL>GNORE</SMALL> | ||
| 494 | is great for preventing things like requests for ``favicon.ico'' | ||
| 495 | from cluttering up your database, as well as excluding the various | ||
| 496 | requests that worms make, etc. | ||
| 497 | |||
| 498 | <P> | ||
| 499 | You can specify a series of strings after each directive. Do not use | ||
| 500 | any type of globbing or regular-expression syntax - each string is | ||
| 501 | considered a match <I>if it is a substring of the larger request | ||
| 502 | or remote-host; the comarison is case-sensitive.</I> This means that | ||
| 503 | ``L<SMALL>OG</SMALL>SQLR<SMALL>EMHOST</SMALL>I<SMALL>GNORE</SMALL> micro'' will ignore requests from | ||
| 504 | ``microsoft.com,'' ``microworld.net,'' ``mymicroscope.org,'' | ||
| 505 | etc. ``L<SMALL>OG</SMALL>SQLR<SMALL>EQUEST</SMALL>I<SMALL>GNORE</SMALL> gif'' will instruct the module | ||
| 506 | to ignore requests for ``leftbar.gif,'' ``bluedot.gif'' and | ||
| 507 | even ``giftwrap.jpg'' - but ``RED.GIF'' and ``Tree.Gif'' | ||
| 508 | would still get logged because of case sensitivity. | ||
| 509 | |||
| 510 | <P> | ||
| 511 | A summary of the decision flow: | ||
| 512 | |||
| 513 | <P> | ||
| 514 | |||
| 515 | <OL> | ||
| 516 | <LI>If L<SMALL>OG</SMALL>SQLR<SMALL>EQUEST</SMALL>A<SMALL>CCEPT</SMALL> exists and a request does not match | ||
| 517 | anything in that list, it is discarded. | ||
| 518 | </LI> | ||
| 519 | <LI>If a request matches anything in the L<SMALL>OG</SMALL>SQLR<SMALL>EQUEST</SMALL>I<SMALL>GNORE</SMALL> | ||
| 520 | list, it is discarded. | ||
| 521 | </LI> | ||
| 522 | <LI>If a reqiest matches anything in the L<SMALL>OG</SMALL>SQLR<SMALL>EMHOST</SMALL>I<SMALL>GNORE</SMALL> | ||
| 523 | list, it is discarded. | ||
| 524 | </LI> | ||
| 525 | <LI>Otherwise the request is logged. | ||
| 526 | </LI> | ||
| 527 | </OL> | ||
| 528 | This means that you can have a series of directives similar to the | ||
| 529 | following: | ||
| 530 | |||
| 531 | <P> | ||
| 532 | |||
| 533 | <DL COMPACT> | ||
| 534 | <DT> | ||
| 535 | <DD>LogSQLRequestAccept *.html *.gif *.jpg | ||
| 536 | |||
| 537 | <P> | ||
| 538 | LogSQLRequestIgnore statistics.html bluedot.jpg | ||
| 539 | </DD> | ||
| 540 | </DL>So the first line instructs the module to <B>only</B> log files | ||
| 541 | with html, gif and jpg suffixes; requests for ``formail.cgi'' | ||
| 542 | and ``shopping-cart.pl'' will never be considered for logging. | ||
| 543 | (``LeftArrow.JPG'' will also never be considered for logging - | ||
| 544 | remember, the comparison is <B>case sensitive</B>.) The second line | ||
| 545 | prunes the list further - you never want to log requests for those | ||
| 546 | two objects. | ||
| 547 | |||
| 548 | <P> | ||
| 549 | Tip: if you want to match all the hosts in your domain such as ``host1.corp.foo.com'' | ||
| 550 | and ``server.dmz.foo.com'', simply specify: | ||
| 551 | |||
| 552 | <P> | ||
| 553 | |||
| 554 | <DL COMPACT> | ||
| 555 | <DT> | ||
| 556 | <DD>LogSQLRemhostIgnore foo.com | ||
| 557 | </DD> | ||
| 558 | </DL>Tip: a great way to catch the vast majority of worm-attack requests | ||
| 559 | and prevent them from being logged is to specify: | ||
| 560 | |||
| 561 | <P> | ||
| 562 | |||
| 563 | <DL COMPACT> | ||
| 564 | <DT> | ||
| 565 | <DD>LogSQLRequestIgnore root.exe cmd.exe default.ida | ||
| 566 | </DD> | ||
| 567 | </DL>Tip: to prevent the logging of requests for common graphic types, | ||
| 568 | make sure to put a '.' before the suffix to avoid matches that you | ||
| 569 | didn't intend: | ||
| 570 | |||
| 571 | <P> | ||
| 572 | |||
| 573 | <DL COMPACT> | ||
| 574 | <DT> | ||
| 575 | <DD>LogSQLRequestIgnore .gif .jpg | ||
| 576 | </DD> | ||
| 577 | </DL> | ||
| 578 | <P> | ||
| 579 | |||
| 580 | <H2><A NAME="SECTION00045000000000000000"> | ||
| 581 | 3.5 Advanced logging scenarios</A> | ||
| 582 | </H2> | ||
| 583 | |||
| 584 | <P> | ||
| 585 | |||
| 586 | <H3><A NAME="SECTION00045100000000000000"> | ||
| 587 | 3.5.1 Using the module in an ISP environment</A> | ||
| 588 | </H3> | ||
| 589 | |||
| 590 | <P> | ||
| 591 | mod_log_sql has three basic tiers of operation: | ||
| 592 | |||
| 593 | <P> | ||
| 594 | |||
| 595 | <OL> | ||
| 596 | <LI>The administrator creates all necessary tables by hand and configures | ||
| 597 | each Apache VirtualHost by hand. (L<SMALL>OG</SMALL>SQLC<SMALL>REATE</SMALL>T<SMALL>ABLES </SMALL>O<SMALL>FF</SMALL>) | ||
| 598 | </LI> | ||
| 599 | <LI>The module is permitted to create necessary tables on-the-fly, but | ||
| 600 | the administrator configures each Apache VirtualHost by hand. (L<SMALL>OG</SMALL>SQLC<SMALL>REATE</SMALL>T<SMALL>ABLES | ||
| 601 | </SMALL>O<SMALL>N</SMALL>) | ||
| 602 | </LI> | ||
| 603 | <LI>The module is permitted to create all necessary tables and to make | ||
| 604 | intelligent, on-the-fly configuration of each VirtualHost. (L<SMALL>OG</SMALL>SQLM<SMALL>ASS</SMALL>V<SMALL>IRTUAL</SMALL>H<SMALL>OSTING | ||
| 605 | </SMALL>O<SMALL>N</SMALL>) | ||
| 606 | </LI> | ||
| 607 | </OL> | ||
| 608 | Many users are happy to use the module in its most minimal form: they | ||
| 609 | hand-create any necessary tables (using ``create_tables.sql''), | ||
| 610 | and they configure each VirtualHost by hand to suit their needs. However, | ||
| 611 | some administrators need extra features due to a large and growing | ||
| 612 | number of VirtualHosts. The L<SMALL>OG</SMALL>SQLM<SMALL>ASS</SMALL>V<SMALL>IRTUAL</SMALL>H<SMALL>OSTING</SMALL> directive | ||
| 613 | activates module capabilities that make it far easier to manage an | ||
| 614 | ISP environment, or any situation characterized by a large and varying | ||
| 615 | number of virtual servers: | ||
| 616 | |||
| 617 | <P> | ||
| 618 | |||
| 619 | <UL> | ||
| 620 | <LI>the on-the-fly table creation feature is activated automatically | ||
| 621 | </LI> | ||
| 622 | <LI>the transfer log table name is dynamically set from the virtual host's | ||
| 623 | name (example: a virtual host ``www.grubbybaby.com'' gets logged | ||
| 624 | to table ``access_www_grubbybaby_com'') | ||
| 625 | </LI> | ||
| 626 | </UL> | ||
| 627 | There are numerous benefits. The admin will not need to create new | ||
| 628 | tables for every new VirtualHost. (Although the admin will still need | ||
| 629 | to drop the tables of virtual hosts that are removed.) The admin will | ||
| 630 | not need to set L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>T<SMALL>ABLE</SMALL> for each virtual host | ||
| 631 | - it will be configured automatically based on the host's name. Because | ||
| 632 | each virtual host will log to its own segregated table, data about | ||
| 633 | one virtual server will segregate from others; an admin can grant | ||
| 634 | users access to the tables they need, and they will be unable to view | ||
| 635 | data about another user's virtual host. | ||
| 636 | |||
| 637 | <P> | ||
| 638 | In an ISP scenario the admin is likely to have a cluster of many front-end | ||
| 639 | webservers logging to a back-end database. mod_log_sql has a feature | ||
| 640 | that permits analysis of how well the web servers are loadbalancing: | ||
| 641 | the L<SMALL>OG</SMALL>SQLM<SMALL>ACHINE</SMALL>ID directive. The administrator uses this | ||
| 642 | directive to assign a unique identifier to each machine in the web | ||
| 643 | cluster, e.g. ``L<SMALL>OG</SMALL>SQLM<SMALL>ACHINE</SMALL>ID web01,'' ``L<SMALL>OG</SMALL>SQLM<SMALL>ACHINE</SMALL>ID | ||
| 644 | web02,'' etc. Used in conjunction with the 'M' character in L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL>, | ||
| 645 | each entry in the SQL log will include the machine ID of the machine | ||
| 646 | that created the entry. This permits the administrator to count the | ||
| 647 | entries made by each particular machine and thereby analyze the front-end | ||
| 648 | loadbalancing algorithm. | ||
| 649 | |||
| 650 | <P> | ||
| 651 | |||
| 652 | <H3><A NAME="SECTION00045200000000000000"></A><A NAME="secMulTable"></A> | ||
| 653 | <BR> | ||
| 654 | 3.5.2 Logging many-to-one data in separate tables | ||
| 655 | </H3> | ||
| 656 | |||
| 657 | <P> | ||
| 658 | A given HTTP request can have a one-to-many relationship with certain | ||
| 659 | kinds of data. For example, a single HTTP request can have 4 cookies, | ||
| 660 | 3 headers and 5 ``mod_gzip'' notes associated with it. mod_log_sql | ||
| 661 | is capable of logging these relationships due to the elegance of SQL | ||
| 662 | relational data. | ||
| 663 | |||
| 664 | <P> | ||
| 665 | You already have a single table containing access requests. One of | ||
| 666 | the columns in that table is 'id' which is intended to contain the | ||
| 667 | unique request ID supplied by the standard Apache module mod_unique_id | ||
| 668 | - all you need to do is compile in that module and employ the L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL> | ||
| 669 | character 'I'. Thereafter, each request gets a unique ID that can | ||
| 670 | be thought of as a primary key within the database, useful for joining | ||
| 671 | multiple tables. So let's envision several new tables: a notes table, | ||
| 672 | a cookies table, and a table for inbound and outbound headers. | ||
| 673 | |||
| 674 | <P> | ||
| 675 | <BR><P></P> | ||
| 676 | <DIV ALIGN="CENTER"> | ||
| 677 | |||
| 678 | <P> | ||
| 679 | |||
| 680 | <P> | ||
| 681 | <DIV ALIGN="CENTER"> | ||
| 682 | <A NAME="958"></A> | ||
| 683 | <TABLE CELLPADDING=3 BORDER="1"> | ||
| 684 | <CAPTION><STRONG>Table 1:</STRONG> | ||
| 685 | access_log</CAPTION> | ||
| 686 | <TR><TD ALIGN="LEFT">id</TD> | ||
| 687 | <TD ALIGN="LEFT">remote_host</TD> | ||
| 688 | <TD ALIGN="LEFT">request_uri</TD> | ||
| 689 | <TD ALIGN="LEFT">time_stamp</TD> | ||
| 690 | <TD ALIGN="LEFT">status</TD> | ||
| 691 | <TD ALIGN="LEFT">bytes_sent</TD> | ||
| 692 | </TR> | ||
| 693 | <TR><TD ALIGN="LEFT">PPIDskBRH30AAGPtAsg</TD> | ||
| 694 | <TD ALIGN="LEFT">zerberus.aiacs.net</TD> | ||
| 695 | <TD ALIGN="LEFT">/mod_log_sql/index.html</TD> | ||
| 696 | <TD ALIGN="LEFT">1022493617</TD> | ||
| 697 | <TD ALIGN="LEFT">200</TD> | ||
| 698 | <TD ALIGN="LEFT">2215</TD> | ||
| 699 | </TR> | ||
| 700 | </TABLE> | ||
| 701 | </DIV> | ||
| 702 | </DIV> | ||
| 703 | <BR> | ||
| 704 | <BR><P></P> | ||
| 705 | <DIV ALIGN="CENTER"> | ||
| 706 | |||
| 707 | <P> | ||
| 708 | |||
| 709 | <P> | ||
| 710 | <DIV ALIGN="CENTER"> | ||
| 711 | <A NAME="959"></A> | ||
| 712 | <TABLE CELLPADDING=3 BORDER="1"> | ||
| 713 | <CAPTION><STRONG>Table 2:</STRONG> | ||
| 714 | notes_log</CAPTION> | ||
| 715 | <TR><TD ALIGN="LEFT">id</TD> | ||
| 716 | <TD ALIGN="LEFT">item</TD> | ||
| 717 | <TD ALIGN="LEFT">val</TD> | ||
| 718 | </TR> | ||
| 719 | <TR><TD ALIGN="LEFT">PPIDskBRH30AAGPtAsg</TD> | ||
| 720 | <TD ALIGN="LEFT">mod_gzip_result</TD> | ||
| 721 | <TD ALIGN="LEFT">OK</TD> | ||
| 722 | </TR> | ||
| 723 | <TR><TD ALIGN="LEFT">PPIDskBRH30AAGPtAsg</TD> | ||
| 724 | <TD ALIGN="LEFT">mod_gzip_compression_ratio</TD> | ||
| 725 | <TD ALIGN="LEFT">69</TD> | ||
| 726 | </TR> | ||
| 727 | </TABLE> | ||
| 728 | </DIV> | ||
| 729 | </DIV> | ||
| 730 | <BR> | ||
| 731 | |||
| 732 | <P> | ||
| 733 | <BR><P></P> | ||
| 734 | <DIV ALIGN="CENTER"> | ||
| 735 | |||
| 736 | <P> | ||
| 737 | |||
| 738 | <P> | ||
| 739 | <DIV ALIGN="CENTER"> | ||
| 740 | <A NAME="960"></A> | ||
| 741 | <TABLE CELLPADDING=3 BORDER="1"> | ||
| 742 | <CAPTION><STRONG>Table 3:</STRONG> | ||
| 743 | headers_log</CAPTION> | ||
| 744 | <TR><TD ALIGN="LEFT">id</TD> | ||
| 745 | <TD ALIGN="LEFT">item</TD> | ||
| 746 | <TD ALIGN="LEFT">val</TD> | ||
| 747 | </TR> | ||
| 748 | <TR><TD ALIGN="LEFT">PPIDskBRH30AAGPtAsg</TD> | ||
| 749 | <TD ALIGN="LEFT">Content-Type</TD> | ||
| 750 | <TD ALIGN="LEFT">text/html</TD> | ||
| 751 | </TR> | ||
| 752 | <TR><TD ALIGN="LEFT">PPIDskBRH30AAGPtAsg</TD> | ||
| 753 | <TD ALIGN="LEFT">Accept-Encoding</TD> | ||
| 754 | <TD ALIGN="LEFT">gzip, deflate</TD> | ||
| 755 | </TR> | ||
| 756 | <TR><TD ALIGN="LEFT">PPIDskBRH30AAGPtAsg</TD> | ||
| 757 | <TD ALIGN="LEFT">Expires</TD> | ||
| 758 | <TD ALIGN="LEFT">Tue, 28 May 2002 10:00:18 GMT</TD> | ||
| 759 | </TR> | ||
| 760 | <TR><TD ALIGN="LEFT">PPIDskBRH30AAGPtAsg</TD> | ||
| 761 | <TD ALIGN="LEFT">Cache-Control</TD> | ||
| 762 | <TD ALIGN="LEFT">max-age=86400</TD> | ||
| 763 | </TR> | ||
| 764 | </TABLE> | ||
| 765 | </DIV> | ||
| 766 | </DIV> | ||
| 767 | <BR> | ||
| 768 | |||
| 769 | <P> | ||
| 770 | We have a certain request, and its unique ID is ``PPIDskBRH30AAGPtAsg''. | ||
| 771 | Within each separate table will be multiple entries with that request | ||
| 772 | ID: several cookie entries, several header entries, etc. As you can | ||
| 773 | see in tables <A HREF="#tblAcc">1</A>, <A HREF="#tblNotes">2</A> and <A HREF="#tblHdr">3</A>, you | ||
| 774 | have a one-to-many relationship for request PPIDskBRH30AAGPtAsg: that | ||
| 775 | one access has two associated notes and four associated headers. You | ||
| 776 | can extract this data easily using the power of SQL's ``select'' | ||
| 777 | statement and table joins. To see the notes associated with a particular | ||
| 778 | request: | ||
| 779 | |||
| 780 | <P> | ||
| 781 | |||
| 782 | <DL COMPACT> | ||
| 783 | <DT> | ||
| 784 | <DD>select a.remote_host, a.request_uri, n.item, n.val from access_log a, notes_log n | ||
| 785 | |||
| 786 | <P> | ||
| 787 | where a.id=n.id and a.id='PPIDskBRH30AAGPtAsg'; | ||
| 788 | |||
| 789 | <P> | ||
| 790 | </DD> | ||
| 791 | </DL> | ||
| 792 | <DIV ALIGN="CENTER"> | ||
| 793 | <TABLE CELLPADDING=3 BORDER="1"> | ||
| 794 | <TR><TD ALIGN="LEFT">remote_host</TD> | ||
| 795 | <TD ALIGN="LEFT">request_uri</TD> | ||
| 796 | <TD ALIGN="LEFT">item</TD> | ||
| 797 | <TD ALIGN="LEFT">val</TD> | ||
| 798 | </TR> | ||
| 799 | <TR><TD ALIGN="LEFT">zerberus.aiacs.net</TD> | ||
| 800 | <TD ALIGN="LEFT">/mod_log_sql/index.html</TD> | ||
| 801 | <TD ALIGN="LEFT">mod_gzip_result</TD> | ||
| 802 | <TD ALIGN="LEFT">OK</TD> | ||
| 803 | </TR> | ||
| 804 | <TR><TD ALIGN="LEFT">zerberus.aiacs.net</TD> | ||
| 805 | <TD ALIGN="LEFT">/mod_log_sql/index.html</TD> | ||
| 806 | <TD ALIGN="LEFT">mod_gzip_compression_ratio</TD> | ||
| 807 | <TD ALIGN="LEFT">69</TD> | ||
| 808 | </TR> | ||
| 809 | </TABLE> | ||
| 810 | </DIV> | ||
| 811 | |||
| 812 | <P> | ||
| 813 | |||
| 814 | <DL COMPACT> | ||
| 815 | <DT> | ||
| 816 | <DD><P> | ||
| 817 | </DD> | ||
| 818 | </DL>Naturally you can craft similar statements for the outboud headers, | ||
| 819 | inbound headers and cookies, all of which can live in separate tables. | ||
| 820 | Your statements are limited in power only by your skill with SQL. | ||
| 821 | |||
| 822 | <P> | ||
| 823 | In order to use this capability of mod_log_sql, you must do several | ||
| 824 | things: | ||
| 825 | |||
| 826 | <P> | ||
| 827 | |||
| 828 | <UL> | ||
| 829 | <LI>Compile mod_unique_id into Apache (statically or as a DSO). mod_log_sql | ||
| 830 | employs the unique request ID that mod_unique_id provides in order | ||
| 831 | to key between the separate tables. You can still log the data without | ||
| 832 | mod_unqiue_id, but it will be completely uncorrelated and you will | ||
| 833 | have no way to discern any meaning. | ||
| 834 | </LI> | ||
| 835 | <LI>Create the appropriate tables. This will be done for you if you permit | ||
| 836 | mod_log_sql to create its own tables using L<SMALL>OG</SMALL>SQLC<SMALL>REATE</SMALL>T<SMALL>ABLES | ||
| 837 | </SMALL>O<SMALL>N</SMALL>, or if you use the enclosed ``create_tables.sql'' script. | ||
| 838 | </LI> | ||
| 839 | <LI>Create a SQL index on the ``id'' column. Without this index, table | ||
| 840 | joins will be deathly slow. I recommend you consult the MySQL documentation | ||
| 841 | on the proper way to create a column index if you are not familiar | ||
| 842 | with this operation. | ||
| 843 | </LI> | ||
| 844 | <LI>Within each appropriate VirtualHost stanza, use the L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>* | ||
| 845 | and L<SMALL>OG</SMALL>SQL*L<SMALL>OG</SMALL>T<SMALL>ABLE</SMALL> directives to tell the module what | ||
| 846 | and where to log the data. In the following example, I have overridden | ||
| 847 | the name for the notes table whereas I have left the other table names | ||
| 848 | at their defaults. I have then specified the cookies, headers and | ||
| 849 | notes that interest me. (And as you can see, these directives do not | ||
| 850 | require me to add any characters to L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>T<SMALL>ABLE.)</SMALL> | ||
| 851 | </LI> | ||
| 852 | </UL> | ||
| 853 | |||
| 854 | <DL COMPACT> | ||
| 855 | <DT> | ||
| 856 | <DD><VirtualHost 216.231.36.128> | ||
| 857 | |||
| 858 | <P> | ||
| 859 | (snip) | ||
| 860 | |||
| 861 | <P> | ||
| 862 | LogSQLNotesLogTable notestable | ||
| 863 | |||
| 864 | <P> | ||
| 865 | LogSQLWhichCookies bluecookie redcookie greencookie | ||
| 866 | |||
| 867 | <P> | ||
| 868 | LogSQLWhichNotes mod_gzip_result mod_gzip_compression_ratio | ||
| 869 | |||
| 870 | <P> | ||
| 871 | LogSQLWhichHeadersOut Expires Content-Type Cache-Control | ||
| 872 | |||
| 873 | <P> | ||
| 874 | LogSQLWhichHeadersIn UserAgent Accept-Encoding Host | ||
| 875 | |||
| 876 | <P> | ||
| 877 | (snip) | ||
| 878 | |||
| 879 | <P> | ||
| 880 | </VirtualHost> | ||
| 881 | </DD> | ||
| 882 | </DL> | ||
| 883 | <P> | ||
| 884 | |||
| 885 | <H3><A NAME="SECTION00045300000000000000"> | ||
| 886 | 3.5.3 Using the same database for production and test</A> | ||
| 887 | </H3> | ||
| 888 | |||
| 889 | <P> | ||
| 890 | Although suboptimal, it is not uncommon to use the same backend database | ||
| 891 | for the ``production'' webservers as well as the ``test'' | ||
| 892 | webservers (budgetary constraints, rackspace limits, etc.). Furthermore, | ||
| 893 | an administrator in this situation may be unable to use L<SMALL>OG</SMALL>SQLR<SMALL>EMHOST</SMALL>I<SMALL>GNORE</SMALL> | ||
| 894 | to exclude requests from the test servers - perhaps the generated | ||
| 895 | entries are genuinely useful for analytical or QA purposes, but their | ||
| 896 | value after analysis is minimal. | ||
| 897 | |||
| 898 | <P> | ||
| 899 | It is wasteful and potentially confusing to permit this internal test | ||
| 900 | data to clutter the database, and a solution to the problem is the | ||
| 901 | proper use of the L<SMALL>OG</SMALL>SQLM<SMALL>ACHINE</SMALL>ID directive. Assume a scenario | ||
| 902 | where the production webservers have IDs like ``web01,'' ``web02,'' | ||
| 903 | and so on - and the test webservers have IDs like ``test01,'' | ||
| 904 | ``test02,'' etc. Because entries in the log database are distinguished | ||
| 905 | by their source machine, an administrator may purge unneeded test | ||
| 906 | data from the access log as follows: | ||
| 907 | |||
| 908 | <P> | ||
| 909 | |||
| 910 | <DL COMPACT> | ||
| 911 | <DT> | ||
| 912 | <DD>delete from access_log where machine_id like 'test%'; | ||
| 913 | </DD> | ||
| 914 | </DL> | ||
| 915 | <P> | ||
| 916 | |||
| 917 | <H3><A NAME="SECTION00045400000000000000"></A><A NAME="sub:DelayedIns"></A> | ||
| 918 | <BR> | ||
| 919 | 3.5.4 Optimizing for a busy database | ||
| 920 | </H3> | ||
| 921 | |||
| 922 | <P> | ||
| 923 | A busy MySQL database will have SELECT statements running concurrently | ||
| 924 | with INSERT and UPDATE statements. A long-running SELECT can in certain | ||
| 925 | circumstances block INSERTs and therefore block mod_log_sql. A workaround | ||
| 926 | is to compile mod_log_sql for ``delayed inserts,'' which are | ||
| 927 | described as follows in the MySQL documentation: | ||
| 928 | |||
| 929 | <P> | ||
| 930 | <BLOCKQUOTE> | ||
| 931 | The DELAYED option for the INSERT statement is a MySQL-specific option | ||
| 932 | that is very useful if you have clients that can't wait for the INSERT | ||
| 933 | to complete. This is a common problem when you use MySQL for logging | ||
| 934 | and you also periodically run SELECT and UPDATE statements that take | ||
| 935 | a long time to complete. DELAYED was introduced in MySQL Version 3.22.15. | ||
| 936 | It is a MySQL extension to ANSI SQL92. | ||
| 937 | </BLOCKQUOTE> | ||
| 938 | <P> | ||
| 939 | <BLOCKQUOTE>INSERT DELAYED only works with ISAM and MyISAM tables. Note that as | ||
| 940 | MyISAM tables supports concurrent SELECT and INSERT, if there is no | ||
| 941 | free blocks in the middle of the data file, you very seldom need to | ||
| 942 | use INSERT DELAYED with MyISAM. | ||
| 943 | </BLOCKQUOTE> | ||
| 944 | <P> | ||
| 945 | <BLOCKQUOTE>When you use INSERT DELAYED, the client will get an OK at once and | ||
| 946 | the row will be inserted when the table is not in use by any other | ||
| 947 | thread. | ||
| 948 | </BLOCKQUOTE> | ||
| 949 | <P> | ||
| 950 | <BLOCKQUOTE>Another major benefit of using INSERT DELAYED is that inserts from | ||
| 951 | many clients are bundled together and written in one block. This is | ||
| 952 | much faster than doing many separate inserts. | ||
| 953 | |||
| 954 | </BLOCKQUOTE> | ||
| 955 | The general disadvantages of delayed inserts are: | ||
| 956 | |||
| 957 | <P> | ||
| 958 | |||
| 959 | <OL> | ||
| 960 | <LI>The queued rows are only stored in memory until they are inserted | ||
| 961 | into the table. If mysqld dies unexpectedly, any queued rows that | ||
| 962 | weren't written to disk are lost. | ||
| 963 | </LI> | ||
| 964 | <LI>There is additional overhead for the server to handle a separate thread | ||
| 965 | for each table on which you use INSERT DELAYED. | ||
| 966 | </LI> | ||
| 967 | </OL> | ||
| 968 | <B>The MySQL documentation concludes, ``This means that you | ||
| 969 | should only use INSERT DELAYED when you are really sure you need it!'' | ||
| 970 | Furthermore, the current state of error return from a failed INSERT | ||
| 971 | DELAYED seems to be in flux, and may behave in unpredictable ways | ||
| 972 | between different MySQL versions. See section <A HREF="node5.html#sub:DelayedInsFAQ">4.3.4</A> | ||
| 973 | in the FAQ - you have been warned.</B> | ||
| 974 | |||
| 975 | <P> | ||
| 976 | If you are experiencing issues which could be solved by delayed inserts, | ||
| 977 | uncomment the #MYSQLDELAYED line in the Makefile by removing the | ||
| 978 | # that is in front of it. Recompile and reinstall your module. All | ||
| 979 | regular INSERT statements are now INSERT DELAYED, and you should see | ||
| 980 | no more blocking of the module. | ||
| 981 | |||
| 982 | <P> | ||
| 983 | |||
| 984 | <H2><A NAME="SECTION00046000000000000000"></A><A NAME="sec:ConfRef"></A> | ||
| 985 | <BR> | ||
| 986 | 3.6 Configuration directive reference | ||
| 987 | </H2> | ||
| 988 | |||
| 989 | <P> | ||
| 990 | It is imperative that you understand which directives are used <I>only | ||
| 991 | once</I> in the main server config, and which are used inside VirtualHost | ||
| 992 | stanzas and therefore multiple times within httpd.conf. The ``context'' | ||
| 993 | listed with each entry informs you of this. | ||
| 994 | |||
| 995 | <P> | ||
| 996 | |||
| 997 | <H3><A NAME="SECTION00046100000000000000"> | ||
| 998 | 3.6.1 LogSQLCookieLogTable</A> | ||
| 999 | </H3> | ||
| 1000 | |||
| 1001 | <P> | ||
| 1002 | |||
| 1003 | <DL COMPACT> | ||
| 1004 | <DT> | ||
| 1005 | <DD>Syntax: LogSQLCookieLogTable table-name | ||
| 1006 | |||
| 1007 | <P> | ||
| 1008 | Example: LogSQLCookieLogTable cookie_log | ||
| 1009 | |||
| 1010 | <P> | ||
| 1011 | Default: cookies | ||
| 1012 | |||
| 1013 | <P> | ||
| 1014 | Context: virtual host | ||
| 1015 | </DD> | ||
| 1016 | </DL>Defines which table is used for logging of cookies. Working in conjunction | ||
| 1017 | with L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>C<SMALL>OOKIES</SMALL>, you can log many of each request's | ||
| 1018 | associated cookies to a separate table. For meaningful data retrieval | ||
| 1019 | the cookie table is keyed to the access table by the unique request | ||
| 1020 | ID supplied by the standard Apache module mod_unique_id. | ||
| 1021 | |||
| 1022 | <P> | ||
| 1023 | Note that you must create the table (see create-tables.sql, included | ||
| 1024 | in the package), or L<SMALL>OG</SMALL>SQLC<SMALL>REATE</SMALL>T<SMALL>ABLES</SMALL> must be set to ``on''. | ||
| 1025 | |||
| 1026 | <P> | ||
| 1027 | |||
| 1028 | <H3><A NAME="SECTION00046200000000000000"> | ||
| 1029 | 3.6.2 LogSQLCreateTables</A> | ||
| 1030 | </H3> | ||
| 1031 | |||
| 1032 | <P> | ||
| 1033 | |||
| 1034 | <DL COMPACT> | ||
| 1035 | <DT> | ||
| 1036 | <DD>Syntax: LogSQLCreateTables flag | ||
| 1037 | |||
| 1038 | <P> | ||
| 1039 | Example: LogSQLCreateTables On | ||
| 1040 | |||
| 1041 | <P> | ||
| 1042 | Default: Off | ||
| 1043 | |||
| 1044 | <P> | ||
| 1045 | Context: main server config | ||
| 1046 | </DD> | ||
| 1047 | </DL>mod_log_sql has the ability to create its tables on-the-fly. The | ||
| 1048 | advantage to this is convenience: you don't have to execute any SQL | ||
| 1049 | by hand to prepare the table. This is especially helpful for people | ||
| 1050 | with lots of virtual hosts (who should also see the L<SMALL>OG</SMALL>SQLM<SMALL>ASS</SMALL>V<SMALL>IRTUAL</SMALL>H<SMALL>OSTING</SMALL> | ||
| 1051 | directive). | ||
| 1052 | |||
| 1053 | <P> | ||
| 1054 | There is a slight disadvantage: if you wish to activate this feature, | ||
| 1055 | then the userid specified in L<SMALL>OG</SMALL>SQLL<SMALL>OGIN</SMALL>I<SMALL>NFO</SMALL> must have CREATE | ||
| 1056 | privileges on the database. In an absolutely paranoid, locked-down | ||
| 1057 | situation you may only want to grant your mod_log_sql user INSERT | ||
| 1058 | privileges on the database; in that situation you are unable to take | ||
| 1059 | advantage of L<SMALL>OG</SMALL>SQLC<SMALL>REATE</SMALL>T<SMALL>ABLES</SMALL>. But most people - even | ||
| 1060 | the very security-conscious - will find that granting CREATE on the | ||
| 1061 | logging database is reasonable. | ||
| 1062 | |||
| 1063 | <P> | ||
| 1064 | This is defined only once in the httpd.conf file. | ||
| 1065 | |||
| 1066 | <P> | ||
| 1067 | |||
| 1068 | <H3><A NAME="SECTION00046300000000000000"> | ||
| 1069 | 3.6.3 LogSQLDatabase </A> | ||
| 1070 | </H3> | ||
| 1071 | |||
| 1072 | <P> | ||
| 1073 | |||
| 1074 | <DL COMPACT> | ||
| 1075 | <DT> | ||
| 1076 | <DD><B>MANDATORY</B> | ||
| 1077 | |||
| 1078 | <P> | ||
| 1079 | Syntax: LogSQLDatabase database | ||
| 1080 | |||
| 1081 | <P> | ||
| 1082 | Example: LogSQLDatabase loggingdb | ||
| 1083 | |||
| 1084 | <P> | ||
| 1085 | Context: main server config | ||
| 1086 | </DD> | ||
| 1087 | </DL>Defines the database that is used for logging. ``database'' must | ||
| 1088 | be a valid db on the MySQL host defined in L<SMALL>OG</SMALL>SQLL<SMALL>OGIN</SMALL>I<SMALL>NFO</SMALL>. | ||
| 1089 | |||
| 1090 | <P> | ||
| 1091 | This is defined only once in the httpd.conf file. | ||
| 1092 | |||
| 1093 | <P> | ||
| 1094 | |||
| 1095 | <H3><A NAME="SECTION00046400000000000000"> | ||
| 1096 | 3.6.4 LogSQLForcePreserve</A> | ||
| 1097 | </H3> | ||
| 1098 | |||
| 1099 | <P> | ||
| 1100 | |||
| 1101 | <DL COMPACT> | ||
| 1102 | <DT> | ||
| 1103 | <DD>Syntax: LogSQLForcePreserve Flag | ||
| 1104 | |||
| 1105 | <P> | ||
| 1106 | Example: LogSQLPreserveFile on | ||
| 1107 | |||
| 1108 | <P> | ||
| 1109 | Default: off | ||
| 1110 | |||
| 1111 | <P> | ||
| 1112 | Context: main server config | ||
| 1113 | </DD> | ||
| 1114 | </DL>You may need to perform debugging on your database and specifically | ||
| 1115 | want mod_log_sql to make no attempts to log to it. This directive | ||
| 1116 | instructs the module to send all its log entries directly to the preserve | ||
| 1117 | file and to make no database INSERT attempts. | ||
| 1118 | |||
| 1119 | <P> | ||
| 1120 | This is presumably a directive for temporary use only; it could be | ||
| 1121 | dangerous if you set it and forget it, as all your entries will simply | ||
| 1122 | pile up in the preserve file. | ||
| 1123 | |||
| 1124 | <P> | ||
| 1125 | This is defined only once in the httpd.conf file. | ||
| 1126 | |||
| 1127 | <P> | ||
| 1128 | |||
| 1129 | <H3><A NAME="SECTION00046500000000000000"> | ||
| 1130 | 3.6.5 LogSQLHeadersInLogTable</A> | ||
| 1131 | </H3> | ||
| 1132 | |||
| 1133 | <P> | ||
| 1134 | |||
| 1135 | <DL COMPACT> | ||
| 1136 | <DT> | ||
| 1137 | <DD>Syntax: LogSQLHeadersInLogTable table-name | ||
| 1138 | |||
| 1139 | <P> | ||
| 1140 | Example: LogSQLHeadersInLogTable headers | ||
| 1141 | |||
| 1142 | <P> | ||
| 1143 | Default: headers_in | ||
| 1144 | |||
| 1145 | <P> | ||
| 1146 | Context: virtual host | ||
| 1147 | </DD> | ||
| 1148 | </DL>Defines which table is used for logging of inbound headers. Working | ||
| 1149 | in conjunction with L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>H<SMALL>EADERS</SMALL>I<SMALL>N</SMALL>, you can log many | ||
| 1150 | of each request's associated headers to a separate table. For meaningful | ||
| 1151 | data retrieval the headers table is keyed to the access table by the | ||
| 1152 | unique request ID supplied by the standard Apache module mod_unique_id. | ||
| 1153 | |||
| 1154 | <P> | ||
| 1155 | Note that you must create the table (see create-tables.sql, included | ||
| 1156 | in the package), or L<SMALL>OG</SMALL>SQLC<SMALL>REATE</SMALL>T<SMALL>ABLES</SMALL> must be set to ``on''. | ||
| 1157 | |||
| 1158 | <P> | ||
| 1159 | |||
| 1160 | <H3><A NAME="SECTION00046600000000000000"> | ||
| 1161 | 3.6.6 LogSQLHeadersOutLogTable</A> | ||
| 1162 | </H3> | ||
| 1163 | |||
| 1164 | <P> | ||
| 1165 | |||
| 1166 | <DL COMPACT> | ||
| 1167 | <DT> | ||
| 1168 | <DD>Syntax: LogSQLHeadersOutLogTable table-name | ||
| 1169 | |||
| 1170 | <P> | ||
| 1171 | Example: LogSQLHeadersOutLogTable headers | ||
| 1172 | |||
| 1173 | <P> | ||
| 1174 | Default: headers_out | ||
| 1175 | |||
| 1176 | <P> | ||
| 1177 | Context: virtual host | ||
| 1178 | </DD> | ||
| 1179 | </DL>Defines which table is used for logging of outbound headers. Working | ||
| 1180 | in conjunction with L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>H<SMALL>EADERS</SMALL>O<SMALL>UT</SMALL>, you can log many | ||
| 1181 | of each request's associated headers to a separate table. For meaningful | ||
| 1182 | data retrieval the headers table is keyed to the access table by the | ||
| 1183 | unique request ID supplied by the standard Apache module mod_unique_id. | ||
| 1184 | |||
| 1185 | <P> | ||
| 1186 | Note that you must create the table (see create-tables.sql, included | ||
| 1187 | in the package), or L<SMALL>OG</SMALL>SQLC<SMALL>REATE</SMALL>T<SMALL>ABLES</SMALL> must be set to ``on''. | ||
| 1188 | |||
| 1189 | <P> | ||
| 1190 | |||
| 1191 | <H3><A NAME="SECTION00046700000000000000"> | ||
| 1192 | 3.6.7 LogSQLLoginInfo </A> | ||
| 1193 | </H3> | ||
| 1194 | |||
| 1195 | <P> | ||
| 1196 | |||
| 1197 | <DL COMPACT> | ||
| 1198 | <DT> | ||
| 1199 | <DD><B>MANDATORY</B> | ||
| 1200 | |||
| 1201 | <P> | ||
| 1202 | Syntax: LogSQLLoginInfo host user password | ||
| 1203 | |||
| 1204 | <P> | ||
| 1205 | Example: LogSQLLoginInfo foobar.baz.com logwriter passw0rd | ||
| 1206 | |||
| 1207 | <P> | ||
| 1208 | Context: main server config | ||
| 1209 | </DD> | ||
| 1210 | </DL>Defines the general parameters of the MySQL host to which you will | ||
| 1211 | be logging. ``host'' is the hostname or IP address of the MySQL | ||
| 1212 | machine, and is simply ``localhost'' if the database lives on | ||
| 1213 | the same machine as Apache. ``user'' is the MySQL userid (not | ||
| 1214 | a Unix userid!) with INSERT privileges on the table defined in L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>T<SMALL>ABLE</SMALL>. | ||
| 1215 | ``password'' is that user's password. | ||
| 1216 | |||
| 1217 | <P> | ||
| 1218 | This is defined only once in the httpd.conf file. | ||
| 1219 | |||
| 1220 | <P> | ||
| 1221 | |||
| 1222 | <H3><A NAME="SECTION00046800000000000000"> | ||
| 1223 | 3.6.8 LogSQLMachineID</A> | ||
| 1224 | </H3> | ||
| 1225 | |||
| 1226 | <P> | ||
| 1227 | |||
| 1228 | <DL COMPACT> | ||
| 1229 | <DT> | ||
| 1230 | <DD>Syntax: LogSQLMachineID somename | ||
| 1231 | |||
| 1232 | <P> | ||
| 1233 | Example: LogSQLMachineID web01 | ||
| 1234 | |||
| 1235 | <P> | ||
| 1236 | Context: main server config | ||
| 1237 | </DD> | ||
| 1238 | </DL>If you have a farm of webservers then you may wish to know which particular | ||
| 1239 | machine made each entry; this is useful for analyzing your loadbalancing | ||
| 1240 | methodology. L<SMALL>OG</SMALL>SQLM<SMALL>ACHINE</SMALL>ID permits you to distinguish each | ||
| 1241 | machine's entries if you assign each machine its own L<SMALL>OG</SMALL>SQLM<SMALL>ACHINE</SMALL>ID: | ||
| 1242 | for example, the first webserver gets ``L<SMALL>OG</SMALL>SQLM<SMALL>ACHINE</SMALL>ID | ||
| 1243 | web01,'' the second gets ``L<SMALL>OG</SMALL>SQLM<SMALL>ACHINE</SMALL>ID web02,'' | ||
| 1244 | etc. | ||
| 1245 | |||
| 1246 | <P> | ||
| 1247 | This is defined only once in the httpd.conf file. | ||
| 1248 | |||
| 1249 | <P> | ||
| 1250 | |||
| 1251 | <H3><A NAME="SECTION00046900000000000000"> | ||
| 1252 | 3.6.9 LogSQLMassVirtualHosting</A> | ||
| 1253 | </H3> | ||
| 1254 | |||
| 1255 | <P> | ||
| 1256 | |||
| 1257 | <DL COMPACT> | ||
| 1258 | <DT> | ||
| 1259 | <DD>Syntax: LogSQLMassVirtualHosting flag | ||
| 1260 | |||
| 1261 | <P> | ||
| 1262 | Example: LogSQLMassVirtualHosting On | ||
| 1263 | |||
| 1264 | <P> | ||
| 1265 | Default: Off | ||
| 1266 | |||
| 1267 | <P> | ||
| 1268 | Context: main server config | ||
| 1269 | </DD> | ||
| 1270 | </DL>If you administer a site hosting many, many virtual hosts then this | ||
| 1271 | option will appeal to you. If you turn on L<SMALL>OG</SMALL>SQLM<SMALL>ASS</SMALL>V<SMALL>IRTUAL</SMALL>H<SMALL>OSTING</SMALL> | ||
| 1272 | then several things happen: | ||
| 1273 | |||
| 1274 | <P> | ||
| 1275 | |||
| 1276 | <UL> | ||
| 1277 | <LI>the on-the-fly table creation feature is activated automatically | ||
| 1278 | </LI> | ||
| 1279 | <LI>the transfer log table name is dynamically set from the virtual host's | ||
| 1280 | name after stripping out SQL-unfriendly characters (example: a virtual | ||
| 1281 | host www.grubbybaby.com gets logged to table access_www_grubbybaby_com) | ||
| 1282 | </LI> | ||
| 1283 | <LI>which, in turn, means that each virtual host logs to its own segregated | ||
| 1284 | table. Because there is no data shared between virtual servers you | ||
| 1285 | can grant your users access to the tables they need; they will be | ||
| 1286 | unable to view others' data. | ||
| 1287 | </LI> | ||
| 1288 | </UL> | ||
| 1289 | This is a huge boost in convenience for sites with many virtual servers. | ||
| 1290 | Activating L<SMALL>OG</SMALL>SQLM<SMALL>ASS</SMALL>V<SMALL>IRTUAL</SMALL>H<SMALL>OSTING</SMALL> obviates the need to | ||
| 1291 | create every virtual server's table and provides more granular security | ||
| 1292 | possibilities. | ||
| 1293 | |||
| 1294 | <P> | ||
| 1295 | You are advised to investigate the use of Apache's U<SMALL>SE</SMALL>C<SMALL>ANONICAL</SMALL>N<SMALL>AME | ||
| 1296 | </SMALL>O<SMALL>N</SMALL> directive with this directive in order to ensure that each virtual | ||
| 1297 | host maps to one table namespace. | ||
| 1298 | |||
| 1299 | <P> | ||
| 1300 | This is defined only once in the httpd.conf file. | ||
| 1301 | |||
| 1302 | <P> | ||
| 1303 | |||
| 1304 | <H3><A NAME="SECTION000461000000000000000"> | ||
| 1305 | 3.6.10 LogSQLNotesLogTable</A> | ||
| 1306 | </H3> | ||
| 1307 | |||
| 1308 | <P> | ||
| 1309 | |||
| 1310 | <DL COMPACT> | ||
| 1311 | <DT> | ||
| 1312 | <DD>Syntax: LogSQLNotesLogTable table-name | ||
| 1313 | |||
| 1314 | <P> | ||
| 1315 | Example: LogSQLNotesLogTable notes_log | ||
| 1316 | |||
| 1317 | <P> | ||
| 1318 | Default: notes | ||
| 1319 | |||
| 1320 | <P> | ||
| 1321 | Context: virtual host | ||
| 1322 | </DD> | ||
| 1323 | </DL>Defines which table is used for logging of notes. Working in conjunction | ||
| 1324 | with L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>N<SMALL>OTES</SMALL>, you can log many of each request's | ||
| 1325 | associated notes to a separate table. For meaningful data retrieval | ||
| 1326 | the notes table is keyed to the access table by the unique request | ||
| 1327 | ID supplied by the standard Apache module mod_unique_id. | ||
| 1328 | |||
| 1329 | <P> | ||
| 1330 | Note that you must create the table (see create-tables.sql, included | ||
| 1331 | in the package), or L<SMALL>OG</SMALL>SQLC<SMALL>REATE</SMALL>T<SMALL>ABLES</SMALL> must be set to ``on''. | ||
| 1332 | |||
| 1333 | <P> | ||
| 1334 | |||
| 1335 | <H3><A NAME="SECTION000461100000000000000"> | ||
| 1336 | 3.6.11 LogSQLPreserveFile</A> | ||
| 1337 | </H3> | ||
| 1338 | |||
| 1339 | <P> | ||
| 1340 | |||
| 1341 | <DL COMPACT> | ||
| 1342 | <DT> | ||
| 1343 | <DD>Syntax: LogSQLPreserveFile filename | ||
| 1344 | |||
| 1345 | <P> | ||
| 1346 | Example: LogSQLPreserveFile offline-preserve | ||
| 1347 | |||
| 1348 | <P> | ||
| 1349 | Default: /tmp/sql-preserve | ||
| 1350 | |||
| 1351 | <P> | ||
| 1352 | Context: virtual host | ||
| 1353 | </DD> | ||
| 1354 | </DL>mod_log_sql writes queries to this local preserve file in the event | ||
| 1355 | that it cannot reach the database, and thus ensures that your high-availability | ||
| 1356 | web frontend does not lose logs during a temporary database outage. | ||
| 1357 | This could happen for a number of reasons: the database goes offline, | ||
| 1358 | the network breaks, etc. You will not lose entries since the module | ||
| 1359 | has this backup. The file consists of a series of SQL statements that | ||
| 1360 | can be imported into your database at your convenience; furthermore, | ||
| 1361 | because the SQL queries contain the access timestamps you do not need | ||
| 1362 | to worry about out-of-order data after the import, which is done in | ||
| 1363 | a simple manner: | ||
| 1364 | |||
| 1365 | <P> | ||
| 1366 | |||
| 1367 | <DL COMPACT> | ||
| 1368 | <DT> | ||
| 1369 | <DD># mysql -uadminuser -p mydbname < /tmp/sql-preserve | ||
| 1370 | </DD> | ||
| 1371 | </DL>If you do not define L<SMALL>OG</SMALL>SQLP<SMALL>RESERVE</SMALL>F<SMALL>ILE</SMALL> then all virtual | ||
| 1372 | servers will log to the same default preserve file (/tmp/sql-preserve). | ||
| 1373 | You can redefine this on a virtual-host basis in order to segregate | ||
| 1374 | your preserve files if you desire. Note that segregation is not usually | ||
| 1375 | necessary, as the SQL statements that are written to the preserve | ||
| 1376 | file already distinguish between different virtual hosts if you include | ||
| 1377 | the 'v' character in your L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL> directive. | ||
| 1378 | It is only necessary to segregate preserve-files by virualhost if | ||
| 1379 | you also segregate access logs by virtualhost. | ||
| 1380 | |||
| 1381 | <P> | ||
| 1382 | The module will log to Apache's E<SMALL>RROR</SMALL>L<SMALL>OG</SMALL> when it notices | ||
| 1383 | a database outage, and upon database return. You will therefore know | ||
| 1384 | when the preserve file is being used, although it is your responsibility | ||
| 1385 | to import the file. | ||
| 1386 | |||
| 1387 | <P> | ||
| 1388 | The file does not need to be created in advance. It is safe to remove | ||
| 1389 | or rename the file without interrupting Apache, as the module closes | ||
| 1390 | the filehandle immediately after completing the write. The file is | ||
| 1391 | created with the user & group ID of the running Apache process (e.g. | ||
| 1392 | 'nobody' on many Linux distributions). | ||
| 1393 | |||
| 1394 | <P> | ||
| 1395 | |||
| 1396 | <H3><A NAME="SECTION000461200000000000000"> | ||
| 1397 | 3.6.12 LogSQLRemhostIgnore</A> | ||
| 1398 | </H3> | ||
| 1399 | |||
| 1400 | <P> | ||
| 1401 | |||
| 1402 | <DL COMPACT> | ||
| 1403 | <DT> | ||
| 1404 | <DD>Syntax: LogSQLRemhostIgnore host1 host2 host3 ... hostN | ||
| 1405 | |||
| 1406 | <P> | ||
| 1407 | Example: LogSQLRemhostIgnore localnet.com | ||
| 1408 | |||
| 1409 | <P> | ||
| 1410 | Context: virtual host | ||
| 1411 | </DD> | ||
| 1412 | </DL>Lists a series of strings that, if present in the REMOTE_HOST, will | ||
| 1413 | cause that request to <B>not</B> be logged. This directive is useful | ||
| 1414 | for cutting down on log clutter when you are certain that you want | ||
| 1415 | to ignore requests from certain hosts, such as your own internal network | ||
| 1416 | machines. See section <A HREF="node4.html#sub:Ignore">3.4.2</A> for some tips for using this | ||
| 1417 | directive. | ||
| 1418 | |||
| 1419 | <P> | ||
| 1420 | Each string is separated by a space, and no regular expressions or | ||
| 1421 | globbing are allowed. Each string is evaluated as a substring of the | ||
| 1422 | REMOTE_HOST using strstr(). The comparison is case sensitive. | ||
| 1423 | |||
| 1424 | <P> | ||
| 1425 | |||
| 1426 | <H3><A NAME="SECTION000461300000000000000"> | ||
| 1427 | 3.6.13 LogSQLRequestAccept</A> | ||
| 1428 | </H3> | ||
| 1429 | |||
| 1430 | <P> | ||
| 1431 | |||
| 1432 | <DL COMPACT> | ||
| 1433 | <DT> | ||
| 1434 | <DD>Syntax: LogSQLRequestAccept req1 req2 req3 ... reqN | ||
| 1435 | |||
| 1436 | <P> | ||
| 1437 | Example: LogSQLRequestAccept .html .php .jpg | ||
| 1438 | |||
| 1439 | <P> | ||
| 1440 | Default: if not specified, all requests are ``accepted'' | ||
| 1441 | |||
| 1442 | <P> | ||
| 1443 | Context: virtual host | ||
| 1444 | </DD> | ||
| 1445 | </DL>Lists a series of strings that, if present in the URI, will permit | ||
| 1446 | that request to be considered for logging (depending on additional | ||
| 1447 | filtering by the ``ignore'' directives). Any request that fails | ||
| 1448 | to match one of the L<SMALL>OG</SMALL>SQLR<SMALL>EQUEST</SMALL>A<SMALL>CCEPT</SMALL> entries will be discarded. | ||
| 1449 | |||
| 1450 | <P> | ||
| 1451 | This directive is useful for cutting down on log clutter when you | ||
| 1452 | are certain that you only want to log certain kinds of requests, and | ||
| 1453 | just blanket-ignore everything else. See section <A HREF="node4.html#sub:Ignore">3.4.2</A> | ||
| 1454 | for some tips for using this directive. | ||
| 1455 | |||
| 1456 | <P> | ||
| 1457 | Each string is separated by a space, and no regular expressions or | ||
| 1458 | globbing are allowed. Each string is evaluated as a substring of the | ||
| 1459 | URI using strstr(). The comparison is case sensitive. | ||
| 1460 | |||
| 1461 | <P> | ||
| 1462 | This directive is completely optional. It is more general than L<SMALL>OG</SMALL>SQLR<SMALL>EQUEST</SMALL>I<SMALL>GNORE</SMALL> | ||
| 1463 | and is evaluated before L<SMALL>OG</SMALL>SQLR<SMALL>EQUEST</SMALL>I<SMALL>GNORE</SMALL>. If | ||
| 1464 | this directive is not used, <B>all</B> requests are accepted and | ||
| 1465 | passed on to the other filtering directives. Therefore, only use this | ||
| 1466 | directive if you have a specific reason to do so. | ||
| 1467 | |||
| 1468 | <P> | ||
| 1469 | |||
| 1470 | <H3><A NAME="SECTION000461400000000000000"> | ||
| 1471 | 3.6.14 LogSQLRequestIgnore</A> | ||
| 1472 | </H3> | ||
| 1473 | |||
| 1474 | <P> | ||
| 1475 | |||
| 1476 | <DL COMPACT> | ||
| 1477 | <DT> | ||
| 1478 | <DD>Syntax: LogSQLRequestIgnore req1 req2 req3 ... reqN | ||
| 1479 | |||
| 1480 | <P> | ||
| 1481 | Example: LogSQLRequestIgnore root.exe cmd.exe default.ida favicon.ico | ||
| 1482 | |||
| 1483 | <P> | ||
| 1484 | Context: virtual host | ||
| 1485 | </DD> | ||
| 1486 | </DL>Lists a series of strings that, if present in the URI, will cause | ||
| 1487 | that request to <B>NOT</B> be logged. This directive is | ||
| 1488 | useful for cutting down on log clutter when you are certain that you | ||
| 1489 | want to ignore requests for certain objects. See section <A HREF="node4.html#sub:Ignore">3.4.2</A> | ||
| 1490 | for some tips for using this directive. | ||
| 1491 | |||
| 1492 | <P> | ||
| 1493 | Each string is separated by a space, and no regular expressions or | ||
| 1494 | globbing are allowed. Each string is evaluated as a substring of the | ||
| 1495 | URI using strstr(). The comparison is case sensitive. | ||
| 1496 | |||
| 1497 | <P> | ||
| 1498 | |||
| 1499 | <H3><A NAME="SECTION000461500000000000000"> | ||
| 1500 | 3.6.15 LogSQLSocketFile </A> | ||
| 1501 | </H3> | ||
| 1502 | |||
| 1503 | <P> | ||
| 1504 | |||
| 1505 | <DL COMPACT> | ||
| 1506 | <DT> | ||
| 1507 | <DD>Syntax: LogSQLSocketFile filename | ||
| 1508 | |||
| 1509 | <P> | ||
| 1510 | Example: LogSQLSocketFile /tmp/mysql.sock | ||
| 1511 | |||
| 1512 | <P> | ||
| 1513 | Default: /var/lib/mysql/mysql.sock | ||
| 1514 | |||
| 1515 | <P> | ||
| 1516 | Context: main server config | ||
| 1517 | </DD> | ||
| 1518 | </DL>At Apache runtime you can specify the MySQL socket file to use. Set | ||
| 1519 | this once in your main server config to override the default value. | ||
| 1520 | This value is irrelevant if your database resides on a separate machine. | ||
| 1521 | |||
| 1522 | <P> | ||
| 1523 | mod_log_sql will automatically employ the socket for db communications | ||
| 1524 | if the database resides on the local host. If the db resides on a | ||
| 1525 | separate host the module will automatically use TCP/IP. This is a | ||
| 1526 | function of the MySQL API and is not user-configurable. | ||
| 1527 | |||
| 1528 | <P> | ||
| 1529 | This is defined only once in the httpd.conf file. | ||
| 1530 | |||
| 1531 | <P> | ||
| 1532 | |||
| 1533 | <H3><A NAME="SECTION000461600000000000000"> | ||
| 1534 | 3.6.16 LogSQLTCPPort</A> | ||
| 1535 | </H3> | ||
| 1536 | |||
| 1537 | <P> | ||
| 1538 | |||
| 1539 | <DL COMPACT> | ||
| 1540 | <DT> | ||
| 1541 | <DD>Syntax: LogSQLTCPPort portnumber | ||
| 1542 | |||
| 1543 | <P> | ||
| 1544 | Example: LogSQLTCPPort 3309 | ||
| 1545 | |||
| 1546 | <P> | ||
| 1547 | Default: 3306 | ||
| 1548 | |||
| 1549 | <P> | ||
| 1550 | Context: main server config | ||
| 1551 | </DD> | ||
| 1552 | </DL>Your database may listen on a different port than the default. If | ||
| 1553 | so, use this directive to instruct the module which port to use. This | ||
| 1554 | directive only applies if the database is on a different machine connected | ||
| 1555 | via TCP/IP. | ||
| 1556 | |||
| 1557 | <P> | ||
| 1558 | This is defined only once in the httpd.conf file. | ||
| 1559 | |||
| 1560 | <P> | ||
| 1561 | |||
| 1562 | <H3><A NAME="SECTION000461700000000000000"></A><A NAME="sub:Frmat"></A> | ||
| 1563 | <BR> | ||
| 1564 | 3.6.17 LogSQLTransferLogFormat | ||
| 1565 | </H3> | ||
| 1566 | |||
| 1567 | <P> | ||
| 1568 | |||
| 1569 | <DL COMPACT> | ||
| 1570 | <DT> | ||
| 1571 | <DD>Syntax: LogSQLTransferLogFormat format-string | ||
| 1572 | |||
| 1573 | <P> | ||
| 1574 | Example: LogSQLTransferLogFormat huSUTv | ||
| 1575 | |||
| 1576 | <P> | ||
| 1577 | Default: AbHhmRSsTUuv | ||
| 1578 | |||
| 1579 | <P> | ||
| 1580 | Context: virtual host | ||
| 1581 | </DD> | ||
| 1582 | </DL>Each character in the format-string defines an attribute of the request | ||
| 1583 | that you wish to log. The default logs the information required to | ||
| 1584 | create Combined Log Format logs, plus several extras. Here is the | ||
| 1585 | full list of allowable keys, which sometimes resemble their Apache | ||
| 1586 | counterparts, but do not always: | ||
| 1587 | |||
| 1588 | <P> | ||
| 1589 | <BLOCKQUOTE> | ||
| 1590 | <TABLE CELLPADDING=3 BORDER="1"> | ||
| 1591 | <TR><TD ALIGN="CENTER"> </TD> | ||
| 1592 | <TH ALIGN="LEFT"><B><FONT SIZE="-1">What is this?</FONT></B></TH> | ||
| 1593 | <TH ALIGN="LEFT"><B><FONT SIZE="-1">Data field</FONT></B></TH> | ||
| 1594 | <TH ALIGN="LEFT"><B><FONT SIZE="-1">Column type</FONT></B></TH> | ||
| 1595 | <TH ALIGN="LEFT"><B><FONT SIZE="-1">Example</FONT></B></TH> | ||
| 1596 | </TR> | ||
| 1597 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">A</FONT></TD> | ||
| 1598 | <TD ALIGN="LEFT"><FONT SIZE="-1">User agent</FONT></TD> | ||
| 1599 | <TD ALIGN="LEFT"><FONT SIZE="-1">agent</FONT></TD> | ||
| 1600 | <TD ALIGN="LEFT"><FONT SIZE="-1">varchar(255)</FONT></TD> | ||
| 1601 | <TD ALIGN="LEFT"><FONT SIZE="-1">Mozilla/4.0 (compat; MSIE 6.0; Windows)</FONT></TD> | ||
| 1602 | </TR> | ||
| 1603 | <TR><TD ALIGN="CENTER">a</TD> | ||
| 1604 | <TD ALIGN="LEFT">CGI request arguments</TD> | ||
| 1605 | <TD ALIGN="LEFT">request_args</TD> | ||
| 1606 | <TD ALIGN="LEFT">varchar(255)</TD> | ||
| 1607 | <TD ALIGN="LEFT">user=Smith&cart=1231&item=532</TD> | ||
| 1608 | </TR> | ||
| 1609 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">b</FONT></TD> | ||
| 1610 | <TD ALIGN="LEFT"><FONT SIZE="-1">Bytes transfered</FONT></TD> | ||
| 1611 | <TD ALIGN="LEFT"><FONT SIZE="-1">bytes_sent</FONT></TD> | ||
| 1612 | <TD ALIGN="LEFT"><FONT SIZE="-1">int unsigned</FONT></TD> | ||
| 1613 | <TD ALIGN="LEFT"><FONT SIZE="-1">32561</FONT></TD> | ||
| 1614 | </TR> | ||
| 1615 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">c</FONT></TD> | ||
| 1616 | <TD ALIGN="LEFT"><FONT SIZE="-1">Text of cookie <IMG | ||
| 1617 | WIDTH="13" HEIGHT="21" ALIGN="BOTTOM" BORDER="0" | ||
| 1618 | SRC="img1.png" | ||
| 1619 | ALT="$^{\textrm{1}}$"></FONT></TD> | ||
| 1620 | <TD ALIGN="LEFT"><FONT SIZE="-1">cookie</FONT></TD> | ||
| 1621 | <TD ALIGN="LEFT"><FONT SIZE="-1">varchar(255)</FONT></TD> | ||
| 1622 | <TD ALIGN="LEFT"><FONT SIZE="-1">Apache=sdyn.fooonline.net.1300102700823</FONT></TD> | ||
| 1623 | </TR> | ||
| 1624 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">H</FONT></TD> | ||
| 1625 | <TD ALIGN="LEFT"><FONT SIZE="-1">HTTP request protocol</FONT></TD> | ||
| 1626 | <TD ALIGN="LEFT"><FONT SIZE="-1">request_protocol</FONT></TD> | ||
| 1627 | <TD ALIGN="LEFT"><FONT SIZE="-1">varchar(10)</FONT></TD> | ||
| 1628 | <TD ALIGN="LEFT"><FONT SIZE="-1">HTTP/1.1</FONT></TD> | ||
| 1629 | </TR> | ||
| 1630 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">h</FONT></TD> | ||
| 1631 | <TD ALIGN="LEFT"><FONT SIZE="-1">Name of remote host</FONT></TD> | ||
| 1632 | <TD ALIGN="LEFT"><FONT SIZE="-1">remote_host</FONT></TD> | ||
| 1633 | <TD ALIGN="LEFT"><FONT SIZE="-1">varchar(50)</FONT></TD> | ||
| 1634 | <TD ALIGN="LEFT"><FONT SIZE="-1">blah.foobar.com</FONT></TD> | ||
| 1635 | </TR> | ||
| 1636 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">I</FONT></TD> | ||
| 1637 | <TD ALIGN="LEFT"><FONT SIZE="-1">Request ID (from mod_unique_id)</FONT></TD> | ||
| 1638 | <TD ALIGN="LEFT"><FONT SIZE="-1">id</FONT></TD> | ||
| 1639 | <TD ALIGN="LEFT"><FONT SIZE="-1">char(19)</FONT></TD> | ||
| 1640 | <TD ALIGN="LEFT"><FONT SIZE="-1">POlFcUBRH30AAALdBG8</FONT></TD> | ||
| 1641 | </TR> | ||
| 1642 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">l</FONT></TD> | ||
| 1643 | <TD ALIGN="LEFT"><FONT SIZE="-1">Ident user info</FONT></TD> | ||
| 1644 | <TD ALIGN="LEFT"><FONT SIZE="-1">remote_logname</FONT></TD> | ||
| 1645 | <TD ALIGN="LEFT"><FONT SIZE="-1">varchar(50)</FONT></TD> | ||
| 1646 | <TD ALIGN="LEFT"><FONT SIZE="-1">bobby</FONT></TD> | ||
| 1647 | </TR> | ||
| 1648 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">M</FONT></TD> | ||
| 1649 | <TD ALIGN="LEFT"><FONT SIZE="-1">Machine ID <IMG | ||
| 1650 | WIDTH="13" HEIGHT="21" ALIGN="BOTTOM" BORDER="0" | ||
| 1651 | SRC="img2.png" | ||
| 1652 | ALT="$^{\textrm{2}}$"></FONT></TD> | ||
| 1653 | <TD ALIGN="LEFT"><FONT SIZE="-1">machine_id</FONT></TD> | ||
| 1654 | <TD ALIGN="LEFT"><FONT SIZE="-1">varchar(25)</FONT></TD> | ||
| 1655 | <TD ALIGN="LEFT"><FONT SIZE="-1">web01</FONT></TD> | ||
| 1656 | </TR> | ||
| 1657 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">m</FONT></TD> | ||
| 1658 | <TD ALIGN="LEFT"><FONT SIZE="-1">HTTP request method</FONT></TD> | ||
| 1659 | <TD ALIGN="LEFT"><FONT SIZE="-1">request_method</FONT></TD> | ||
| 1660 | <TD ALIGN="LEFT"><FONT SIZE="-1">varchar(6)</FONT></TD> | ||
| 1661 | <TD ALIGN="LEFT"><FONT SIZE="-1">GET</FONT></TD> | ||
| 1662 | </TR> | ||
| 1663 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">P</FONT></TD> | ||
| 1664 | <TD ALIGN="LEFT"><FONT SIZE="-1">httpd child PID</FONT></TD> | ||
| 1665 | <TD ALIGN="LEFT"><FONT SIZE="-1">child_pid</FONT></TD> | ||
| 1666 | <TD ALIGN="LEFT"><FONT SIZE="-1">smallint unsigned</FONT></TD> | ||
| 1667 | <TD ALIGN="LEFT"><FONT SIZE="-1">3215</FONT></TD> | ||
| 1668 | </TR> | ||
| 1669 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">p</FONT></TD> | ||
| 1670 | <TD ALIGN="LEFT"><FONT SIZE="-1">httpd port</FONT></TD> | ||
| 1671 | <TD ALIGN="LEFT"><FONT SIZE="-1">server_port</FONT></TD> | ||
| 1672 | <TD ALIGN="LEFT"><FONT SIZE="-1">smallint unsigned</FONT></TD> | ||
| 1673 | <TD ALIGN="LEFT"><FONT SIZE="-1">80</FONT></TD> | ||
| 1674 | </TR> | ||
| 1675 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">R</FONT></TD> | ||
| 1676 | <TD ALIGN="LEFT"><FONT SIZE="-1">Referer</FONT></TD> | ||
| 1677 | <TD ALIGN="LEFT"><FONT SIZE="-1">referer</FONT></TD> | ||
| 1678 | <TD ALIGN="LEFT"><FONT SIZE="-1">varchar(255)</FONT></TD> | ||
| 1679 | <TD ALIGN="LEFT"><FONT SIZE="-1">http://www.biglinks4u.com/linkpage.html</FONT></TD> | ||
| 1680 | </TR> | ||
| 1681 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">r</FONT></TD> | ||
| 1682 | <TD ALIGN="LEFT"><FONT SIZE="-1">Request in full form</FONT></TD> | ||
| 1683 | <TD ALIGN="LEFT"><FONT SIZE="-1">request_line</FONT></TD> | ||
| 1684 | <TD ALIGN="LEFT"><FONT SIZE="-1">varchar(255)</FONT></TD> | ||
| 1685 | <TD ALIGN="LEFT"><FONT SIZE="-1">GET /books-cycroad.html HTTP/1.1</FONT></TD> | ||
| 1686 | </TR> | ||
| 1687 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">S</FONT></TD> | ||
| 1688 | <TD ALIGN="LEFT"><FONT SIZE="-1">Time of request in UNIX format</FONT></TD> | ||
| 1689 | <TD ALIGN="LEFT"><FONT SIZE="-1">time_stamp</FONT></TD> | ||
| 1690 | <TD ALIGN="LEFT"><FONT SIZE="-1">int unsigned</FONT></TD> | ||
| 1691 | <TD ALIGN="LEFT"><FONT SIZE="-1">1005598029</FONT></TD> | ||
| 1692 | </TR> | ||
| 1693 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">s</FONT></TD> | ||
| 1694 | <TD ALIGN="LEFT"><FONT SIZE="-1">HTTP status of request</FONT></TD> | ||
| 1695 | <TD ALIGN="LEFT"><FONT SIZE="-1">status</FONT></TD> | ||
| 1696 | <TD ALIGN="LEFT"><FONT SIZE="-1">smallint unsigned</FONT></TD> | ||
| 1697 | <TD ALIGN="LEFT"><FONT SIZE="-1">404</FONT></TD> | ||
| 1698 | </TR> | ||
| 1699 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">T</FONT></TD> | ||
| 1700 | <TD ALIGN="LEFT"><FONT SIZE="-1">Seconds to service request</FONT></TD> | ||
| 1701 | <TD ALIGN="LEFT"><FONT SIZE="-1">request_duration</FONT></TD> | ||
| 1702 | <TD ALIGN="LEFT"><FONT SIZE="-1">smallint unsigned</FONT></TD> | ||
| 1703 | <TD ALIGN="LEFT"><FONT SIZE="-1">2</FONT></TD> | ||
| 1704 | </TR> | ||
| 1705 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">t</FONT></TD> | ||
| 1706 | <TD ALIGN="LEFT"><FONT SIZE="-1">Time of request in human format</FONT></TD> | ||
| 1707 | <TD ALIGN="LEFT"><FONT SIZE="-1">request_time</FONT></TD> | ||
| 1708 | <TD ALIGN="LEFT"><FONT SIZE="-1">char(28)</FONT></TD> | ||
| 1709 | <TD ALIGN="LEFT"><FONT SIZE="-1">[02/Dec/2001:15:01:26 -0800]</FONT></TD> | ||
| 1710 | </TR> | ||
| 1711 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">U</FONT></TD> | ||
| 1712 | <TD ALIGN="LEFT"><FONT SIZE="-1">Request in simple form</FONT></TD> | ||
| 1713 | <TD ALIGN="LEFT"><FONT SIZE="-1">request_uri</FONT></TD> | ||
| 1714 | <TD ALIGN="LEFT"><FONT SIZE="-1">varchar(255)</FONT></TD> | ||
| 1715 | <TD ALIGN="LEFT"><FONT SIZE="-1">/books-cycroad.html</FONT></TD> | ||
| 1716 | </TR> | ||
| 1717 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">u</FONT></TD> | ||
| 1718 | <TD ALIGN="LEFT"><FONT SIZE="-1">User info from HTTP auth</FONT></TD> | ||
| 1719 | <TD ALIGN="LEFT"><FONT SIZE="-1">remote_user</FONT></TD> | ||
| 1720 | <TD ALIGN="LEFT"><FONT SIZE="-1">varchar(50)</FONT></TD> | ||
| 1721 | <TD ALIGN="LEFT"><FONT SIZE="-1">bobby</FONT></TD> | ||
| 1722 | </TR> | ||
| 1723 | <TR><TD ALIGN="CENTER"><FONT SIZE="-1">v</FONT></TD> | ||
| 1724 | <TD ALIGN="LEFT"><FONT SIZE="-1">Virtual host servicing the request</FONT></TD> | ||
| 1725 | <TD ALIGN="LEFT"><FONT SIZE="-1">virtual_host</FONT></TD> | ||
| 1726 | <TD ALIGN="LEFT"><FONT SIZE="-1">varchar(50)</FONT></TD> | ||
| 1727 | <TD ALIGN="LEFT"><FONT SIZE="-1">www.foobar.com</FONT></TD> | ||
| 1728 | </TR> | ||
| 1729 | </TABLE></BLOCKQUOTE> | ||
| 1730 | <P> | ||
| 1731 | <BLOCKQUOTE> | ||
| 1732 | </BLOCKQUOTE> | ||
| 1733 | <P> | ||
| 1734 | <BLOCKQUOTE><IMG | ||
| 1735 | WIDTH="13" HEIGHT="21" ALIGN="BOTTOM" BORDER="0" | ||
| 1736 | SRC="img1.png" | ||
| 1737 | ALT="$^{\textrm{1}}$"> You must also specify L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>C<SMALL>OOKIE</SMALL> | ||
| 1738 | for this to take effect. | ||
| 1739 | </BLOCKQUOTE> | ||
| 1740 | <P> | ||
| 1741 | <BLOCKQUOTE><IMG | ||
| 1742 | WIDTH="13" HEIGHT="21" ALIGN="BOTTOM" BORDER="0" | ||
| 1743 | SRC="img2.png" | ||
| 1744 | ALT="$^{\textrm{2}}$"> You must also specify L<SMALL>OG</SMALL>SQLM<SMALL>ACHINE</SMALL>ID for | ||
| 1745 | this to take effect. | ||
| 1746 | |||
| 1747 | </BLOCKQUOTE> | ||
| 1748 | If you have compiled mod_log_sql with SSL logging capability, you | ||
| 1749 | also can use these: | ||
| 1750 | |||
| 1751 | <P> | ||
| 1752 | <BLOCKQUOTE> | ||
| 1753 | <TABLE CELLPADDING=3 BORDER="1"> | ||
| 1754 | <TR><TD ALIGN="CENTER"> </TD> | ||
| 1755 | <TH ALIGN="LEFT"><B>What is this?</B></TH> | ||
| 1756 | <TH ALIGN="LEFT"><B>Data field</B></TH> | ||
| 1757 | <TH ALIGN="LEFT"><B>Column Type</B></TH> | ||
| 1758 | <TH ALIGN="LEFT"><B>Example</B></TH> | ||
| 1759 | </TR> | ||
| 1760 | <TR><TD ALIGN="CENTER">z</TD> | ||
| 1761 | <TD ALIGN="LEFT">SSL cipher used</TD> | ||
| 1762 | <TD ALIGN="LEFT">ssl_cipher</TD> | ||
| 1763 | <TD ALIGN="LEFT">varchar(25)</TD> | ||
| 1764 | <TD ALIGN="LEFT">RC4-MD5</TD> | ||
| 1765 | </TR> | ||
| 1766 | <TR><TD ALIGN="CENTER">q</TD> | ||
| 1767 | <TD ALIGN="LEFT">Keysize of the SSL connection</TD> | ||
| 1768 | <TD ALIGN="LEFT">ssl_keysize</TD> | ||
| 1769 | <TD ALIGN="LEFT">smallint unsigned</TD> | ||
| 1770 | <TD ALIGN="LEFT">56</TD> | ||
| 1771 | </TR> | ||
| 1772 | <TR><TD ALIGN="CENTER">Q</TD> | ||
| 1773 | <TD ALIGN="LEFT">Maximum keysize supported</TD> | ||
| 1774 | <TD ALIGN="LEFT">ssl_maxkeysize</TD> | ||
| 1775 | <TD ALIGN="LEFT">smallint unsigned</TD> | ||
| 1776 | <TD ALIGN="LEFT">128</TD> | ||
| 1777 | </TR> | ||
| 1778 | </TABLE> | ||
| 1779 | </BLOCKQUOTE> | ||
| 1780 | |||
| 1781 | <P> | ||
| 1782 | |||
| 1783 | <H3><A NAME="SECTION000461800000000000000"> | ||
| 1784 | 3.6.18 LogSQLTransferLogTable</A> | ||
| 1785 | </H3> | ||
| 1786 | |||
| 1787 | <P> | ||
| 1788 | |||
| 1789 | <DL COMPACT> | ||
| 1790 | <DT> | ||
| 1791 | <DD><B>MANDATORY (unless</B> <B>L<SMALL>OG</SMALL>SQLM<SMALL>ASS</SMALL>V<SMALL>IRTUAL</SMALL>H<SMALL>OSTING</SMALL></B> <B>is ``on'')</B> | ||
| 1792 | |||
| 1793 | <P> | ||
| 1794 | Syntax: LogSQLTransferLogTable table-name | ||
| 1795 | |||
| 1796 | <P> | ||
| 1797 | Example: LogSQLTransferLogTable access_log_table | ||
| 1798 | |||
| 1799 | <P> | ||
| 1800 | Context: virtual host | ||
| 1801 | </DD> | ||
| 1802 | </DL>Defines which table is used for logging of Apache's transfers; this | ||
| 1803 | is analogous to Apache's TransferLog directive. table-name must be | ||
| 1804 | a valid table within the database defined in L<SMALL>OG</SMALL>SQLD<SMALL>ATABASE</SMALL>. | ||
| 1805 | |||
| 1806 | <P> | ||
| 1807 | This directive is not necessary if you declare L<SMALL>OG</SMALL>SQLM<SMALL>ASS</SMALL>V<SMALL>IRTUAL</SMALL>H<SMALL>OSTING | ||
| 1808 | </SMALL>O<SMALL>N</SMALL>, since that directive activates dynamically-named tables. If you | ||
| 1809 | attempt to use L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>T<SMALL>ABLE</SMALL> at the same time a | ||
| 1810 | warning will be logged and it will be ignored, since L<SMALL>OG</SMALL>SQLM<SMALL>ASS</SMALL>V<SMALL>IRTUAL</SMALL>H<SMALL>OSTING</SMALL> | ||
| 1811 | takes priority. | ||
| 1812 | |||
| 1813 | <P> | ||
| 1814 | |||
| 1815 | <H3><A NAME="SECTION000461900000000000000"> | ||
| 1816 | 3.6.19 LogSQLWhichCookie</A> | ||
| 1817 | </H3> | ||
| 1818 | |||
| 1819 | <P> | ||
| 1820 | |||
| 1821 | <DL COMPACT> | ||
| 1822 | <DT> | ||
| 1823 | <DD>Syntax: LogSQLWhichCookie cookiename | ||
| 1824 | |||
| 1825 | <P> | ||
| 1826 | Example: LogSQLWhichCookie Clicks | ||
| 1827 | |||
| 1828 | <P> | ||
| 1829 | Default: None | ||
| 1830 | |||
| 1831 | <P> | ||
| 1832 | Context: virtual host | ||
| 1833 | </DD> | ||
| 1834 | </DL>In HTTP, cookies have names to distinguish them from each other. Using | ||
| 1835 | mod_usertrack, for example, you can give your user-tracking cookies | ||
| 1836 | a name with the CookieName directive. | ||
| 1837 | |||
| 1838 | <P> | ||
| 1839 | You must include a 'c' character in L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL> | ||
| 1840 | for this directive to take effect; once you specify 'c', L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>C<SMALL>OOKIE</SMALL> | ||
| 1841 | tells mod_log_sql which cookie to log. This is necessary because | ||
| 1842 | you will usually be setting and receiving more than one cookie from | ||
| 1843 | a client; this cookie designates which one to log. | ||
| 1844 | |||
| 1845 | <P> | ||
| 1846 | Note: although this was intended for people who are using mod_usertrack | ||
| 1847 | to set user-tracking cookies, you aren't restricted in any way. You | ||
| 1848 | can choose which cookie you wish to log to the database -any cookie | ||
| 1849 | at all - and it doesn't necessarily have to have anything to do with | ||
| 1850 | mod_usertrack. | ||
| 1851 | |||
| 1852 | <P> | ||
| 1853 | |||
| 1854 | <H3><A NAME="SECTION000462000000000000000"> | ||
| 1855 | 3.6.20 LogSQLWhichCookies</A> | ||
| 1856 | </H3> | ||
| 1857 | |||
| 1858 | <P> | ||
| 1859 | |||
| 1860 | <DL COMPACT> | ||
| 1861 | <DT> | ||
| 1862 | <DD>Syntax: LogSQLWhichCookies cookie1 cookie2 ... cookieN | ||
| 1863 | |||
| 1864 | <P> | ||
| 1865 | Example: LogSQLWhichCookies userlogin foobar foobaz | ||
| 1866 | |||
| 1867 | <P> | ||
| 1868 | Default: None | ||
| 1869 | |||
| 1870 | <P> | ||
| 1871 | Context: virtual host | ||
| 1872 | </DD> | ||
| 1873 | </DL>Defines the list of cookies you would like logged. This works in conjunction | ||
| 1874 | with L<SMALL>OG</SMALL>SQLC<SMALL>OOKIE</SMALL>L<SMALL>OG</SMALL>T<SMALL>ABLE</SMALL>. This directive does not require | ||
| 1875 | any additional characters to be added to the L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL> | ||
| 1876 | string. The feature is activated simply by including this directive, | ||
| 1877 | upon which you will begin populating the separate cookie table with | ||
| 1878 | data. | ||
| 1879 | |||
| 1880 | <P> | ||
| 1881 | Note that you must have already created the table (see create-tables.sql, | ||
| 1882 | included in the package), or L<SMALL>OG</SMALL>SQLC<SMALL>REATE</SMALL>T<SMALL>ABLES</SMALL> must be set | ||
| 1883 | to ``on''. | ||
| 1884 | |||
| 1885 | <P> | ||
| 1886 | |||
| 1887 | <H3><A NAME="SECTION000462100000000000000"> | ||
| 1888 | 3.6.21 LogSQLWhichHeadersIn</A> | ||
| 1889 | </H3> | ||
| 1890 | |||
| 1891 | <P> | ||
| 1892 | |||
| 1893 | <DL COMPACT> | ||
| 1894 | <DT> | ||
| 1895 | <DD>Syntax: LogSQLWhichHeadersIn item1 item2 ... itemN | ||
| 1896 | |||
| 1897 | <P> | ||
| 1898 | Example: LogSQLWhichHeadersIn UserAgent Accept-Encoding Host | ||
| 1899 | |||
| 1900 | <P> | ||
| 1901 | Default: None | ||
| 1902 | |||
| 1903 | <P> | ||
| 1904 | Context: virtual host | ||
| 1905 | </DD> | ||
| 1906 | </DL>Defines the list of inbound headers you would like logged. This works | ||
| 1907 | in conjunction with L<SMALL>OG</SMALL>SQLH<SMALL>EADERS</SMALL>I<SMALL>N</SMALL>L<SMALL>OG</SMALL>T<SMALL>ABLE</SMALL>. This directive | ||
| 1908 | does not require any additional characters to be added to the L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL> | ||
| 1909 | string. The feature is activated simply by including this directive, | ||
| 1910 | upon which you will begin populating the separate inbound-headers | ||
| 1911 | table with data. | ||
| 1912 | |||
| 1913 | <P> | ||
| 1914 | Note that you must have already created the table (see create-tables.sql, | ||
| 1915 | included in the package), or L<SMALL>OG</SMALL>SQLC<SMALL>REATE</SMALL>T<SMALL>ABLES</SMALL> must be set | ||
| 1916 | to ``on''. | ||
| 1917 | |||
| 1918 | <P> | ||
| 1919 | |||
| 1920 | <H3><A NAME="SECTION000462200000000000000"> | ||
| 1921 | 3.6.22 LogSQLWhichHeadersOut</A> | ||
| 1922 | </H3> | ||
| 1923 | |||
| 1924 | <P> | ||
| 1925 | |||
| 1926 | <DL COMPACT> | ||
| 1927 | <DT> | ||
| 1928 | <DD>Syntax: LogSQLWhichHeadersOut item1 item2 ... itemN | ||
| 1929 | |||
| 1930 | <P> | ||
| 1931 | Example: LogSQLWhichHeadersOut Expires Content-Type Cache-Control | ||
| 1932 | |||
| 1933 | <P> | ||
| 1934 | Default: None | ||
| 1935 | |||
| 1936 | <P> | ||
| 1937 | Context: virtual host | ||
| 1938 | </DD> | ||
| 1939 | </DL>Defines the list of outbound headers you would like logged. This works | ||
| 1940 | in conjunction with L<SMALL>OG</SMALL>SQLH<SMALL>EADERS</SMALL>O<SMALL>UT</SMALL>L<SMALL>OG</SMALL>T<SMALL>ABLE</SMALL>. This directive | ||
| 1941 | does not require any additional characters to be added to the L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL> | ||
| 1942 | string. The feature is activated simply by including this directive, | ||
| 1943 | upon which you will begin populating the separate outbound-headers | ||
| 1944 | table with data. | ||
| 1945 | |||
| 1946 | <P> | ||
| 1947 | Note that you must have already created the table (see create-tables.sql, | ||
| 1948 | included in the package), or L<SMALL>OG</SMALL>SQLC<SMALL>REATE</SMALL>T<SMALL>ABLES</SMALL> must be set | ||
| 1949 | to ``on''. | ||
| 1950 | |||
| 1951 | <P> | ||
| 1952 | |||
| 1953 | <H3><A NAME="SECTION000462300000000000000"> | ||
| 1954 | 3.6.23 LogSQLWhichNotes</A> | ||
| 1955 | </H3> | ||
| 1956 | |||
| 1957 | <P> | ||
| 1958 | |||
| 1959 | <DL COMPACT> | ||
| 1960 | <DT> | ||
| 1961 | <DD>Syntax: LogSQLWhichNotes item1 item2 ... itemN | ||
| 1962 | |||
| 1963 | <P> | ||
| 1964 | Example: LogSQLWhichNotes mod_gzip_result mod_gzip_compression_ratio | ||
| 1965 | |||
| 1966 | <P> | ||
| 1967 | Default: None | ||
| 1968 | |||
| 1969 | <P> | ||
| 1970 | Context: virtual host | ||
| 1971 | </DD> | ||
| 1972 | </DL>Defines the list of notes you would like logged. This works in conjunction | ||
| 1973 | with L<SMALL>OG</SMALL>SQLN<SMALL>OTES</SMALL>L<SMALL>OG</SMALL>T<SMALL>ABLE</SMALL>. This directive does not require | ||
| 1974 | any additional characters to be added to the L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL> | ||
| 1975 | string. The feature is activated simply by including this directive, | ||
| 1976 | upon which you will begin populating the separate notes table with | ||
| 1977 | data. | ||
| 1978 | |||
| 1979 | <P> | ||
| 1980 | Note that you must have already created the table (see create-tables.sql, | ||
| 1981 | included in the package), or L<SMALL>OG</SMALL>SQLC<SMALL>REATE</SMALL>T<SMALL>ABLES</SMALL> must be set | ||
| 1982 | to ``on''. | ||
| 1983 | |||
| 1984 | <P> | ||
| 1985 | <HR> | ||
| 1986 | <!--Navigation Panel--> | ||
| 1987 | <A NAME="tex2html172" | ||
| 1988 | HREF="node5.html"> | ||
| 1989 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> | ||
| 1990 | <A NAME="tex2html168" | ||
| 1991 | HREF="documentation.html"> | ||
| 1992 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> | ||
| 1993 | <A NAME="tex2html162" | ||
| 1994 | HREF="node3.html"> | ||
| 1995 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> | ||
| 1996 | <A NAME="tex2html170" | ||
| 1997 | HREF="node1.html"> | ||
| 1998 | <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> | ||
| 1999 | <BR> | ||
| 2000 | <B> Next:</B> <A NAME="tex2html173" | ||
| 2001 | HREF="node5.html">4 FAQ</A> | ||
| 2002 | <B> Up:</B> <A NAME="tex2html169" | ||
| 2003 | HREF="documentation.html">Installing and Running mod_log_sql</A> | ||
| 2004 | <B> Previous:</B> <A NAME="tex2html163" | ||
| 2005 | HREF="node3.html">2 Installation</A> | ||
| 2006 | <B> <A NAME="tex2html171" | ||
| 2007 | HREF="node1.html">Contents</A></B> | ||
| 2008 | <!--End of Navigation Panel--> | ||
| 2009 | <ADDRESS> | ||
| 2010 | Chris Powell | ||
| 2011 | 2002-12-18 | ||
| 2012 | </ADDRESS> | ||
| 2013 | </BODY> | ||
| 2014 | </HTML> | ||
diff --git a/docs/node5.html b/docs/node5.html new file mode 100644 index 0000000..e9a593c --- /dev/null +++ b/docs/node5.html | |||
| @@ -0,0 +1,1270 @@ | |||
| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | ||
| 2 | |||
| 3 | <!--Converted with LaTeX2HTML 2002-1 (1.68) | ||
| 4 | original version by: Nikos Drakos, CBLU, University of Leeds | ||
| 5 | * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan | ||
| 6 | * with significant contributions from: | ||
| 7 | Jens Lippmann, Marek Rouchal, Martin Wilck and others --> | ||
| 8 | <HTML> | ||
| 9 | <HEAD> | ||
| 10 | <TITLE>4 FAQ</TITLE> | ||
| 11 | <META NAME="description" CONTENT="4 FAQ"> | ||
| 12 | <META NAME="keywords" CONTENT="documentation"> | ||
| 13 | <META NAME="resource-type" CONTENT="document"> | ||
| 14 | <META NAME="distribution" CONTENT="global"> | ||
| 15 | |||
| 16 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> | ||
| 17 | <META NAME="Generator" CONTENT="LaTeX2HTML v2002-1"> | ||
| 18 | <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> | ||
| 19 | |||
| 20 | <LINK REL="STYLESHEET" HREF="documentation.css"> | ||
| 21 | |||
| 22 | <LINK REL="next" HREF="node6.html"> | ||
| 23 | <LINK REL="previous" HREF="node4.html"> | ||
| 24 | <LINK REL="up" HREF="documentation.html"> | ||
| 25 | <LINK REL="next" HREF="node6.html"> | ||
| 26 | </HEAD> | ||
| 27 | |||
| 28 | <BODY > | ||
| 29 | <!--Navigation Panel--> | ||
| 30 | <A NAME="tex2html219" | ||
| 31 | HREF="node6.html"> | ||
| 32 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> | ||
| 33 | <A NAME="tex2html215" | ||
| 34 | HREF="documentation.html"> | ||
| 35 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> | ||
| 36 | <A NAME="tex2html209" | ||
| 37 | HREF="node4.html"> | ||
| 38 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> | ||
| 39 | <A NAME="tex2html217" | ||
| 40 | HREF="node1.html"> | ||
| 41 | <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> | ||
| 42 | <BR> | ||
| 43 | <B> Next:</B> <A NAME="tex2html220" | ||
| 44 | HREF="node6.html">About this document ...</A> | ||
| 45 | <B> Up:</B> <A NAME="tex2html216" | ||
| 46 | HREF="documentation.html">Installing and Running mod_log_sql</A> | ||
| 47 | <B> Previous:</B> <A NAME="tex2html210" | ||
| 48 | HREF="node4.html">3 Configuration</A> | ||
| 49 | <B> <A NAME="tex2html218" | ||
| 50 | HREF="node1.html">Contents</A></B> | ||
| 51 | <BR> | ||
| 52 | <BR> | ||
| 53 | <!--End of Navigation Panel--> | ||
| 54 | <!--Table of Child-Links--> | ||
| 55 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A> | ||
| 56 | |||
| 57 | <UL> | ||
| 58 | <LI><A NAME="tex2html221" | ||
| 59 | HREF="node5.html#SECTION00051000000000000000">4.1 General module questions</A> | ||
| 60 | <UL> | ||
| 61 | <LI><A NAME="tex2html222" | ||
| 62 | HREF="node5.html#SECTION00051100000000000000">4.1.1 Why log to an SQL database?</A> | ||
| 63 | <LI><A NAME="tex2html223" | ||
| 64 | HREF="node5.html#SECTION00051200000000000000">4.1.2 Why use MySQL? Are there alternatives?</A> | ||
| 65 | <LI><A NAME="tex2html224" | ||
| 66 | HREF="node5.html#SECTION00051300000000000000">4.1.3 Is this code production-ready?</A> | ||
| 67 | <LI><A NAME="tex2html225" | ||
| 68 | HREF="node5.html#SECTION00051400000000000000">4.1.4 Who's using mod_log_sql?</A> | ||
| 69 | <LI><A NAME="tex2html226" | ||
| 70 | HREF="node5.html#SECTION00051500000000000000">4.1.5 Why doesn't the module also replace the Apache ErrorLog?</A> | ||
| 71 | <LI><A NAME="tex2html227" | ||
| 72 | HREF="node5.html#SECTION00051600000000000000">4.1.6 Does mod_log_sql work with Apache 2.x?</A> | ||
| 73 | <LI><A NAME="tex2html228" | ||
| 74 | HREF="node5.html#SECTION00051700000000000000">4.1.7 Does mod_log_sql connect to MySQL via TCP/IP or a socket?</A> | ||
| 75 | <LI><A NAME="tex2html229" | ||
| 76 | HREF="node5.html#SECTION00051800000000000000">4.1.8 I have discovered a bug. Who can I contact?</A> | ||
| 77 | </UL> | ||
| 78 | <BR> | ||
| 79 | <LI><A NAME="tex2html230" | ||
| 80 | HREF="node5.html#SECTION00052000000000000000">4.2 Problems</A> | ||
| 81 | <UL> | ||
| 82 | <LI><A NAME="tex2html231" | ||
| 83 | HREF="node5.html#SECTION00052100000000000000">4.2.1 Apache segfaults when using PHP and mod_log_sql</A> | ||
| 84 | <LI><A NAME="tex2html232" | ||
| 85 | HREF="node5.html#SECTION00052200000000000000">4.2.2 Apache appears to start up fine, but nothing | ||
| 86 | is getting logged in the database</A> | ||
| 87 | <LI><A NAME="tex2html233" | ||
| 88 | HREF="node5.html#SECTION00052300000000000000">4.2.3 Why do I get the message ``insufficient configuration info to | ||
| 89 | establish database link'' in my Apache error log?</A> | ||
| 90 | <LI><A NAME="tex2html234" | ||
| 91 | HREF="node5.html#SECTION00052400000000000000">4.2.4 My database cannot handle all the open connections from mod_log_sql, | ||
| 92 | is there anything I can do?</A> | ||
| 93 | <LI><A NAME="tex2html235" | ||
| 94 | HREF="node5.html#SECTION00052500000000000000">4.2.5 Why do I occasionally see a ``lost connection to MySQL server'' | ||
| 95 | message in my Apache error log?</A> | ||
| 96 | </UL> | ||
| 97 | <BR> | ||
| 98 | <LI><A NAME="tex2html236" | ||
| 99 | HREF="node5.html#SECTION00053000000000000000">4.3 Performance and Tuning</A> | ||
| 100 | <UL> | ||
| 101 | <LI><A NAME="tex2html237" | ||
| 102 | HREF="node5.html#SECTION00053100000000000000">4.3.1 How well does it perform?</A> | ||
| 103 | <LI><A NAME="tex2html238" | ||
| 104 | HREF="node5.html#SECTION00053200000000000000">4.3.2 Do I need to be worried about all the running MySQL children? Will | ||
| 105 | holding open <I>n</I> Apache-to-MySQL connections consume a lot of | ||
| 106 | memory? </A> | ||
| 107 | <LI><A NAME="tex2html239" | ||
| 108 | HREF="node5.html#SECTION00053300000000000000">4.3.3 My webserver cannot handle all the traffic that my site receives, | ||
| 109 | is there anything I can do?</A> | ||
| 110 | <LI><A NAME="tex2html240" | ||
| 111 | HREF="node5.html#SECTION00053400000000000000">4.3.4 What is the issue with activating delayed | ||
| 112 | inserts?</A> | ||
| 113 | </UL> | ||
| 114 | <BR> | ||
| 115 | <LI><A NAME="tex2html241" | ||
| 116 | HREF="node5.html#SECTION00054000000000000000">4.4 ``How do I...?'' - accomplishing certain tasks</A> | ||
| 117 | <UL> | ||
| 118 | <LI><A NAME="tex2html242" | ||
| 119 | HREF="node5.html#SECTION00054100000000000000">4.4.1 I am using LogSQLMassVirtualHosting, and sometimes a single VirtualHost | ||
| 120 | gets logged to two different tables. How do I prevent that?</A> | ||
| 121 | <LI><A NAME="tex2html243" | ||
| 122 | HREF="node5.html#SECTION00054200000000000000">4.4.2 How do I extract the data in a format that my analysis tool can understand?</A> | ||
| 123 | <LI><A NAME="tex2html244" | ||
| 124 | HREF="node5.html#SECTION00054300000000000000">4.4.3 How can I log mod_usertrack cookies?</A> | ||
| 125 | <LI><A NAME="tex2html245" | ||
| 126 | HREF="node5.html#SECTION00054400000000000000">4.4.4 What if I want to log more than one cookie? What is the difference | ||
| 127 | between LogSQLWhichCookie and LogSQLWhichCookies?</A> | ||
| 128 | <LI><A NAME="tex2html246" | ||
| 129 | HREF="node5.html#SECTION00054500000000000000">4.4.5 What are the SSL logging features, and how do I activate them?</A> | ||
| 130 | </UL></UL> | ||
| 131 | <!--End of Table of Child-Links--> | ||
| 132 | <HR> | ||
| 133 | |||
| 134 | <H1><A NAME="SECTION00050000000000000000"> | ||
| 135 | 4 FAQ</A> | ||
| 136 | </H1> | ||
| 137 | |||
| 138 | <P> | ||
| 139 | |||
| 140 | <H2><A NAME="SECTION00051000000000000000"> | ||
| 141 | 4.1 General module questions</A> | ||
| 142 | </H2> | ||
| 143 | |||
| 144 | <P> | ||
| 145 | |||
| 146 | <H3><A NAME="SECTION00051100000000000000"></A><A NAME="sub:why"></A> | ||
| 147 | <BR> | ||
| 148 | 4.1.1 Why log to an SQL database? | ||
| 149 | </H3> | ||
| 150 | |||
| 151 | <P> | ||
| 152 | To begin with, let's get it out of the way: logging to a database | ||
| 153 | is not a panacea. But while there are complexities with this solution, | ||
| 154 | the benefit can be substantial for certain classes of administrator | ||
| 155 | or people with advanced requirements: | ||
| 156 | |||
| 157 | <P> | ||
| 158 | |||
| 159 | <UL> | ||
| 160 | <LI>Chores like log rotation go away, as you can DELETE records from the | ||
| 161 | SQL database once they are no longer useful. For example, the excellent | ||
| 162 | and popular log-analysis tool Webalizer (http://www.webalizer.com) | ||
| 163 | does not need historic logs after it has processed them, enabling | ||
| 164 | you to delete older logs. | ||
| 165 | </LI> | ||
| 166 | <LI>People with clusters of web servers (for high availability) will benefit | ||
| 167 | the most - all their webservers can log to a single SQL database. | ||
| 168 | This obviates the need to collate/interleave the many separate logfiles, | ||
| 169 | which can be / highly/ problematic. | ||
| 170 | </LI> | ||
| 171 | <LI>People acquainted with the power of SQL SELECT statements will know | ||
| 172 | the flexibility of the extraction possibilities at their fingertips. | ||
| 173 | </LI> | ||
| 174 | </UL> | ||
| 175 | For example, do you want to see all your 404's? Do this: | ||
| 176 | |||
| 177 | <P> | ||
| 178 | |||
| 179 | <DL COMPACT> | ||
| 180 | <DT> | ||
| 181 | <DD>select remote_host,status,request_uri,bytes_sent,from_unixtime(time_stamp) | ||
| 182 | |||
| 183 | <P> | ||
| 184 | from acc_log_tbl where status=404 order by time_stamp; | ||
| 185 | |||
| 186 | <P> | ||
| 187 | </DD> | ||
| 188 | </DL> | ||
| 189 | <DIV ALIGN="CENTER"> | ||
| 190 | <TABLE CELLPADDING=3 BORDER="1"> | ||
| 191 | <TR><TD ALIGN="LEFT">remote_host</TD> | ||
| 192 | <TD ALIGN="LEFT">status</TD> | ||
| 193 | <TD ALIGN="LEFT">request_uri</TD> | ||
| 194 | <TD ALIGN="LEFT">bytes_sent</TD> | ||
| 195 | <TD ALIGN="LEFT">from_unixtime(time_stamp)</TD> | ||
| 196 | </TR> | ||
| 197 | <TR><TD ALIGN="LEFT">marge.mmm.co.uk</TD> | ||
| 198 | <TD ALIGN="LEFT">404</TD> | ||
| 199 | <TD ALIGN="LEFT">/favicon.ico</TD> | ||
| 200 | <TD ALIGN="LEFT">321</TD> | ||
| 201 | <TD ALIGN="LEFT">2001-11-20 02:30:56</TD> | ||
| 202 | </TR> | ||
| 203 | <TR><TD ALIGN="LEFT">62.180.239.251</TD> | ||
| 204 | <TD ALIGN="LEFT">404</TD> | ||
| 205 | <TD ALIGN="LEFT">/favicon.ico</TD> | ||
| 206 | <TD ALIGN="LEFT">333</TD> | ||
| 207 | <TD ALIGN="LEFT">2001-11-20 02:45:25</TD> | ||
| 208 | </TR> | ||
| 209 | <TR><TD ALIGN="LEFT">212.234.12.66</TD> | ||
| 210 | <TD ALIGN="LEFT">404</TD> | ||
| 211 | <TD ALIGN="LEFT">/favicon.ico</TD> | ||
| 212 | <TD ALIGN="LEFT">321</TD> | ||
| 213 | <TD ALIGN="LEFT">2001-11-20 03:01:00</TD> | ||
| 214 | </TR> | ||
| 215 | <TR><TD ALIGN="LEFT">212.210.78.254</TD> | ||
| 216 | <TD ALIGN="LEFT">404</TD> | ||
| 217 | <TD ALIGN="LEFT">/favicon.ico</TD> | ||
| 218 | <TD ALIGN="LEFT">333</TD> | ||
| 219 | <TD ALIGN="LEFT">2001-11-20 03:26:05</TD> | ||
| 220 | </TR> | ||
| 221 | </TABLE> | ||
| 222 | </DIV> | ||
| 223 | |||
| 224 | <P> | ||
| 225 | |||
| 226 | <DL COMPACT> | ||
| 227 | <DT> | ||
| 228 | <DD><P> | ||
| 229 | </DD> | ||
| 230 | </DL>Or do you want to see how many bytes you've sent within a certain | ||
| 231 | directory or site? Do this: | ||
| 232 | |||
| 233 | <P> | ||
| 234 | |||
| 235 | <DL COMPACT> | ||
| 236 | <DT> | ||
| 237 | <DD>select request_uri,sum(bytes_sent) as bytes,count(request_uri) as howmany from | ||
| 238 | |||
| 239 | <P> | ||
| 240 | acc_log_tbl where request_uri like '%mod_log_sql%' group by request_uri order | ||
| 241 | |||
| 242 | <P> | ||
| 243 | by howmany desc; | ||
| 244 | |||
| 245 | <P> | ||
| 246 | </DD> | ||
| 247 | </DL> | ||
| 248 | <DIV ALIGN="CENTER"> | ||
| 249 | <TABLE CELLPADDING=3 BORDER="1"> | ||
| 250 | <TR><TD ALIGN="LEFT">request_uri</TD> | ||
| 251 | <TD ALIGN="LEFT">bytes</TD> | ||
| 252 | <TD ALIGN="LEFT">howmany</TD> | ||
| 253 | </TR> | ||
| 254 | <TR><TD ALIGN="LEFT">/mod_log_sql/style_1.css</TD> | ||
| 255 | <TD ALIGN="LEFT">157396</TD> | ||
| 256 | <TD ALIGN="LEFT">1288</TD> | ||
| 257 | </TR> | ||
| 258 | <TR><TD ALIGN="LEFT">/mod_log_sql/</TD> | ||
| 259 | <TD ALIGN="LEFT">2514337</TD> | ||
| 260 | <TD ALIGN="LEFT">801</TD> | ||
| 261 | </TR> | ||
| 262 | <TR><TD ALIGN="LEFT">/mod_log_sql/mod_log_sql.tar.gz</TD> | ||
| 263 | <TD ALIGN="LEFT">9769312</TD> | ||
| 264 | <TD ALIGN="LEFT">456</TD> | ||
| 265 | </TR> | ||
| 266 | <TR><TD ALIGN="LEFT">/mod_log_sql/faq.html</TD> | ||
| 267 | <TD ALIGN="LEFT">5038728</TD> | ||
| 268 | <TD ALIGN="LEFT">436</TD> | ||
| 269 | </TR> | ||
| 270 | </TABLE> | ||
| 271 | </DIV> | ||
| 272 | |||
| 273 | <P> | ||
| 274 | |||
| 275 | <DL COMPACT> | ||
| 276 | <DT> | ||
| 277 | <DD><P> | ||
| 278 | </DD> | ||
| 279 | </DL>Or maybe you want to see who's linking to you? Do this: | ||
| 280 | |||
| 281 | <P> | ||
| 282 | |||
| 283 | <DL COMPACT> | ||
| 284 | <DT> | ||
| 285 | <DD>select count(referer) as num,referer from acc_log_tbl where | ||
| 286 | |||
| 287 | <P> | ||
| 288 | request_uri='/mod_log_sql/' group by referer order by num desc; | ||
| 289 | |||
| 290 | <P> | ||
| 291 | </DD> | ||
| 292 | </DL> | ||
| 293 | <DIV ALIGN="CENTER"> | ||
| 294 | <TABLE CELLPADDING=3 BORDER="1"> | ||
| 295 | <TR><TD ALIGN="LEFT">num</TD> | ||
| 296 | <TD ALIGN="LEFT">referer</TD> | ||
| 297 | </TR> | ||
| 298 | <TR><TD ALIGN="LEFT">271</TD> | ||
| 299 | <TD ALIGN="LEFT">http://freshmeat.net/projects/mod_log_sql/</TD> | ||
| 300 | </TR> | ||
| 301 | <TR><TD ALIGN="LEFT">96</TD> | ||
| 302 | <TD ALIGN="LEFT">http://modules.apache.org/search?id=339</TD> | ||
| 303 | </TR> | ||
| 304 | <TR><TD ALIGN="LEFT">48</TD> | ||
| 305 | <TD ALIGN="LEFT">http://freshmeat.net/</TD> | ||
| 306 | </TR> | ||
| 307 | <TR><TD ALIGN="LEFT">8</TD> | ||
| 308 | <TD ALIGN="LEFT">http://freshmeat.net</TD> | ||
| 309 | </TR> | ||
| 310 | </TABLE> | ||
| 311 | </DIV> | ||
| 312 | |||
| 313 | <P> | ||
| 314 | |||
| 315 | <DL COMPACT> | ||
| 316 | <DT> | ||
| 317 | <DD><P> | ||
| 318 | </DD> | ||
| 319 | </DL>As you can see, there are myriad possibilities that can be constructed | ||
| 320 | with the wonderful SQL SELECT statement. Logging to an SQL database | ||
| 321 | can be really quite useful! | ||
| 322 | |||
| 323 | <P> | ||
| 324 | |||
| 325 | <H3><A NAME="SECTION00051200000000000000"> | ||
| 326 | 4.1.2 Why use MySQL? Are there alternatives?</A> | ||
| 327 | </H3> | ||
| 328 | |||
| 329 | <P> | ||
| 330 | MySQL is a robust, free, and very powerful production-quality database | ||
| 331 | engine. It is well supported and comes with detailed documentation. | ||
| 332 | Many 3rd-party software pacakges (e.g. Slashcode, the engine that | ||
| 333 | powers Slashdot) run exclusively with MySQL. In other words, you will | ||
| 334 | belong to a very robust and well-supported community by choosing MySQL. | ||
| 335 | |||
| 336 | <P> | ||
| 337 | That being said, there are alternatives. PostgreSQL is probably MySQL's | ||
| 338 | leading "competitor" in the free database world. | ||
| 339 | There is also an excellent module available for Apache to permit logging | ||
| 340 | to a PostgreSQL database, called pgLOGd (http://www.digitalstratum.com/pglogd/). | ||
| 341 | |||
| 342 | <P> | ||
| 343 | |||
| 344 | <H3><A NAME="SECTION00051300000000000000"> | ||
| 345 | 4.1.3 Is this code production-ready?</A> | ||
| 346 | </H3> | ||
| 347 | |||
| 348 | <P> | ||
| 349 | By all accounts it is. It is known to work without a problem on many-thousands-of-hits-per-day | ||
| 350 | webservers. Does that mean it is 100% bug free? Well, no software | ||
| 351 | is. But it is well-tested and believed to be fully compatible with | ||
| 352 | production environments. (The usual disclaimers apply. This software | ||
| 353 | is provided without warranty of any kind.) | ||
| 354 | |||
| 355 | <P> | ||
| 356 | |||
| 357 | <H3><A NAME="SECTION00051400000000000000"> | ||
| 358 | 4.1.4 Who's using mod_log_sql?</A> | ||
| 359 | </H3> | ||
| 360 | |||
| 361 | <P> | ||
| 362 | Good question! It would be great to find out! If you are a production-level | ||
| 363 | mod_log_sql user, please contact the maintainer, Chris Powell (chris@grubbybaby.com) | ||
| 364 | so that you can be mentioned here. | ||
| 365 | |||
| 366 | <P> | ||
| 367 | |||
| 368 | <H3><A NAME="SECTION00051500000000000000"> | ||
| 369 | 4.1.5 Why doesn't the module also replace the Apache ErrorLog?</A> | ||
| 370 | </H3> | ||
| 371 | |||
| 372 | <P> | ||
| 373 | There are circumstances when that would be quite unwise - for example, | ||
| 374 | if Apache could not reach the MySQL server for some reason and needed | ||
| 375 | to log that fact. Without a text-based error log you'd never know | ||
| 376 | anything was wrong, because Apache would be trying to log a database | ||
| 377 | connection error to the database... you get the point. | ||
| 378 | |||
| 379 | <P> | ||
| 380 | Error logs are usually not very high-traffic and are really best left | ||
| 381 | as text files on a web server machine. | ||
| 382 | |||
| 383 | <P> | ||
| 384 | |||
| 385 | <H3><A NAME="SECTION00051600000000000000"> | ||
| 386 | 4.1.6 Does mod_log_sql work with Apache 2.x?</A> | ||
| 387 | </H3> | ||
| 388 | |||
| 389 | <P> | ||
| 390 | As of this writing, no. The Apache Group significantly altered the | ||
| 391 | module API with the release of Apache 2.0. All modules written for | ||
| 392 | 1.3, including mod_log_sql, will not work with 2.0. | ||
| 393 | |||
| 394 | <P> | ||
| 395 | mod_log_sql will eventually be ported to Apache 2.x, but not immediately. | ||
| 396 | It is going to take some time, and there are other features that have | ||
| 397 | higher priority. Please sign up for the announcements list (on the | ||
| 398 | main website) or monitor the website for updates to learn when the | ||
| 399 | port (and other releases) are available. | ||
| 400 | |||
| 401 | <P> | ||
| 402 | <OPINION>If you're a *NIX user, stick with Apache 1.3.x for now. | ||
| 403 | Major modules like mod_ssl and PHP are not even ready for 2.0 yet, | ||
| 404 | and the main benefits in 2.0 are for Win32 users anyway. Apache 1.3.x | ||
| 405 | is rock-stable and performs equally well on *NIX as 2.0.</OPINION> | ||
| 406 | |||
| 407 | <P> | ||
| 408 | |||
| 409 | <H3><A NAME="SECTION00051700000000000000"> | ||
| 410 | 4.1.7 Does mod_log_sql connect to MySQL via TCP/IP or a socket?</A> | ||
| 411 | </H3> | ||
| 412 | |||
| 413 | <P> | ||
| 414 | It depends! This is not determined by mod_log_sql. mod_log_sql | ||
| 415 | relies on a connection command that is supplied in the MySQL API, | ||
| 416 | and that command is somewhat intelligent. How it works: | ||
| 417 | |||
| 418 | <P> | ||
| 419 | |||
| 420 | <UL> | ||
| 421 | <LI>if the specified MySQL database is on the same machine, the connection | ||
| 422 | command uses a socket to communicate with MySQL | ||
| 423 | </LI> | ||
| 424 | <LI>if the specified MySQL database is on a different machine, mod_log_sql | ||
| 425 | connects using TCP/IP. | ||
| 426 | </LI> | ||
| 427 | </UL> | ||
| 428 | You don't have any control of which methodology is used. You can fine-tune | ||
| 429 | some of the configuration, however. The L<SMALL>OG</SMALL>SQLS<SMALL>OCKET</SMALL>F<SMALL>ILE</SMALL> | ||
| 430 | runtime configuration directive overrides the default of ``/var/lib/mysql/mysql.sock'' | ||
| 431 | for socket-based connections, whereas the L<SMALL>OG</SMALL>SQLTCPP<SMALL>ORT</SMALL> command | ||
| 432 | allows to you override the default TCP port of 3306 for TCP/IP connections. | ||
| 433 | |||
| 434 | <P> | ||
| 435 | |||
| 436 | <H3><A NAME="SECTION00051800000000000000"> | ||
| 437 | 4.1.8 I have discovered a bug. Who can I contact?</A> | ||
| 438 | </H3> | ||
| 439 | |||
| 440 | <P> | ||
| 441 | Please contact the maintainer (chris@grubbybaby.com)! Your | ||
| 442 | comments, suggestions, bugfixes, bug catches, and usage testimonials | ||
| 443 | are always welcome. As free software, mod_log_sql is intended to | ||
| 444 | be a community effort - any code contributions or other ideas will | ||
| 445 | be fully and openly credited, of course. | ||
| 446 | |||
| 447 | <P> | ||
| 448 | |||
| 449 | <H2><A NAME="SECTION00052000000000000000"> | ||
| 450 | 4.2 Problems</A> | ||
| 451 | </H2> | ||
| 452 | |||
| 453 | <P> | ||
| 454 | |||
| 455 | <H3><A NAME="SECTION00052100000000000000"> | ||
| 456 | 4.2.1 Apache segfaults when using PHP and mod_log_sql</A> | ||
| 457 | </H3> | ||
| 458 | |||
| 459 | <P> | ||
| 460 | This occurs if you compiled PHP with MySQL database support. PHP utilizes | ||
| 461 | its internal, bundled MySQL libraries by default. These conflict with | ||
| 462 | the ``real'' MySQL libraries linked by mod_log_sql, causing | ||
| 463 | the segmentation fault. | ||
| 464 | |||
| 465 | <P> | ||
| 466 | The solution is to configure PHP to link against the real MySQL libraries | ||
| 467 | and recompile mod_php. Apache will run properly once the modules | ||
| 468 | are all using the same version of the MySQL libraries. | ||
| 469 | |||
| 470 | <P> | ||
| 471 | |||
| 472 | <H3><A NAME="SECTION00052200000000000000"></A><A NAME="faq:NothingLogged"></A> | ||
| 473 | <BR> | ||
| 474 | 4.2.2 Apache appears to start up fine, but nothing | ||
| 475 | is getting logged in the database | ||
| 476 | </H3> | ||
| 477 | |||
| 478 | <P> | ||
| 479 | If you do not see any entries in the access_log, then something is | ||
| 480 | preventing the inserts from happening. This could be caused by several | ||
| 481 | things: | ||
| 482 | |||
| 483 | <P> | ||
| 484 | |||
| 485 | <UL> | ||
| 486 | <LI>Improper privileges set up in the MySQL database | ||
| 487 | </LI> | ||
| 488 | <LI>You aren't hitting a VirtualHost that has a LogSQLTransferLogTable | ||
| 489 | entry | ||
| 490 | </LI> | ||
| 491 | <LI>You didn't specify the right database host or login information | ||
| 492 | </LI> | ||
| 493 | <LI>Another factor is preventing a connection to the database | ||
| 494 | </LI> | ||
| 495 | </UL> | ||
| 496 | Important: it is improper to ask for help before you have followed | ||
| 497 | these steps. | ||
| 498 | |||
| 499 | <P> | ||
| 500 | First examine the MySQL log that you established in step <A HREF="node4.html#step:EnaLog">6</A> | ||
| 501 | of section <A HREF="node4.html#sub:PrepDb">3.1</A>. Ensure that the INSERT statements are | ||
| 502 | not being rejected because of a malformed table name or other typographical | ||
| 503 | error. By enabling that log, you instructed MySQL to log every connection | ||
| 504 | and command it receives - if you see no INSERT attempts in the log, | ||
| 505 | the module isn't successfully connecting to the database. If you see | ||
| 506 | nothing at all in the log - not even a record of your administrative | ||
| 507 | connection attempts, then you did not enable the log correctly. If | ||
| 508 | you do see INSERT attempts but they are failing, the log should tell | ||
| 509 | you why. | ||
| 510 | |||
| 511 | <P> | ||
| 512 | Second, confirm that your L<SMALL>OG</SMALL>SQL* directives are all correct. | ||
| 513 | |||
| 514 | <P> | ||
| 515 | Third, examine the Apache error logs for messages from mod_log_sql; | ||
| 516 | the module will offer hints as to why it cannot connect, etc. | ||
| 517 | |||
| 518 | <P> | ||
| 519 | The next thing to do is recompile the module with debugging output | ||
| 520 | activated. change the "#undef DEBUG" on line 8 | ||
| 521 | of mod_log_sql.c to "#define DEBUG" and recompile/reinstall. | ||
| 522 | The module will now output copious notes about what it is doing, and | ||
| 523 | this will help you (and the maintainer) solve the problem. In order | ||
| 524 | to see the debugging messages, ensure that you make them visible using | ||
| 525 | the L<SMALL>OG</SMALL>L<SMALL>EVEL</SMALL> directive <B>in the main server config | ||
| 526 | as well as in each</B> <B>V<SMALL>IRTUAL</SMALL>H<SMALL>OST</SMALL></B> <B>config:</B> | ||
| 527 | |||
| 528 | <P> | ||
| 529 | |||
| 530 | <DL COMPACT> | ||
| 531 | <DT> | ||
| 532 | <DD>LogLevel debug | ||
| 533 | |||
| 534 | <P> | ||
| 535 | ErrorLog /var/log/httpd/server-messages | ||
| 536 | </DD> | ||
| 537 | </DL> | ||
| 538 | <P> | ||
| 539 | |||
| 540 | <H3><A NAME="SECTION00052300000000000000"> | ||
| 541 | 4.2.3 Why do I get the message ``insufficient configuration info to | ||
| 542 | establish database link'' in my Apache error log?</A> | ||
| 543 | </H3> | ||
| 544 | |||
| 545 | <P> | ||
| 546 | At a minimum, L<SMALL>OG</SMALL>SQLD<SMALL>ATABASE</SMALL> and L<SMALL>OG</SMALL>SQLL<SMALL>OGIN</SMALL>I<SMALL>NFO</SMALL> | ||
| 547 | must be defined in order for the module to be able to establish a | ||
| 548 | database link. If these are not defined or are incomplete you will | ||
| 549 | receive this error message. | ||
| 550 | |||
| 551 | <P> | ||
| 552 | |||
| 553 | <H3><A NAME="SECTION00052400000000000000"> | ||
| 554 | 4.2.4 My database cannot handle all the open connections from mod_log_sql, | ||
| 555 | is there anything I can do?</A> | ||
| 556 | </H3> | ||
| 557 | |||
| 558 | <P> | ||
| 559 | The rule of thumb: if you have <I>n</I> webservers each configured | ||
| 560 | to support <I>y</I> M<SMALL>AX</SMALL>C<SMALL>LIENTS</SMALL>, then your database must be | ||
| 561 | able to handle <IMG | ||
| 562 | WIDTH="41" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" | ||
| 563 | SRC="img3.png" | ||
| 564 | ALT="$n\times y$"> simultenous connections <I>in the worst | ||
| 565 | case.</I> Certainly you must use common sense, consider reasonable traffic | ||
| 566 | expectations and structure things accordingly. | ||
| 567 | |||
| 568 | <P> | ||
| 569 | Tweaking my.cnf to scale to high connection loads is imperative. But | ||
| 570 | if hardware limitations prevent your MySQL server from gracefully | ||
| 571 | handling the number of incoming connections, it would be beneficial | ||
| 572 | to upgrade the memory or CPU on that server in order to handle the | ||
| 573 | load. | ||
| 574 | |||
| 575 | <P> | ||
| 576 | Jeremy Zawodny, a highly respected MySQL user and contributor to Linux | ||
| 577 | Magazine, has this very helpful and highly appropriate article on | ||
| 578 | tuning MySQL: http://jeremy.zawodny.com/blog/archives/000173.html | ||
| 579 | |||
| 580 | <P> | ||
| 581 | Please remember that mod_log_sql's overriding principle is <B>performance</B> | ||
| 582 | - that is what the target audience demands and expects. Other database | ||
| 583 | logging solutions do not open and maintain many database connections, | ||
| 584 | but their performance suffers drastically. For example, pgLOGd funnels | ||
| 585 | all log connections through a separate daemon that connects to the | ||
| 586 | database, but that bottlenecks the entire process. mod_log_sql achieves | ||
| 587 | performance numbers an order of magnitude greater than the alternatives | ||
| 588 | because it dispenses with the overhead associated with rapid connection | ||
| 589 | cycling, and it doesn't attempt to shoehorn all the database traffic | ||
| 590 | through a single extra daemon or proxy process. | ||
| 591 | |||
| 592 | <P> | ||
| 593 | |||
| 594 | <H3><A NAME="SECTION00052500000000000000"> | ||
| 595 | 4.2.5 Why do I occasionally see a ``lost connection to MySQL server'' | ||
| 596 | message in my Apache error log?</A> | ||
| 597 | </H3> | ||
| 598 | |||
| 599 | <P> | ||
| 600 | This message may appear every now and then in your Apache error log, | ||
| 601 | especially on very lightly loaded servers. This doesn't mean that | ||
| 602 | anything is necessarily wrong. Within each httpd child process, mod_log_sql | ||
| 603 | will open (and keep open) a connection to the MySQL server. MySQL, | ||
| 604 | however, will close connections that haven't been used in a while; | ||
| 605 | the default timeout is 8 hours. When this occurs, mod_log_sql will | ||
| 606 | notice and re-open the connection. That event is what is being logged, | ||
| 607 | and looks like this: | ||
| 608 | |||
| 609 | <P> | ||
| 610 | |||
| 611 | <DL COMPACT> | ||
| 612 | <DT> | ||
| 613 | <DD>[Tue Nov 12 19:04:10 2002] [error] mod_log_sql: first attempt failed, | ||
| 614 | |||
| 615 | <P> | ||
| 616 | API said: error 2013, Lost connection to MySQL server during query | ||
| 617 | |||
| 618 | <P> | ||
| 619 | [Tue Nov 12 19:04:10 2002] [error] mod_log_sql: reconnect successful | ||
| 620 | |||
| 621 | <P> | ||
| 622 | [Tue Nov 12 19:04:10 2002] [error] mod_log_sql: second attempt successful | ||
| 623 | </DD> | ||
| 624 | </DL>Reference: MySQL documentation (http://www.mysql.com/documentation/mysql/bychapter/manual_Problems.html#Gone_away) | ||
| 625 | |||
| 626 | <P> | ||
| 627 | |||
| 628 | <H2><A NAME="SECTION00053000000000000000"> | ||
| 629 | 4.3 Performance and Tuning</A> | ||
| 630 | </H2> | ||
| 631 | |||
| 632 | <P> | ||
| 633 | |||
| 634 | <H3><A NAME="SECTION00053100000000000000"> | ||
| 635 | 4.3.1 How well does it perform?</A> | ||
| 636 | </H3> | ||
| 637 | |||
| 638 | <P> | ||
| 639 | mod_log_sql scales to very high loads. Apache 1.3.22 + mod_log_sql | ||
| 640 | was benchmarked using the "ab" (Apache Bench) program | ||
| 641 | that comes with the Apache distribution; here are the results. | ||
| 642 | |||
| 643 | <P> | ||
| 644 | Overall configuration: | ||
| 645 | |||
| 646 | <P> | ||
| 647 | |||
| 648 | <UL> | ||
| 649 | <LI>Machine A: Apache webserver | ||
| 650 | </LI> | ||
| 651 | <LI>Machine B: MySQL server | ||
| 652 | </LI> | ||
| 653 | <LI>Machines A and B connected with 100Mbps Ethernet | ||
| 654 | </LI> | ||
| 655 | <LI>Webserver: Celeron 400, 128 MB RAM, IDE storage | ||
| 656 | </LI> | ||
| 657 | </UL> | ||
| 658 | Apache configuration: | ||
| 659 | |||
| 660 | <P> | ||
| 661 | |||
| 662 | <DL COMPACT> | ||
| 663 | <DT> | ||
| 664 | <DD>Timeout 300 | ||
| 665 | |||
| 666 | <P> | ||
| 667 | KeepAlive On | ||
| 668 | |||
| 669 | <P> | ||
| 670 | MaxKeepAliveRequests 100 | ||
| 671 | |||
| 672 | <P> | ||
| 673 | KeepAliveTimeout 15 | ||
| 674 | |||
| 675 | <P> | ||
| 676 | MinSpareServers 5 | ||
| 677 | |||
| 678 | <P> | ||
| 679 | StartServers 10 | ||
| 680 | |||
| 681 | <P> | ||
| 682 | MaxSpareServers 15 | ||
| 683 | |||
| 684 | <P> | ||
| 685 | MaxClients 256 | ||
| 686 | |||
| 687 | <P> | ||
| 688 | MaxRequestsPerChild 5000 | ||
| 689 | |||
| 690 | <P> | ||
| 691 | LogSQLTransferLogFormat AbHhmRSsTUuvc | ||
| 692 | |||
| 693 | <P> | ||
| 694 | LogSQLWhichCookie Clicks | ||
| 695 | |||
| 696 | <P> | ||
| 697 | CookieTracking on | ||
| 698 | |||
| 699 | <P> | ||
| 700 | CookieName Clicks | ||
| 701 | </DD> | ||
| 702 | </DL>"ab" commandline: | ||
| 703 | |||
| 704 | <P> | ||
| 705 | |||
| 706 | <DL COMPACT> | ||
| 707 | <DT> | ||
| 708 | <DD>./ab -c 10 -t 20 -v 2 -C Clicks=ab_run http://www.hostname.com/target | ||
| 709 | </DD> | ||
| 710 | </DL>( 10 concurrent requests; 20 second test; setting a cookie "Clicks=ab_run"; | ||
| 711 | target = the mod_log_sql homepage. ) | ||
| 712 | |||
| 713 | <P> | ||
| 714 | Ten total ab runs were conducted: five with MySQL logging enabled, | ||
| 715 | and five with all MySQL directives commented out of httpd.conf. Then | ||
| 716 | each five were averaged. The results: | ||
| 717 | |||
| 718 | <P> | ||
| 719 | |||
| 720 | <UL> | ||
| 721 | <LI>Average of five runs employing MySQL <I>and</I> standard text logging: | ||
| 722 | <B>139.01 requests per second, zero errors</B>. | ||
| 723 | </LI> | ||
| 724 | <LI>Average of five runs employing <I>only</I> standard text logging: | ||
| 725 | <B>139.96 requests per second, zero errors</B>. | ||
| 726 | </LI> | ||
| 727 | </UL> | ||
| 728 | In other words, any rate-limiting effects on this particular hardware | ||
| 729 | setup are not caused by MySQL. Note that although this very simple | ||
| 730 | webserver setup is hardly cutting-edge - it is, after all, a fairly | ||
| 731 | small machine - 139 requests per second equal over <I>twelve million | ||
| 732 | hits per day.</I> | ||
| 733 | |||
| 734 | <P> | ||
| 735 | If you run this benchmark yourself, take note of three things: | ||
| 736 | |||
| 737 | <P> | ||
| 738 | |||
| 739 | <OL> | ||
| 740 | <LI>Use a target URL that is on your own webserver :-). | ||
| 741 | </LI> | ||
| 742 | <LI>Wait until all your connections are closed out between runs; after | ||
| 743 | several thousand requests your TCP/IP stack will be filled with hundreds | ||
| 744 | of connections in TIME_WAIT that need to close. Do a "netstat | ||
| 745 | -t|wc -l" on the webserver to see. If you don't wait, you | ||
| 746 | can expect to see a lot of messages like "ip_conntrack: | ||
| 747 | table full, dropping packet" in your logs. (This has nothing | ||
| 748 | to do with mod_log_sql, this is simply the nature of the TCP/IP | ||
| 749 | stack in the Linux kernel.) | ||
| 750 | </LI> | ||
| 751 | <LI>When done with your runs, clean these many thousands of requests out | ||
| 752 | of your database: | ||
| 753 | </LI> | ||
| 754 | </OL> | ||
| 755 | |||
| 756 | <DL COMPACT> | ||
| 757 | <DT> | ||
| 758 | <DD>mysql> delete from access_log where agent like 'ApacheBench%'; | ||
| 759 | |||
| 760 | <P> | ||
| 761 | mysql> optimize table access_log; | ||
| 762 | </DD> | ||
| 763 | </DL> | ||
| 764 | <P> | ||
| 765 | |||
| 766 | <H3><A NAME="SECTION00053200000000000000"> | ||
| 767 | 4.3.2 Do I need to be worried about all the running MySQL children? Will | ||
| 768 | holding open <I>n</I> Apache-to-MySQL connections consume a lot of | ||
| 769 | memory? </A> | ||
| 770 | </H3> | ||
| 771 | |||
| 772 | <P> | ||
| 773 | Short answer: you shouldn't be worried. | ||
| 774 | |||
| 775 | <P> | ||
| 776 | Long answer: you might be evaluating at the output of ``ps -aufxw'' | ||
| 777 | and becoming alarmed at all the 7MB httpd processes or 22MB mysqld | ||
| 778 | children that you see. Don't be alarmed<I>.</I> It's true that mod_log_sql | ||
| 779 | opens and holds open many MySQL connections: each httpd child maintains | ||
| 780 | one open database connection (and holds it open for performance reasons). | ||
| 781 | Four webservers, each running 20 Apache children, will hold open 80 | ||
| 782 | MySQL connections, which means that your MySQL server needs to handle | ||
| 783 | 80 simultaneous connections. In truth, your MySQL server needs to | ||
| 784 | handle far more than that if traffic to your website spikes and the | ||
| 785 | Apache webservers spawn off an additional 30 children each... | ||
| 786 | |||
| 787 | <P> | ||
| 788 | Fortunately the cost reported by 'ps -aufxw' is deceptive. This is | ||
| 789 | due to an OS memory-management feature called ``copy-on-write.'' | ||
| 790 | When you have a number of identical child processes (e.g. Apache, | ||
| 791 | MySQL), it would appear in ``ps'' as though each one occupies | ||
| 792 | a great deal of RAM - as much as 7MB per httpd child! In actuality | ||
| 793 | each additional child only occupies a small bit of extra memory - | ||
| 794 | most of the memory pages are common to each child and therefore shared | ||
| 795 | in a ``read-only'' fashion. The OS can get away with this because | ||
| 796 | the majority of memory pages for one child are identical across all | ||
| 797 | children. Instead of thinking of each child as a rubber stamp of the | ||
| 798 | others, think of each child as a basket of links to a common memory | ||
| 799 | area. | ||
| 800 | |||
| 801 | <P> | ||
| 802 | A memory page is only duplicated when it needs to be written to, hence | ||
| 803 | ``copy-on-write.'' The result is efficiency and decreased memory | ||
| 804 | consumption. ``ps'' may report 7MB per child, but it might really | ||
| 805 | only ``cost'' 900K of extra memory to add one more child. It is | ||
| 806 | <B>not</B> <B>correct</B> to assume that 20 Apache | ||
| 807 | children with a VSZ of 7MB each equals <!-- MATH | ||
| 808 | $(20\times 7MB)$ | ||
| 809 | --> | ||
| 810 | <IMG | ||
| 811 | WIDTH="90" HEIGHT="32" ALIGN="MIDDLE" BORDER="0" | ||
| 812 | SRC="img4.png" | ||
| 813 | ALT="$(20\times 7MB)$"> of memory | ||
| 814 | consumption - the real answer is much, much lower. The same ``copy-on-write'' | ||
| 815 | rules apply to all your MySQL children: 40 mysqld children @ 22MB | ||
| 816 | each <B>do not</B> occupy 880MB of RAM. | ||
| 817 | |||
| 818 | <P> | ||
| 819 | The bottom line: although there is a cost to spawn extra httpd or | ||
| 820 | mysqld children, that cost is not as great as ``ps'' would lead | ||
| 821 | you to believe. | ||
| 822 | |||
| 823 | <P> | ||
| 824 | |||
| 825 | <H3><A NAME="SECTION00053300000000000000"> | ||
| 826 | 4.3.3 My webserver cannot handle all the traffic that my site receives, | ||
| 827 | is there anything I can do?</A> | ||
| 828 | </H3> | ||
| 829 | |||
| 830 | <P> | ||
| 831 | If you have exhausted all the tuning possibilities on your existing | ||
| 832 | server, it is probably time you evaluated the benefits of clustering | ||
| 833 | two or more webservers together in a load-balanced fashion. In fact, | ||
| 834 | users of such a setup are mod_log_sql's target audience! | ||
| 835 | |||
| 836 | <P> | ||
| 837 | |||
| 838 | <H3><A NAME="SECTION00053400000000000000"></A><A NAME="sub:DelayedInsFAQ"></A> | ||
| 839 | <BR> | ||
| 840 | 4.3.4 What is the issue with activating delayed | ||
| 841 | inserts? | ||
| 842 | </H3> | ||
| 843 | |||
| 844 | <P> | ||
| 845 | There are several. | ||
| 846 | |||
| 847 | <P> | ||
| 848 | |||
| 849 | <OL> | ||
| 850 | <LI>INSERT DELAYED is a specific syntax to MySQL and is not supported | ||
| 851 | by any other database. Ergo, why is it needed, and what MySQL deficiency | ||
| 852 | is it working around? INSERT DELAYED is a kluge. | ||
| 853 | </LI> | ||
| 854 | <LI>The MySQL documentation is unclear whether INSERT DELAYED is even | ||
| 855 | necessary for an optimized database. It says, ``The DELAYED option | ||
| 856 | for the INSERT statement is a MySQL-specific option that is very useful | ||
| 857 | if you have clients that can't wait for the INSERT to complete.'' | ||
| 858 | But then it goes on to say, ``Note that as MyISAM tables supports | ||
| 859 | concurrent SELECT and INSERT, if there is no free blocks in the middle | ||
| 860 | of the data file, you very seldom need to use INSERT DELAYED with | ||
| 861 | MyISAM.'' | ||
| 862 | </LI> | ||
| 863 | <LI>Because INSERT DELAYED returns without waiting for the data to be | ||
| 864 | written, a hard kill of your MySQL database at the right (wrong?) | ||
| 865 | moment could lose those logfile entries. | ||
| 866 | </LI> | ||
| 867 | <LI>As of MySQL version 3.23.52, the error return functions disagree after | ||
| 868 | a failed INSERT DELAYED: mysql_errno() always returns 0, even if | ||
| 869 | mysql_error() returns a textual error. I have reported this bug to | ||
| 870 | the MySQL folks. However, we have no way of knowing what solution | ||
| 871 | they will adopt to fix this, and with the worst case solution mod_log_sql | ||
| 872 | would not be able to tell if anything went wrong with a delayed insert. | ||
| 873 | </LI> | ||
| 874 | </OL> | ||
| 875 | Instead of delayed inserts, you may wish to utilize InnoDB tables | ||
| 876 | (instead of the standard MyISAM tables). InnoDB tables suppot row-level | ||
| 877 | locking and are recommended for high-volume databases. | ||
| 878 | |||
| 879 | <P> | ||
| 880 | If after understanding these problems you still wish to enable delayed | ||
| 881 | inserts, section <A HREF="node4.html#sub:DelayedIns">3.5.4</A> discusses how. | ||
| 882 | |||
| 883 | <P> | ||
| 884 | |||
| 885 | <H2><A NAME="SECTION00054000000000000000"> | ||
| 886 | 4.4 ``How do I...?'' - accomplishing certain tasks</A> | ||
| 887 | </H2> | ||
| 888 | |||
| 889 | <P> | ||
| 890 | |||
| 891 | <H3><A NAME="SECTION00054100000000000000"> | ||
| 892 | 4.4.1 I am using LogSQLMassVirtualHosting, and sometimes a single VirtualHost | ||
| 893 | gets logged to two different tables. How do I prevent that?</A> | ||
| 894 | </H3> | ||
| 895 | |||
| 896 | <P> | ||
| 897 | Proper usage of the Apache runtime S<SMALL>ERVER</SMALL>N<SMALL>AME</SMALL> directive and | ||
| 898 | the directive U<SMALL>SE</SMALL>C<SMALL>ANONICAL</SMALL>N<SMALL>AME </SMALL>O<SMALL>N</SMALL> (or DNS) are necessary | ||
| 899 | to prevent this problem. ``On'' is the default for U<SMALL>SE</SMALL>C<SMALL>ANONICAL</SMALL>N<SMALL>AME</SMALL>, | ||
| 900 | and specifies that self-referential URLs are generated from the S<SMALL>ERVER</SMALL>N<SMALL>AME</SMALL> | ||
| 901 | part of your VirtualHost: | ||
| 902 | |||
| 903 | <P> | ||
| 904 | <BLOCKQUOTE> | ||
| 905 | With UseCanonicalName on (and in all versions prior to 1.3) Apache | ||
| 906 | will use the ServerName and Port directives to construct the canonical | ||
| 907 | name for the server. With UseCanonicalName off Apache will form self-referential | ||
| 908 | URLs using the hostname and port supplied by the client if any are | ||
| 909 | supplied (otherwise it will use the canonical name, as defined above). | ||
| 910 | [From the Apache documentation http://httpd.apache.org/docs/mod/core.html#usecanonicalname] | ||
| 911 | |||
| 912 | </BLOCKQUOTE> | ||
| 913 | The module inherits Apache's ``knowledge'' about the server name | ||
| 914 | being accessed. As long as those two directives are properly configured, | ||
| 915 | mod_log_sql will log to only one table per virtual host while using | ||
| 916 | L<SMALL>OG</SMALL>SQLM<SMALL>ASS</SMALL>V<SMALL>IRTUAL</SMALL>H<SMALL>OSTING</SMALL>. | ||
| 917 | |||
| 918 | <P> | ||
| 919 | |||
| 920 | <H3><A NAME="SECTION00054200000000000000"> | ||
| 921 | 4.4.2 How do I extract the data in a format that my analysis tool can understand?</A> | ||
| 922 | </H3> | ||
| 923 | |||
| 924 | <P> | ||
| 925 | mod_log_sql would be virtually useless if there weren't a way for | ||
| 926 | you to extract the data from your database in a somewhat meaningful | ||
| 927 | fashion. To that end there's a Perl script enclosed with the distribution. | ||
| 928 | That script (make_combined_log.pl) is designed to extract N-many | ||
| 929 | days worth of access logs and provide them in a Combined Log Format | ||
| 930 | output. You can use this very tool right in /etc/crontab to extract | ||
| 931 | logs on a regular basis so that your favorite web analysis tool can | ||
| 932 | read them. Or you can examine the Perl code to construct your own | ||
| 933 | custom tool. | ||
| 934 | |||
| 935 | <P> | ||
| 936 | For example, let's say that you want your web statistics updated once | ||
| 937 | per day in the wee hours of the morning. A good way to accomplish | ||
| 938 | that could be the following entries in /etc/crontab: | ||
| 939 | |||
| 940 | <P> | ||
| 941 | |||
| 942 | <DL COMPACT> | ||
| 943 | <DT> | ||
| 944 | <DD># Generate the temporary apache logs from the MySQL database (for webalizer) | ||
| 945 | |||
| 946 | <P> | ||
| 947 | 05 04 * * * root make_combined_log.pl 1 www.grubbybaby.com > /var/log/temp01 | ||
| 948 | |||
| 949 | <P> | ||
| 950 | # Run webalizer on httpd log | ||
| 951 | |||
| 952 | <P> | ||
| 953 | 30 04 * * * root webalizer -c /etc/webalizer.conf; rm -f /var/log/temp01 | ||
| 954 | </DD> | ||
| 955 | </DL>Or if you have a newer system that puts files in /etc/cron.daily etc., | ||
| 956 | create a file called ``webalizer'' in the cron.daily subdirectory. | ||
| 957 | Use the following as the contents of your file, and make sure to chmod | ||
| 958 | 755 it when done. | ||
| 959 | |||
| 960 | <P> | ||
| 961 | |||
| 962 | <DL COMPACT> | ||
| 963 | <DT> | ||
| 964 | <DD>#!/bin/sh | ||
| 965 | |||
| 966 | <P> | ||
| 967 | /usr/local/sbin/make_combined_log.pl 1 www.yourdomain.com > /var/log/httpd/templog | ||
| 968 | |||
| 969 | <P> | ||
| 970 | /usr/local/bin/webalizer -q -c /etc/webalizer.conf | ||
| 971 | |||
| 972 | <P> | ||
| 973 | rm -f /var/log/httpd/templog | ||
| 974 | </DD> | ||
| 975 | </DL>See? Easy. | ||
| 976 | |||
| 977 | <P> | ||
| 978 | |||
| 979 | <H3><A NAME="SECTION00054300000000000000"></A><A NAME="sec:cookie"></A> | ||
| 980 | <BR> | ||
| 981 | 4.4.3 How can I log mod_usertrack cookies? | ||
| 982 | </H3> | ||
| 983 | |||
| 984 | <P> | ||
| 985 | A number of people like to log mod_usertrack cookies in their Apache | ||
| 986 | TransferLog to aid in understanding their visitors' clickstreams. | ||
| 987 | This is accomplished, for example, with a statement as follows: | ||
| 988 | |||
| 989 | <P> | ||
| 990 | |||
| 991 | <DL COMPACT> | ||
| 992 | <DT> | ||
| 993 | <DD>LogFormat "%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"" \"%{cookie}n\"" | ||
| 994 | </DD> | ||
| 995 | </DL>Naturally it would be nice for mod_log_sql to permit the admin to | ||
| 996 | log the cookie data as well, so as of version 1.10 you can do this. | ||
| 997 | You need to have already compiled mod_usertrack into httpd - it's | ||
| 998 | one of the standard Apache modules. | ||
| 999 | |||
| 1000 | <P> | ||
| 1001 | First make sure you have a column called "cookie" | ||
| 1002 | in the MySQL database to hold the cookies, which can be done as follows | ||
| 1003 | if you already have a working database: | ||
| 1004 | |||
| 1005 | <P> | ||
| 1006 | |||
| 1007 | <DL COMPACT> | ||
| 1008 | <DT> | ||
| 1009 | <DD>alter table acc_log_tbl add column cookie varchar(255); | ||
| 1010 | </DD> | ||
| 1011 | </DL>Next configure your server to set usertracking cookies as follows, | ||
| 1012 | and make sure you include the new 'c' directive in your L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL>, | ||
| 1013 | which activates cookie logging. Here's an example: | ||
| 1014 | |||
| 1015 | <P> | ||
| 1016 | |||
| 1017 | <DL COMPACT> | ||
| 1018 | <DT> | ||
| 1019 | <DD><VirtualHost 1.2.3.4> | ||
| 1020 | |||
| 1021 | <P> | ||
| 1022 | CookieTracking on | ||
| 1023 | |||
| 1024 | <P> | ||
| 1025 | CookieStyle Cookie | ||
| 1026 | |||
| 1027 | <P> | ||
| 1028 | CookieName Foobar | ||
| 1029 | |||
| 1030 | <P> | ||
| 1031 | LogSQLTransferLogFormat huSUsbTvRAc | ||
| 1032 | |||
| 1033 | <P> | ||
| 1034 | LogSQLWhichCookie Foobar | ||
| 1035 | |||
| 1036 | <P> | ||
| 1037 | </VirtualHost> | ||
| 1038 | </DD> | ||
| 1039 | </DL>The first three lines configure mod_usertrack to create a COOKIE | ||
| 1040 | (RFC 2109) format cookie called Foobar. The last two lines tell mod_log_sql | ||
| 1041 | to log cookies named Foobar. You have to choose which cookie to log | ||
| 1042 | because more than one cookie can/will be sent to the server by the | ||
| 1043 | client. | ||
| 1044 | |||
| 1045 | <P> | ||
| 1046 | Recap: the 'c' character <I>activates</I> cookie logging, and the | ||
| 1047 | L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>C<SMALL>OOKIE</SMALL> directive <I>chooses</I> which cookie to | ||
| 1048 | log. | ||
| 1049 | |||
| 1050 | <P> | ||
| 1051 | FYI, you are advised NOT to use C<SMALL>OOKIE</SMALL>S<SMALL>TYLE </SMALL>C<SMALL>OOKIE2</SMALL> - it | ||
| 1052 | seems that even newer browsers (IE 5.5, etc.) have trouble with the | ||
| 1053 | new COOKIE2 (RFC 2965) format. Just stick with the standard COOKIE | ||
| 1054 | format and you'll be fine. | ||
| 1055 | |||
| 1056 | <P> | ||
| 1057 | Perform some hits on your server and run a select: | ||
| 1058 | |||
| 1059 | <P> | ||
| 1060 | |||
| 1061 | <DL COMPACT> | ||
| 1062 | <DT> | ||
| 1063 | <DD>mysql> select request_uri,cookie from access_log where cookie is not null; | ||
| 1064 | |||
| 1065 | <P> | ||
| 1066 | </DD> | ||
| 1067 | </DL> | ||
| 1068 | <DIV ALIGN="CENTER"> | ||
| 1069 | <TABLE CELLPADDING=3 BORDER="1"> | ||
| 1070 | <TR><TD ALIGN="LEFT">request_uri</TD> | ||
| 1071 | <TD ALIGN="LEFT">cookie</TD> | ||
| 1072 | </TR> | ||
| 1073 | <TR><TD ALIGN="LEFT">/mod_log_sql/</TD> | ||
| 1074 | <TD ALIGN="LEFT">ool-18e4.dyn.optonline.net.130051007102700823</TD> | ||
| 1075 | </TR> | ||
| 1076 | <TR><TD ALIGN="LEFT">/mod_log_sql/usa.gif</TD> | ||
| 1077 | <TD ALIGN="LEFT">ool-18e4.dyn.optonline.net.130051007102700823</TD> | ||
| 1078 | </TR> | ||
| 1079 | <TR><TD ALIGN="LEFT">/mod_log_sql/style_1.css</TD> | ||
| 1080 | <TD ALIGN="LEFT">ool-18e4.dyn.optonline.net.130051007102700823</TD> | ||
| 1081 | </TR> | ||
| 1082 | </TABLE> | ||
| 1083 | </DIV> | ||
| 1084 | |||
| 1085 | <P> | ||
| 1086 | |||
| 1087 | <DL COMPACT> | ||
| 1088 | <DT> | ||
| 1089 | <DD><P> | ||
| 1090 | </DD> | ||
| 1091 | </DL> | ||
| 1092 | <P> | ||
| 1093 | |||
| 1094 | <H3><A NAME="SECTION00054400000000000000"> | ||
| 1095 | 4.4.4 What if I want to log more than one cookie? What is the difference | ||
| 1096 | between LogSQLWhichCookie and LogSQLWhichCookies?</A> | ||
| 1097 | </H3> | ||
| 1098 | |||
| 1099 | <P> | ||
| 1100 | As of version 1.17, you have a choice in how you want cookie logging | ||
| 1101 | handled. | ||
| 1102 | |||
| 1103 | <P> | ||
| 1104 | If you are interested in logging only one cookie per request, follow | ||
| 1105 | the instructions in section <A HREF="node5.html#sec:cookie">4.4.3</A> above. That cookie will | ||
| 1106 | be logged to a column in the regular access_log table, and the actual | ||
| 1107 | cookie you want to log is specified with L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>C<SMALL>OOKIE</SMALL>. | ||
| 1108 | Don't forget to specify the 'c' character in L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL>. | ||
| 1109 | |||
| 1110 | <P> | ||
| 1111 | If, however, you need to log multiple cookies per request, you must | ||
| 1112 | employ the L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>C<SMALL>OOKIES</SMALL> (note the plural) directive. | ||
| 1113 | The cookies you specify will be logged to a separate table (as discussed | ||
| 1114 | in section <A HREF="node4.html#secMulTable">3.5.2</A>), and entries in that table will be | ||
| 1115 | linked to the regular access_log entries via the unique ID that is | ||
| 1116 | supplied by mod_unique_id. Without mod_unique_id the information | ||
| 1117 | will still be logged but you will be unable to correlate which cookies | ||
| 1118 | go with which access-requests. Furthermore, with L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>C<SMALL>OOKIES</SMALL>, | ||
| 1119 | you do <B>not</B> need to include the 'c' character in L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL>. | ||
| 1120 | |||
| 1121 | <P> | ||
| 1122 | L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>C<SMALL>OOKIE</SMALL> and L<SMALL>OG</SMALL>SQLW<SMALL>HICH</SMALL>C<SMALL>OOKIES</SMALL> can coexist | ||
| 1123 | without conflict because they operate on entireley different tables, | ||
| 1124 | but you're better off choosing the one you need. | ||
| 1125 | |||
| 1126 | <P> | ||
| 1127 | |||
| 1128 | <H3><A NAME="SECTION00054500000000000000"> | ||
| 1129 | 4.4.5 What are the SSL logging features, and how do I activate them?</A> | ||
| 1130 | </H3> | ||
| 1131 | |||
| 1132 | <P> | ||
| 1133 | Note: you do <B>not</B> need to compile SSL support into mod_log_sql | ||
| 1134 | in order to simply use it with a secure site. You only need to compile | ||
| 1135 | SSL support into mod_log_sql if you want to log SSL-specific data | ||
| 1136 | such as the cipher type used, or the keysize that was negotiated. | ||
| 1137 | If that information is unimportant to you, you can ignore this FAQ. | ||
| 1138 | |||
| 1139 | <P> | ||
| 1140 | By adding certain characters to your L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL> | ||
| 1141 | string you can tell mod_log_sql to log the SSL cipher, the SSL keysize | ||
| 1142 | of the connection, and the maximum keysize that was available. This | ||
| 1143 | would let you tell, for example, which clients were using only export-grade | ||
| 1144 | security to access your secure software area. | ||
| 1145 | |||
| 1146 | <P> | ||
| 1147 | You can compile mod_log_sql with SSL logging support if you have | ||
| 1148 | the right packages installed. If you already have an SSL-enabled Apache | ||
| 1149 | then you by definition have the correct packages already installed: | ||
| 1150 | OpenSSL and mod_ssl. | ||
| 1151 | |||
| 1152 | <P> | ||
| 1153 | You need to ensure that your database is set up to log the SSL data. | ||
| 1154 | Issue the following commands to MySQL if your access table does not | ||
| 1155 | already have them: | ||
| 1156 | |||
| 1157 | <P> | ||
| 1158 | |||
| 1159 | <DL COMPACT> | ||
| 1160 | <DT> | ||
| 1161 | <DD>alter table access_log add column ssl_cipher varchar(25); | ||
| 1162 | |||
| 1163 | <P> | ||
| 1164 | alter table access_log add column ssl_keysize smallint unsigned; | ||
| 1165 | |||
| 1166 | <P> | ||
| 1167 | alter table access_log add column ssl_maxkeysize smallint unsigned; | ||
| 1168 | </DD> | ||
| 1169 | </DL>Finally configure httpd.conf to activate the SSL fields. Note that | ||
| 1170 | this is only meaningful in a VirtualHost that is set up for SSL. | ||
| 1171 | |||
| 1172 | <P> | ||
| 1173 | |||
| 1174 | <DL COMPACT> | ||
| 1175 | <DT> | ||
| 1176 | <DD><VirtualHost 1.2.3.4:443> | ||
| 1177 | |||
| 1178 | <P> | ||
| 1179 | LogSQLTransferLogFormat AbHhmRSsTUuvc<B>Qqz</B> | ||
| 1180 | |||
| 1181 | <P> | ||
| 1182 | </VirtualHost> | ||
| 1183 | </DD> | ||
| 1184 | </DL>The last three characters (Qqz) in the directive are the SSL ones; | ||
| 1185 | see section <A HREF="node4.html#sub:Frmat">3.6.17</A> in the directives documentation for details | ||
| 1186 | of the L<SMALL>OG</SMALL>SQLT<SMALL>RANSFER</SMALL>L<SMALL>OG</SMALL>F<SMALL>ORMAT</SMALL> directive. | ||
| 1187 | |||
| 1188 | <P> | ||
| 1189 | Restart Apache, then perform some hits on your server. Then run the | ||
| 1190 | following select statement: | ||
| 1191 | |||
| 1192 | <P> | ||
| 1193 | |||
| 1194 | <DL COMPACT> | ||
| 1195 | <DT> | ||
| 1196 | <DD>mysql> select remote_host,request_uri,ssl_cipher,ssl_keysize,ssl_maxkeysize | ||
| 1197 | |||
| 1198 | <P> | ||
| 1199 | from access_log where ssl_cipher is not null; | ||
| 1200 | |||
| 1201 | <P> | ||
| 1202 | </DD> | ||
| 1203 | </DL> | ||
| 1204 | <DIV ALIGN="CENTER"> | ||
| 1205 | <TABLE CELLPADDING=3 BORDER="1"> | ||
| 1206 | <TR><TD ALIGN="LEFT">remote_host</TD> | ||
| 1207 | <TD ALIGN="LEFT">request_uri</TD> | ||
| 1208 | <TD ALIGN="LEFT">ssl_cipher</TD> | ||
| 1209 | <TD ALIGN="LEFT">ssl_keysize</TD> | ||
| 1210 | <TD ALIGN="LEFT">ssl_maxkeysize</TD> | ||
| 1211 | </TR> | ||
| 1212 | <TR><TD ALIGN="LEFT">216.190.52.4</TD> | ||
| 1213 | <TD ALIGN="LEFT">/dir/somefile.html</TD> | ||
| 1214 | <TD ALIGN="LEFT">RC4-MD5</TD> | ||
| 1215 | <TD ALIGN="LEFT">128</TD> | ||
| 1216 | <TD ALIGN="LEFT">128</TD> | ||
| 1217 | </TR> | ||
| 1218 | <TR><TD ALIGN="LEFT">216.190.52.4</TD> | ||
| 1219 | <TD ALIGN="LEFT">/dir/somefile.gif</TD> | ||
| 1220 | <TD ALIGN="LEFT">RC4-MD5</TD> | ||
| 1221 | <TD ALIGN="LEFT">128</TD> | ||
| 1222 | <TD ALIGN="LEFT">128</TD> | ||
| 1223 | </TR> | ||
| 1224 | <TR><TD ALIGN="LEFT">216.190.52.4</TD> | ||
| 1225 | <TD ALIGN="LEFT">/dir/somefile.jpg</TD> | ||
| 1226 | <TD ALIGN="LEFT">RC4-MD5</TD> | ||
| 1227 | <TD ALIGN="LEFT">128</TD> | ||
| 1228 | <TD ALIGN="LEFT">128</TD> | ||
| 1229 | </TR> | ||
| 1230 | </TABLE> | ||
| 1231 | </DIV> | ||
| 1232 | |||
| 1233 | <P> | ||
| 1234 | |||
| 1235 | <DL COMPACT> | ||
| 1236 | <DT> | ||
| 1237 | <DD> | ||
| 1238 | </DD> | ||
| 1239 | </DL> | ||
| 1240 | <P> | ||
| 1241 | <HR> | ||
| 1242 | <!--Navigation Panel--> | ||
| 1243 | <A NAME="tex2html219" | ||
| 1244 | HREF="node6.html"> | ||
| 1245 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> | ||
| 1246 | <A NAME="tex2html215" | ||
| 1247 | HREF="documentation.html"> | ||
| 1248 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> | ||
| 1249 | <A NAME="tex2html209" | ||
| 1250 | HREF="node4.html"> | ||
| 1251 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> | ||
| 1252 | <A NAME="tex2html217" | ||
| 1253 | HREF="node1.html"> | ||
| 1254 | <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> | ||
| 1255 | <BR> | ||
| 1256 | <B> Next:</B> <A NAME="tex2html220" | ||
| 1257 | HREF="node6.html">About this document ...</A> | ||
| 1258 | <B> Up:</B> <A NAME="tex2html216" | ||
| 1259 | HREF="documentation.html">Installing and Running mod_log_sql</A> | ||
| 1260 | <B> Previous:</B> <A NAME="tex2html210" | ||
| 1261 | HREF="node4.html">3 Configuration</A> | ||
| 1262 | <B> <A NAME="tex2html218" | ||
| 1263 | HREF="node1.html">Contents</A></B> | ||
| 1264 | <!--End of Navigation Panel--> | ||
| 1265 | <ADDRESS> | ||
| 1266 | Chris Powell | ||
| 1267 | 2002-12-18 | ||
| 1268 | </ADDRESS> | ||
| 1269 | </BODY> | ||
| 1270 | </HTML> | ||
diff --git a/docs/node6.html b/docs/node6.html new file mode 100644 index 0000000..cefac28 --- /dev/null +++ b/docs/node6.html | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | ||
| 2 | |||
| 3 | <!--Converted with LaTeX2HTML 2002-1 (1.68) | ||
| 4 | original version by: Nikos Drakos, CBLU, University of Leeds | ||
| 5 | * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan | ||
| 6 | * with significant contributions from: | ||
| 7 | Jens Lippmann, Marek Rouchal, Martin Wilck and others --> | ||
| 8 | <HTML> | ||
| 9 | <HEAD> | ||
| 10 | <TITLE>About this document ...</TITLE> | ||
| 11 | <META NAME="description" CONTENT="About this document ..."> | ||
| 12 | <META NAME="keywords" CONTENT="documentation"> | ||
| 13 | <META NAME="resource-type" CONTENT="document"> | ||
| 14 | <META NAME="distribution" CONTENT="global"> | ||
| 15 | |||
| 16 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> | ||
| 17 | <META NAME="Generator" CONTENT="LaTeX2HTML v2002-1"> | ||
| 18 | <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> | ||
| 19 | |||
| 20 | <LINK REL="STYLESHEET" HREF="documentation.css"> | ||
| 21 | |||
| 22 | <LINK REL="previous" HREF="node5.html"> | ||
| 23 | <LINK REL="up" HREF="documentation.html"> | ||
| 24 | </HEAD> | ||
| 25 | |||
| 26 | <BODY > | ||
| 27 | <!--Navigation Panel--> | ||
| 28 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_g.png"> | ||
| 29 | <A NAME="tex2html251" | ||
| 30 | HREF="documentation.html"> | ||
| 31 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> | ||
| 32 | <A NAME="tex2html247" | ||
| 33 | HREF="node5.html"> | ||
| 34 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> | ||
| 35 | <A NAME="tex2html253" | ||
| 36 | HREF="node1.html"> | ||
| 37 | <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> | ||
| 38 | <BR> | ||
| 39 | <B> Up:</B> <A NAME="tex2html252" | ||
| 40 | HREF="documentation.html">Installing and Running mod_log_sql</A> | ||
| 41 | <B> Previous:</B> <A NAME="tex2html248" | ||
| 42 | HREF="node5.html">4 FAQ</A> | ||
| 43 | <B> <A NAME="tex2html254" | ||
| 44 | HREF="node1.html">Contents</A></B> | ||
| 45 | <BR> | ||
| 46 | <BR> | ||
| 47 | <!--End of Navigation Panel--> | ||
| 48 | |||
| 49 | <H1><A NAME="SECTION00060000000000000000"> | ||
| 50 | About this document ...</A> | ||
| 51 | </H1> | ||
| 52 | <STRONG>Installing and Running mod_log_sql</STRONG><P> | ||
| 53 | This document was generated using the | ||
| 54 | <A HREF="http://www.latex2html.org/"><STRONG>LaTeX</STRONG>2<tt>HTML</tt></A> translator Version 2002-1 (1.68) | ||
| 55 | <P> | ||
| 56 | Copyright © 1993, 1994, 1995, 1996, | ||
| 57 | <A HREF="http://cbl.leeds.ac.uk/nikos/personal.html">Nikos Drakos</A>, | ||
| 58 | Computer Based Learning Unit, University of Leeds. | ||
| 59 | <BR> | ||
| 60 | Copyright © 1997, 1998, 1999, | ||
| 61 | <A HREF="http://www.maths.mq.edu.au/~ross/">Ross Moore</A>, | ||
| 62 | Mathematics Department, Macquarie University, Sydney. | ||
| 63 | <P> | ||
| 64 | The command line arguments were: <BR> | ||
| 65 | <STRONG>latex2html</STRONG> <TT>-local_icons -show_section_numbers -split 4 -navigation -noindex_in_navigation -contents_in_navigation -dir Documentation/HTML Documentation/documentation.tex</TT> | ||
| 66 | <P> | ||
| 67 | The translation was initiated by Chris Powell on 2002-12-18 | ||
| 68 | <BR><HR> | ||
| 69 | <ADDRESS> | ||
| 70 | Chris Powell | ||
| 71 | 2002-12-18 | ||
| 72 | </ADDRESS> | ||
| 73 | </BODY> | ||
| 74 | </HTML> | ||
diff --git a/docs/prev.png b/docs/prev.png new file mode 100644 index 0000000..e60b8b4 --- /dev/null +++ b/docs/prev.png | |||
| Binary files differ | |||
diff --git a/docs/prev_g.png b/docs/prev_g.png new file mode 100644 index 0000000..476d956 --- /dev/null +++ b/docs/prev_g.png | |||
| Binary files differ | |||
diff --git a/docs/style_1.css b/docs/style_1.css new file mode 100644 index 0000000..f12a3af --- /dev/null +++ b/docs/style_1.css | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | body { | ||
| 2 | margin-left: 3%; | ||
| 3 | background-color: #ccccFF; | ||
| 4 | font-family: sans-serif; | ||
| 5 | } | ||
| 6 | |||
| 7 | h1 { | ||
| 8 | text-align: center; | ||
| 9 | } | ||
| 10 | |||
| 11 | h2 { | ||
| 12 | margin-left: -1%; | ||
| 13 | font-size: 150%; | ||
| 14 | } | ||
| 15 | |||
| 16 | h3 { | ||
| 17 | margin-left: -1%; | ||
| 18 | } | ||
| 19 | |||
| 20 | h4 { | ||
| 21 | text-align: center; | ||
| 22 | } | ||
| 23 | |||
| 24 | p { | ||
| 25 | } | ||
| 26 | |||
| 27 | pre { | ||
| 28 | font-family: monospace; | ||
| 29 | } | ||
| 30 | |||
| 31 | DD { | ||
| 32 | font-family: monospace; | ||
| 33 | } \ No newline at end of file | ||
diff --git a/docs/up.png b/docs/up.png new file mode 100644 index 0000000..3937e16 --- /dev/null +++ b/docs/up.png | |||
| Binary files differ | |||
diff --git a/docs/up_g.png b/docs/up_g.png new file mode 100644 index 0000000..54ceb68 --- /dev/null +++ b/docs/up_g.png | |||
| Binary files differ | |||
