summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorGravatar Christopher Powell 2002-11-19 07:13:47 +0000
committerGravatar Christopher Powell 2002-11-19 07:13:47 +0000
commitc00607cbde2fc719bfc1af4e9c58a9eb4eccf691 (patch)
tree6013b32af0d29bf720326ef3e75f0fae38c4e4f7 /Documentation
parenteafbfbc64e316e6b0f59dd8987ff53eeed9a7539 (diff)
Some more doc edits & cleanup.
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/documentation.lyx410
1 files changed, 278 insertions, 132 deletions
diff --git a/Documentation/documentation.lyx b/Documentation/documentation.lyx
index efca178..39daba8 100644
--- a/Documentation/documentation.lyx
+++ b/Documentation/documentation.lyx
@@ -422,11 +422,14 @@ Perform all the following steps as root so that you have install privs,
422\end_deeper 422\end_deeper
423\layout Enumerate 423\layout Enumerate
424 424
425Edit Makefile for your system. 425Edit Makefile for your system:
426\begin_deeper 426\begin_deeper
427\layout Standard 427\layout Enumerate
428 428
429NECESSARY: 429These are
430\series bold
431necessary:
432\begin_deeper
430\layout Itemize 433\layout Itemize
431 434
432The location where you installed Apache -- usually /usr/local/apache, 'locate 435The location where you installed Apache -- usually /usr/local/apache, 'locate
@@ -437,13 +440,30 @@ The location of your MySQL libraries, find using 'locate libmysqlclient'
437\layout Itemize 440\layout Itemize
438 441
439The location of your MySQL header files, find using 'locate mysql.h' 442The location of your MySQL header files, find using 'locate mysql.h'
440\layout Standard 443\end_deeper
444\layout Enumerate
441 445
442OPTIONAL if you have included mod_ssl in Apache and want to log SSL data 446This is
443 such as keysize and cipher type: 447\series bold
448optional
449\series default
450: if you have included mod_ssl in Apache and want to log SSL data such as
451 keysize and cipher type:
452\begin_deeper
444\layout Itemize 453\layout Itemize
445 454
446The location of your SSL header files, find using 'locate mod_ssl.h' 455The location of your SSL header files, find using 'locate mod_ssl.h'
456\end_deeper
457\layout Standard
458
459Note: you do
460\series bold
461not
462\series default
463need to compile SSL support into mod_log_sql in order to simply use it with
464 a secure site.
465 You only need to compile SSL support into mod_log_sql if you want to log
466 SSL-specific data such as cipher type.
447\layout Standard 467\layout Standard
448 468
449Now that you know these things, edit Makefile and replace the stock values 469Now that you know these things, edit Makefile and replace the stock values
@@ -528,8 +548,8 @@ in your httpd.conf file.
528/usr/local/apache/bin/apachectl startssl: httpd could not be started 548/usr/local/apache/bin/apachectl startssl: httpd could not be started
529\layout Standard 549\layout Standard
530 550
531(If the statements are out of order, mod_log_sql doesn't recognize the SSL 551(mod_log_sql has a dependency on mod_ssl for SSL symbols.
532 symbols that mod_ssl provides.) 552 If the statements are out of order, mod_log_sql can't recognize those symbols.)
533\layout Standard 553\layout Standard
534 554
535Now skip below to section 555Now skip below to section
@@ -575,9 +595,12 @@ Unpack the archive into a working directory.
575 595
576Edit Makefile for your system. 596Edit Makefile for your system.
577\begin_deeper 597\begin_deeper
578\layout Standard 598\layout Enumerate
579 599
580NECESSARY: 600These are
601\series bold
602necessary:
603\begin_deeper
581\layout Itemize 604\layout Itemize
582 605
583The location where you installed Apache -- usually /usr/local/apache, 'locate 606The location where you installed Apache -- usually /usr/local/apache, 'locate
@@ -593,10 +616,16 @@ The location of your MySQL header files, find using 'locate mysql.h'
593\layout Itemize 616\layout Itemize
594 617
595The location of your MySQL libraries, find using 'locate libmysqlclient' 618The location of your MySQL libraries, find using 'locate libmysqlclient'
596\layout Standard 619\end_deeper
620\layout Enumerate
597 621
598OPTIONAL if you have included mod_ssl in Apache and want to log SSL data 622This is
599 such as keysize and cipher type: 623\series bold
624optional
625\series default
626: if you have included mod_ssl in Apache and want to log SSL data such as
627 keysize and cipher type:
628\begin_deeper
600\layout Itemize 629\layout Itemize
601 630
602The location of your mod_ssl header files, find using 'locate mod_ssl.h' 631The location of your mod_ssl header files, find using 'locate mod_ssl.h'
@@ -606,6 +635,17 @@ The location of your OpenSSL header files, find using 'locate x509.h'
606\layout Itemize 635\layout Itemize
607 636
608The location of your db1 header files, find using 'locate mpool.h' 637The location of your db1 header files, find using 'locate mpool.h'
638\end_deeper
639\layout Standard
640
641Note: you do
642\series bold
643not
644\series default
645need to compile SSL support into mod_log_sql in order to simply use it with
646 a secure site.
647 You only need to compile SSL support into mod_log_sql if you want to log
648 SSL-specific data such as cipher type.
609\layout Standard 649\layout Standard
610 650
611Now that you know these things, edit Makefile and replace the stock values 651Now that you know these things, edit Makefile and replace the stock values
@@ -1408,6 +1448,11 @@ LogSQLCreateTables On
1408 1448
1409The module is permitted to create all necessary tables and to make intelligent, 1449The module is permitted to create all necessary tables and to make intelligent,
1410 on-the-fly configuration of each VirtualHost. 1450 on-the-fly configuration of each VirtualHost.
1451 (
1452\noun on
1453LogSQLMassVirtualHosting On
1454\noun default
1455)
1411\layout Standard 1456\layout Standard
1412 1457
1413Many users are happy to use the module in its most minimal form: they hand-creat 1458Many users are happy to use the module in its most minimal form: they hand-creat
@@ -1514,6 +1559,83 @@ LogSQLTransferLogFormat
1514 machine and thereby analyze the front-end loadbalancing algorithm. 1559 machine and thereby analyze the front-end loadbalancing algorithm.
1515\layout Subsubsection 1560\layout Subsubsection
1516 1561
1562Using the same database for production and test
1563\layout Standard
1564
1565Although suboptimal, it is not uncommon to use the same backend database
1566 for the
1567\begin_inset Quotes eld
1568\end_inset
1569
1570production
1571\begin_inset Quotes erd
1572\end_inset
1573
1574 webservers as well as the
1575\begin_inset Quotes eld
1576\end_inset
1577
1578test
1579\begin_inset Quotes erd
1580\end_inset
1581
1582 webservers (budgetary constraints, rackspace limits, etc.).
1583 Furthermore, an administrator in this situation may be unable to use
1584\noun on
1585LogSQLRemhostIgnore
1586\noun default
1587to exclude requests from the test servers -- perhaps the generated entries
1588 are genuinely useful for analytical or QA purposes, but their value after
1589 analysis is minimal.
1590\layout Standard
1591
1592It is wasteful and potentially confusing to permit this internal test data
1593 to clutter the database, and a solution to the problem is the proper use
1594 of the
1595\noun on
1596LogSQLMachineID
1597\noun default
1598directive.
1599 Assume a scenario where the production webservers have IDs like
1600\begin_inset Quotes eld
1601\end_inset
1602
1603web01,
1604\begin_inset Quotes erd
1605\end_inset
1606
1607
1608\begin_inset Quotes eld
1609\end_inset
1610
1611web02,
1612\begin_inset Quotes erd
1613\end_inset
1614
1615 and so on -- and the test webservers have IDs like
1616\begin_inset Quotes eld
1617\end_inset
1618
1619test01,
1620\begin_inset Quotes erd
1621\end_inset
1622
1623
1624\begin_inset Quotes eld
1625\end_inset
1626
1627test02,
1628\begin_inset Quotes erd
1629\end_inset
1630
1631 etc.
1632 Because entries in the log database are distinguished by their source machine,
1633 an administrator may purge unneeded test data from the access log as follows:
1634\layout LyX-Code
1635
1636delete from access_log where machine_id like 'test%';
1637\layout Subsubsection
1638
1517 1639
1518\begin_inset LatexCommand \label{secMulTable} 1640\begin_inset LatexCommand \label{secMulTable}
1519 1641
@@ -1570,11 +1692,14 @@ access_log
1570\align center 1692\align center
1571 1693
1572\begin_inset Tabular 1694\begin_inset Tabular
1573<lyxtabular version="3" rows="2" columns="3"> 1695<lyxtabular version="3" rows="2" columns="6">
1574<features> 1696<features>
1575<column alignment="left" valignment="top" leftline="true" width="0pt"> 1697<column alignment="left" valignment="top" leftline="true" width="0pt">
1576<column alignment="left" valignment="top" leftline="true" width="0pt"> 1698<column alignment="left" valignment="top" leftline="true" width="0pt">
1577<column alignment="left" valignment="top" leftline="true" rightline="true" width="0pt"> 1699<column alignment="left" valignment="top" leftline="true" rightline="true" width="0pt">
1700<column alignment="left" valignment="top" rightline="true" width="0pt">
1701<column alignment="left" valignment="top" rightline="true" width="0pt">
1702<column alignment="left" valignment="top" rightline="true" width="0pt">
1578<row topline="true" bottomline="true"> 1703<row topline="true" bottomline="true">
1579<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> 1704<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1580\begin_inset Text 1705\begin_inset Text
@@ -1600,6 +1725,30 @@ remote_host
1600request_uri 1725request_uri
1601\end_inset 1726\end_inset
1602</cell> 1727</cell>
1728<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1729\begin_inset Text
1730
1731\layout Standard
1732
1733time_stamp
1734\end_inset
1735</cell>
1736<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1737\begin_inset Text
1738
1739\layout Standard
1740
1741status
1742\end_inset
1743</cell>
1744<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1745\begin_inset Text
1746
1747\layout Standard
1748
1749bytes_sent
1750\end_inset
1751</cell>
1603</row> 1752</row>
1604<row topline="true" bottomline="true"> 1753<row topline="true" bottomline="true">
1605<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> 1754<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
@@ -1607,7 +1756,7 @@ request_uri
1607 1756
1608\layout Standard 1757\layout Standard
1609 1758
1610XYZ123 1759PPIDskBRH30AAGPtAsg
1611\end_inset 1760\end_inset
1612</cell> 1761</cell>
1613<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> 1762<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
@@ -1615,7 +1764,7 @@ XYZ123
1615 1764
1616\layout Standard 1765\layout Standard
1617 1766
1618foo.bar.com 1767zerberus.aiacs.net
1619\end_inset 1768\end_inset
1620</cell> 1769</cell>
1621<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> 1770<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
@@ -1626,6 +1775,30 @@ foo.bar.com
1626/index.html 1775/index.html
1627\end_inset 1776\end_inset
1628</cell> 1777</cell>
1778<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1779\begin_inset Text
1780
1781\layout Standard
1782
17831022493617
1784\end_inset
1785</cell>
1786<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1787\begin_inset Text
1788
1789\layout Standard
1790
1791200
1792\end_inset
1793</cell>
1794<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1795\begin_inset Text
1796
1797\layout Standard
1798
17992215
1800\end_inset
1801</cell>
1629</row> 1802</row>
1630</lyxtabular> 1803</lyxtabular>
1631 1804
@@ -1688,7 +1861,7 @@ val
1688 1861
1689\layout Standard 1862\layout Standard
1690 1863
1691XYZ123 1864PPIDskBRH30AAGPtAsg
1692\end_inset 1865\end_inset
1693</cell> 1866</cell>
1694<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> 1867<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
@@ -1714,7 +1887,7 @@ OK
1714 1887
1715\layout Standard 1888\layout Standard
1716 1889
1717XYZ123 1890PPIDskBRH30AAGPtAsg
1718\end_inset 1891\end_inset
1719</cell> 1892</cell>
1720<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> 1893<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
@@ -1798,7 +1971,7 @@ val
1798 1971
1799\layout Standard 1972\layout Standard
1800 1973
1801XYZ123 1974PPIDskBRH30AAGPtAsg
1802\end_inset 1975\end_inset
1803</cell> 1976</cell>
1804<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> 1977<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
@@ -1824,7 +1997,7 @@ text/html
1824 1997
1825\layout Standard 1998\layout Standard
1826 1999
1827XYZ123 2000PPIDskBRH30AAGPtAsg
1828\end_inset 2001\end_inset
1829</cell> 2002</cell>
1830<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> 2003<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
@@ -1850,7 +2023,7 @@ gzip, deflate
1850 2023
1851\layout Standard 2024\layout Standard
1852 2025
1853XYZ123 2026PPIDskBRH30AAGPtAsg
1854\end_inset 2027\end_inset
1855</cell> 2028</cell>
1856<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> 2029<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
@@ -1876,7 +2049,7 @@ Tue, 28 May 2002 10:00:18 GMT
1876 2049
1877\layout Standard 2050\layout Standard
1878 2051
1879XYZ123 2052PPIDskBRH30AAGPtAsg
1880\end_inset 2053\end_inset
1881</cell> 2054</cell>
1882<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> 2055<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
@@ -1910,7 +2083,7 @@ We have a certain request, and its unique ID is
1910\begin_inset Quotes eld 2083\begin_inset Quotes eld
1911\end_inset 2084\end_inset
1912 2085
1913XYZ123 2086PPIDskBRH30AAGPtAsg
1914\begin_inset Quotes erd 2087\begin_inset Quotes erd
1915\end_inset 2088\end_inset
1916 2089
@@ -1932,8 +2105,8 @@ XYZ123
1932 2105
1933\end_inset 2106\end_inset
1934 2107
1935, you have a one-to-many relationship for request XYZ123: that one access 2108, you have a one-to-many relationship for request PPIDskBRH30AAGPtAsg: that
1936 has two associated notes and four associated headers. 2109 one access has two associated notes and four associated headers.
1937 You can extract this data easily using the power of SQL's 2110 You can extract this data easily using the power of SQL's
1938\begin_inset Quotes eld 2111\begin_inset Quotes eld
1939\end_inset 2112\end_inset
@@ -2011,7 +2184,7 @@ zerberus.aiacs.net
2011 2184
2012\layout Standard 2185\layout Standard
2013 2186
2014/mod_log_sql/style_1.css 2187/mod_log_sql/index.html
2015\end_inset 2188\end_inset
2016</cell> 2189</cell>
2017<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> 2190<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
@@ -2027,7 +2200,7 @@ mod_gzip_result
2027 2200
2028\layout Standard 2201\layout Standard
2029 2202
2030DECLINED:EXCLUDED 2203OK
2031\end_inset 2204\end_inset
2032</cell> 2205</cell>
2033</row> 2206</row>
@@ -2045,7 +2218,7 @@ zerberus.aiacs.net
2045 2218
2046\layout Standard 2219\layout Standard
2047 2220
2048/mod_log_sql/style_1.css 2221/mod_log_sql/index.html
2049\end_inset 2222\end_inset
2050</cell> 2223</cell>
2051<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> 2224<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
@@ -2061,7 +2234,7 @@ mod_gzip_compression_ratio
2061 2234
2062\layout Standard 2235\layout Standard
2063 2236
20640 223769
2065\end_inset 2238\end_inset
2066</cell> 2239</cell>
2067</row> 2240</row>
@@ -2074,6 +2247,11 @@ mod_gzip_compression_ratio
2074 2247
2075\layout Standard 2248\layout Standard
2076 2249
2250Naturally you can craft similar statements for the outboud headers, inbound
2251 headers and cookies, all of which can live in separate tables.
2252 Your statements are limited in power only by your skill with SQL.
2253\layout Standard
2254
2077In order to use this capability of mod_log_sql, you must do several things: 2255In order to use this capability of mod_log_sql, you must do several things:
2078\layout Itemize 2256\layout Itemize
2079 2257
@@ -2085,8 +2263,12 @@ Compile mod_unique_id into Apache (statically or as a DSO).
2085\layout Itemize 2263\layout Itemize
2086 2264
2087Create the appropriate tables. 2265Create the appropriate tables.
2088 This will be done for you if you permit mod_log_sql to create its own tables, 2266 This will be done for you if you permit mod_log_sql to create its own tables
2089 or if you use the enclosed 2267 using
2268\noun on
2269LogSQLCreateTables On
2270\noun default
2271, or if you use the enclosed
2090\begin_inset Quotes eld 2272\begin_inset Quotes eld
2091\end_inset 2273\end_inset
2092 2274
@@ -2122,11 +2304,11 @@ LogSQL*LogTable
2122 directives to tell the module what and where to log the data. 2304 directives to tell the module what and where to log the data.
2123 In the following example, I have overridden the name for the notes table 2305 In the following example, I have overridden the name for the notes table
2124 whereas I have left the other table names at their defaults. 2306 whereas I have left the other table names at their defaults.
2125 I then specified the cookies, headers and notes that interest me. 2307 I have then specified the cookies, headers and notes that interest me.
2126 As you can see, these directives do not require me to add any characters 2308 (And as you can see, these directives do not require me to add any characters
2127 to 2309 to
2128\noun on 2310\noun on
2129LogSQLTransferLogTable. 2311LogSQLTransferLogTable.)
2130\layout LyX-Code 2312\layout LyX-Code
2131 2313
2132<VirtualHost 216.231.36.128> 2314<VirtualHost 216.231.36.128>
@@ -2154,83 +2336,6 @@ LogSQLTransferLogTable.
2154\layout LyX-Code 2336\layout LyX-Code
2155 2337
2156</VirtualHost> 2338</VirtualHost>
2157\layout Subsubsection
2158
2159Using the same database for production and test
2160\layout Standard
2161
2162Although suboptimal, it is not uncommon to use the same backend database
2163 for the
2164\begin_inset Quotes eld
2165\end_inset
2166
2167production
2168\begin_inset Quotes erd
2169\end_inset
2170
2171 webservers as well as the
2172\begin_inset Quotes eld
2173\end_inset
2174
2175test
2176\begin_inset Quotes erd
2177\end_inset
2178
2179 webservers (budgetary constraints, rackspace limits, etc.).
2180 Furthermore, an administrator in this situation may be unable to use
2181\noun on
2182LogSQLRemhostIgnore
2183\noun default
2184to exclude requests from the test servers -- perhaps the generated entries
2185 are genuinely useful for analytical or QA purposes, but their value after
2186 analysis is minimal.
2187\layout Standard
2188
2189It is wasteful and potentially confusing to permit this internal test data
2190 to clutter the database, and a solution to the problem is the proper use
2191 of the
2192\noun on
2193LogSQLMachineID
2194\noun default
2195directive.
2196 Assume a scenario where the production webservers have IDs like
2197\begin_inset Quotes eld
2198\end_inset
2199
2200web01,
2201\begin_inset Quotes erd
2202\end_inset
2203
2204
2205\begin_inset Quotes eld
2206\end_inset
2207
2208web02,
2209\begin_inset Quotes erd
2210\end_inset
2211
2212 and so on -- and the test webservers have IDs like
2213\begin_inset Quotes eld
2214\end_inset
2215
2216test01,
2217\begin_inset Quotes erd
2218\end_inset
2219
2220
2221\begin_inset Quotes eld
2222\end_inset
2223
2224test02,
2225\begin_inset Quotes erd
2226\end_inset
2227
2228 etc.
2229 Because entries in the log database are distinguished by their source machine,
2230 an administrator may purge unneeded test data from the access log as follows:
2231\layout LyX-Code
2232
2233delete from access_log where machine_id like 'test%';
2234\layout Subsection 2339\layout Subsection
2235 2340
2236 2341
@@ -5648,14 +5753,23 @@ LogSQLWhichCookies
5648What are the SSL logging features, and how do I activate them? 5753What are the SSL logging features, and how do I activate them?
5649\layout Standard 5754\layout Standard
5650 5755
5651If you run an SSL-enabled server you may benefit from logging some SSL details. 5756Note: you do
5652 mod_log_sql now supports this ability. 5757\series bold
5653 By adding certain characters to your 5758not
5759\series default
5760need to compile SSL support into mod_log_sql in order to simply use it with
5761 a secure site.
5762 You only need to compile SSL support into mod_log_sql if you want to log
5763 SSL-specific data such as the cipher type used, or the keysize that was
5764 negotiated.
5765\layout Standard
5766
5767By adding certain characters to your
5654\noun on 5768\noun on
5655LogSQLTransferLogFormat 5769LogSQLTransferLogFormat
5656\noun default 5770\noun default
5657 string you can tell mod_log_sql to log the SSL cipher, the SSL keysize 5771 string you can tell mod_log_sql to log the SSL cipher, the SSL keysize
5658 of the connection, and the Max-keysize that was available. 5772 of the connection, and the maximum keysize that was available.
5659 This would let you tell, for example, which clients were using only export-grad 5773 This would let you tell, for example, which clients were using only export-grad
5660e security to access your secure software area. 5774e security to access your secure software area.
5661\layout Standard 5775\layout Standard
@@ -5697,11 +5811,21 @@ Qqz
5697</VirtualHost> 5811</VirtualHost>
5698\layout Standard 5812\layout Standard
5699 5813
5700The last three characters (Qqz) in the directive are the SSL ones; see the 5814The last three characters (Qqz) in the directive are the SSL ones; see section
5701 directives documentation for details. 5815
5816\begin_inset LatexCommand \ref{sub:Frmat}
5817
5818\end_inset
5819
5820 in the directives documentation for details of the
5821\noun on
5822LogSQLTransferLogFormat
5823\noun default
5824 directive.
5702\layout Standard 5825\layout Standard
5703 5826
5704Perform some hits on your server and run a select: 5827Restart Apache, then perform some hits on your server.
5828 Then run the following select statement:
5705\layout LyX-Code 5829\layout LyX-Code
5706 5830
5707mysql> select remote_host,request_uri,ssl_cipher,ssl_keysize,ssl_maxkeysize 5831mysql> select remote_host,request_uri,ssl_cipher,ssl_keysize,ssl_maxkeysize
@@ -5901,30 +6025,52 @@ RC4-MD5
5901Does mod_log_sql connect to MySQL via TCP/IP or a socket? 6025Does mod_log_sql connect to MySQL via TCP/IP or a socket?
5902\layout Standard 6026\layout Standard
5903 6027
5904It depends! This actually is not determined by mod_log_sql. 6028It depends! This is not determined by mod_log_sql.
5905 mod_log_sql relies on a connection command that is supplied in the MySQL 6029 mod_log_sql relies on a connection command that is supplied in the MySQL
5906 API, and that command is somewhat intelligent. 6030 API, and that command is somewhat intelligent.
5907 When mod_log_sql issues the connect command to MySQL, this intelligent 6031 How it works:
5908 connect command uses sockets to communicate with MySQL if the specified 6032\layout Itemize
5909 MySQL database is on the same machine (because sockets are more efficient 6033
5910 than TCP/IP). 6034if the specified MySQL database is on the same machine, the connection command
5911 However, if the specified MySQL db is on a different machine, mod_log_sql 6035 uses a socket to communicate with MySQL
5912 connects using TCP/IP. 6036\layout Itemize
5913 You don't have any control of which methodology is used. 6037
6038if the specified MySQL database is on a different machine, mod_log_sql connects
6039 using TCP/IP.
6040
5914\layout Standard 6041\layout Standard
5915 6042
5916You do have control over where mod_log_sql looks for the socket. 6043You don't have any control of which methodology is used.
6044 You can fine-tune some of the configuration, however.
5917 The 6045 The
5918\noun on 6046\noun on
5919LogSQLSocketFile 6047LogSQLSocketFile
5920\noun default 6048\noun default
5921 runtime configuration directive overrides the default of "/var/lib/mysql/mysql.s 6049 runtime configuration directive overrides the default of
5922ock" to whatever you wish. 6050\begin_inset Quotes eld
5923 (Applies to mod_log_sql 1.16 or later only.) 6051\end_inset
6052
6053/var/lib/mysql/mysql.sock
6054\begin_inset Quotes erd
6055\end_inset
6056
6057 for socket-based connections, whereas the
6058\noun on
6059LogSQLTCPPort
6060\noun default
6061 command allows to you override the default TCP port of 3306 for TCP/IP
6062 connections.
5924\layout Subsection 6063\layout Subsection
5925 6064
5926Why do I occasionally see a "lost connection to MySQL server" message in 6065Why do I occasionally see a
5927 my error-log? 6066\begin_inset Quotes eld
6067\end_inset
6068
6069lost connection to MySQL server
6070\begin_inset Quotes erd
6071\end_inset
6072
6073 message in my error-log?
5928\layout Standard 6074\layout Standard
5929 6075
5930This message may appear every now and then in your Apache error log, especially 6076This message may appear every now and then in your Apache error log, especially