summaryrefslogtreecommitdiffstatsabout
path: root/docs/node3.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/node3.html')
-rw-r--r--docs/node3.html664
1 files changed, 664 insertions, 0 deletions
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)
4original 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 &nbsp; <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
77httpd</A>
78</UL>
79<!--End of Table of Child-Links-->
80<HR>
81
82<H1><A NAME="SECTION00030000000000000000">
832 Installation</A>
84</H1>
85
86<P>
87
88<H2><A NAME="SECTION00031000000000000000">
892.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
96based on Red Hat Linux (Red Hat, Mandrake), but the module should
97easily adapt to any modern distribution. mod_log_sql has also been
98ported successfully to Solaris and FreeBSD.
99</LI>
100<LI>Apache 1.2 or 1.3. Ideally you should already have successfully compiled
101Apache and understand the process, but this document tries to make
102it simple for beginners.
103</LI>
104<LI>The MySQL development headers. This package is called different things
105on different distros. For example, Red Hat 6.x calls this RPM ``MySQL-devel''
106whereas Mandrake calls it ``libmysql10-devel.''
107</LI>
108<LI>MySQL &gt;= 3.23.15 configured, installed and running on either localhost
109or an accessible networked machine. You should already have a basic
110understanding of MySQL and how it functions.
111</LI>
112<LI>Optionally, if you want to be able to log SSL information such as
113keysize or cipher, you need OpenSSL and mod_ssl installed.
114</LI>
115</UL>
116
117<P>
118
119<H2><A NAME="SECTION00032000000000000000">
1202.2 Platform-specific notes</A>
121</H2>
122
123<P>
124These installation documents assume a relatively modern GNU/Linux
125scenario. mod_log_sql has been ported to other platforms; following
126are notes on compiling the module for those platforms.
127
128<P>
129
130<H3><A NAME="SECTION00032100000000000000">
1312.2.1 Solaris</A>
132</H3>
133
134<P>
135The nanosleep() function used in mod_log_sql relies on linking aginst
136the 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
142it 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">
1522.2.2 BSD</A>
153</H3>
154
155<P>
156No notes are available at present, but they are desired. If you have
157successfully ported mod_log_sql to BSD, <I>please</I> contact the maintaniner, Chris Powell (chris@grubbybaby.com)
158and help fill in this section.
159
160<P>
161
162<H3><A NAME="SECTION00032300000000000000">
1632.2.3 Win32</A>
164</H3>
165
166<P>
167No notes are available at present, but they are desired. If you have
168successfully ported mod_log_sql to Win32, <I>please</I> contact
169the maintaniner, Chris Powell (chris@grubbybaby.com) and help
170fill in this section.
171
172<P>
173
174<H2><A NAME="SECTION00033000000000000000">
1752.3 Do I want a DSO or a static module?</A>
176</H2>
177
178<P>
179You need to know the answer to this question before you proceed. The
180answer is pretty straightforward: what have you done in the past?
181If you like all your Apache modules to be dynamic, then you should
182keep doing that. If you're more of an old-school type and prefer to
183compile the modules right into apache, do that. Both methods work
184equally well.
185
186<P>
187FWIW, the DSO method is more modern and increasing in popularity because
188apxs takes care of a lot of dirty little details for you. As you'll
189see below, the static-module method is a little more complex.
190
191<P>
192
193<H2><A NAME="SECTION00034000000000000000">
1942.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,
201etc. Unpack the archive into a working directory.
202
203<P>
204
205<DL COMPACT>
206<DT>
207<DD>#&nbsp;tar&nbsp;zxf&nbsp;mod_log_sql.tar.gz&nbsp;-C&nbsp;/usr/local/src&nbsp;
208
209<P>
210#&nbsp;cd&nbsp;/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
215section.
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
243log 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
249using 'locate mod_ssl.h'
250</DD>
251<DT><STRONG>DB1HEADERS:</STRONG></DT>
252<DD>the location of your db1 header files, find using 'locate
253ndbm.h'
254</DD>
255</DL>
256</LI>
257</OL>
258You do <B>not</B> need to compile SSL support into mod_log_sql
259in order to simply use it with a secure site. You only need to compile
260SSL support into mod_log_sql <B>if you want to log SSL-specific
261data</B> such as the cipher type.
262
263<P>
264</LI>
265<LI>IMPORTANT: If you are not logging SSL info, comment out MODSSLHDRS
266by 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>#&nbsp;make&nbsp;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&nbsp;-Wc,-O2&nbsp;-Wc,-Wall&nbsp;-Wc,-DEAPI&nbsp;-c&nbsp;-I/usr/...
291
292<P>
293gcc&nbsp;-DLINUX=22&nbsp;-DNO_DBM_REWRITEMAP&nbsp;-DMOD_SSL=208111&nbsp;-DUSE_HS...&nbsp;
294
295<P>
296gcc&nbsp;-shared&nbsp;-o&nbsp;mod_log_sql.so&nbsp;mod_log_sql.o&nbsp;-Wc,-O2&nbsp;-Wc,-Wall&nbsp;-Wc...
297</DD>
298</DL>You should see no errors and have a new file called &#34;mod_log_sql.so&#34;
299in 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>#&nbsp;make&nbsp;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&nbsp;-i&nbsp;mod_log_sql.so&nbsp;
318
319<P>
320cp&nbsp;mod_log_sql.so&nbsp;/usr/local/Apache/libexec/mod_log_sql.so&nbsp;
321
322<P>
323chmod&nbsp;755&nbsp;/usr/local/Apache/libexec/mod_log_sql.so&nbsp;
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&nbsp;sql_log_module&nbsp;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&nbsp;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
357SSL information. Please ensure that
358
359<P>
360
361<DL COMPACT>
362<DT>
363<DD>LoadModule&nbsp;ssl_module&nbsp;libexec/libssl.so
364</DD>
365</DL>comes before
366
367<P>
368
369<DL COMPACT>
370<DT>
371<DD>LoadModule&nbsp;sql_log_module&nbsp;libexec/mod_log_sql.so
372</DD>
373</DL>in your httpd.conf file. If they are out of order, simply cut-and-paste
374the ``ssl_module'' section so that it is at the top. If you do
375not, 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:&nbsp;undefined&nbsp;symbol:&nbsp;ssl_var_lookup
382
383<P>
384/usr/local/apache/bin/apachectl&nbsp;startssl:&nbsp;httpd&nbsp;could&nbsp;not&nbsp;be&nbsp;started
385</DD>
386</DL>(mod_log_sql has a dependency on mod_ssl for SSL symbols. If the
387statements are out of order, mod_log_sql cannot recognize those
388symbols.)
389
390<P>
391Now 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>
4012.5 Installation as a static module compiled into
402httpd
403</H2>
404
405<P>
406
407<OL>
408<LI>Perform all the following steps as root so that you have install privs,
409etc.
410</LI>
411<LI>Unpack the archive into a working directory.
412
413<P>
414
415<DL COMPACT>
416<DT>
417<DD>#&nbsp;tar&nbsp;zxf&nbsp;mod_log_sql.tar.gz&nbsp;-C&nbsp;/usr/local/src&nbsp;
418
419<P>
420#&nbsp;cd&nbsp;/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
425in 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
440using '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
457log 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
463using 'locate mod_ssl.h'
464</DD>
465<DT><STRONG>DB1HEADERS:</STRONG></DT>
466<DD>the location of your db1 header files, find using 'locate
467ndbm.h'
468</DD>
469</DL>
470</LI>
471</OL>
472You do <B>not</B> need to compile SSL support into mod_log_sql
473in order to simply use it with a secure site. You only need to compile
474SSL support into mod_log_sql <B>if you want to log SSL-specific
475data</B> such as the cipher type.
476
477<P>
478</LI>
479<LI>IMPORTANT: If you are not logging SSL info, comment out MODSSLHDRS
480by 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>#&nbsp;make&nbsp;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&nbsp;-fpic&nbsp;-O2&nbsp;-Wall&nbsp;-I/usr/local/Apache/include&nbsp;-I/usr/include/mysql&nbsp;-I/usr/lo...
505</DD>
506</DL>You should see no errors and have a new file called &#34;mod_log_sql.o&#34;
507in your directory.
508
509<P>
510</LI>
511<LI>Install the module.
512
513<P>
514
515<DL COMPACT>
516<DT>
517<DD>#&nbsp;make&nbsp;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>#&nbsp;cd&nbsp;/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. (&#34;/usr/lib/mysql&#34;
542is from step <A HREF="node3.html#step:editMF">3</A>, and is where your MySQL libraries
543live):
544</LI>
545</UL>
546
547<DL COMPACT>
548<DT>
549<DD>-L/usr/lib/mysql&nbsp;-lmysqlclient&nbsp;-lm&nbsp;-lz
550</DD>
551</DL>
552<UL>
553<LI>Find the mod_log_config.o line, and insert this line immediately
554after it:
555</LI>
556</UL>
557
558<DL COMPACT>
559<DT>
560<DD>AddModule&nbsp;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>#&nbsp;./httpd&nbsp;-l
581</DD>
582</DL>You should see something like:
583
584<P>
585
586<DL COMPACT>
587<DT>
588<DD>Compiled-in&nbsp;modules:&nbsp;
589
590<P>
591http_core.c
592
593<P>
594mod_log_sql.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;-&nbsp;That's&nbsp;the&nbsp;line&nbsp;you're&nbsp;looking&nbsp;for.
595
596<P>
597mod_env.c&nbsp;
598
599<P>
600mod_log_config.c&nbsp;
601
602<P>
603mod_mime.c&nbsp;
604
605<P>
606mod_negotiation.c
607
608<P>
609etc...
610</DD>
611</DL>
612</LI>
613<LI>Install your httpd binary. Copy it over your old httpd binary, wherever
614it lives. You can and should rename your old httpd first so that you
615can easily revert to that working version in case of bugs with the
616new version.
617
618<P>
619
620<DL COMPACT>
621<DT>
622<DD>#&nbsp;/etc/rc.d/init.d/httpd&nbsp;stop&nbsp;
623
624<P>
625#&nbsp;mv&nbsp;/usr/local/Apache/bin/httpd&nbsp;~/httpd-save&nbsp;
626
627<P>
628#&nbsp;cp&nbsp;-f&nbsp;./httpd&nbsp;/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 &nbsp; <B> <A NAME="tex2html151"
657 HREF="node1.html">Contents</A></B>
658<!--End of Navigation Panel-->
659<ADDRESS>
660Chris Powell
6612002-12-18
662</ADDRESS>
663</BODY>
664</HTML>