From f1fd1c9714256bb9b212462dd31ca6dc56ea31ef Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Thu, 21 Jul 2011 19:10:20 -0400 Subject: add in project web page --- docs/node3.html | 664 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 664 insertions(+) create mode 100644 docs/node3.html (limited to 'docs/node3.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 @@ + + + + + +2 Installation + + + + + + + + + + + + + + + + + + + + +next + +up + +previous + +contents +
+ Next: 3 Configuration + Up: Installing and Running mod_log_sql + Previous: 1 Introduction +   Contents +
+
+ + +Subsections + + + +
+ +

+2 Installation +

+ +

+ +

+2.1 Requirements +

+ +

+ +

+ +

+ +

+2.2 Platform-specific notes +

+ +

+These installation documents assume a relatively modern GNU/Linux +scenario. mod_log_sql has been ported to other platforms; following +are notes on compiling the module for those platforms. + +

+ +

+2.2.1 Solaris +

+ +

+The nanosleep() function used in mod_log_sql relies on linking aginst +the librt library. Make the following alterations before proceeding: + +

+ +

    +
  1. In Makefile, search for the string ``-lmysqlclient -lz'' and change +it to read ``-lmysqlclient -lz -lrt'' +
  2. +
  3. In part 8a of section 2.5 below, change +``-lmysqlclient -lm -lz'' to read ``-lmysqlclient -lm -lz -lrt'' +
  4. +
+ +

+ +

+2.2.2 BSD +

+ +

+No notes are available at present, but they are desired. If you have +successfully ported mod_log_sql to BSD, please contact the maintaniner, Chris Powell (chris@grubbybaby.com) +and help fill in this section. + +

+ +

+2.2.3 Win32 +

+ +

+No notes are available at present, but they are desired. If you have +successfully ported mod_log_sql to Win32, please contact +the maintaniner, Chris Powell (chris@grubbybaby.com) and help +fill in this section. + +

+ +

+2.3 Do I want a DSO or a static module? +

+ +

+You need to know the answer to this question before you proceed. The +answer is pretty straightforward: what have you done in the past? +If you like all your Apache modules to be dynamic, then you should +keep doing that. If you're more of an old-school type and prefer to +compile the modules right into apache, do that. Both methods work +equally well. + +

+FWIW, the DSO method is more modern and increasing in popularity because +apxs takes care of a lot of dirty little details for you. As you'll +see below, the static-module method is a little more complex. + +

+ +

+2.4 Installation as an Apache DSO (Preferred) +

+ +

+ +

    +
  1. Perform all the following steps as root so that you have install privs, +etc. Unpack the archive into a working directory. + +

    + +

    +
    +
    # tar zxf mod_log_sql.tar.gz -C /usr/local/src  + +

    +# cd /usr/local/src/mod_log_sql +

    +
    +
  2. +
  3. Edit Makefile and change the values of the variables in the first +section. + +

    + +

      +
    1. These paths are necessary: + +

      +

      +
      APACHEINSTALLED:
      +
      the location where you installed Apache - usually +/usr/local/apache, 'locate apxs' can help you find it. +
      +
      APACHEHEADERS:
      +
      The location of your Apache header files, find using +'locate httpd.h' +
      +
      MYSQLLIBRARIES:
      +
      The location of your MySQL libraries, find using +'locate libmysqlclient.so' +
      +
      MYSQLHEADERS:
      +
      The location of your MySQL header files, find using +'locate mysql.h' +
      +
      +
    2. +
    3. Optional: if you compiled mod_ssl for Apache and want to +log SSL data such as 'keysize' and 'cipher type': + +

      +

      +
      MODSSLHEADERS:
      +
      the location of your mod_ssl header files, find +using 'locate mod_ssl.h' +
      +
      DB1HEADERS:
      +
      the location of your db1 header files, find using 'locate +ndbm.h' +
      +
      +
    4. +
    +You do not need to compile SSL support into mod_log_sql +in order to simply use it with a secure site. You only need to compile +SSL support into mod_log_sql if you want to log SSL-specific +data such as the cipher type. + +

    +

  4. +
  5. IMPORTANT: If you are not logging SSL info, comment out MODSSLHDRS +by putting a # character in front of it: + +

    + +

    +
    +
    #MODSSLHDRS=/usr/include/... +
    +
    +
  6. +
  7. Instruct apxs to compile the module as a DSO. + +

    + +

    +
    +
    # make dso +
    +
    You should see output similar to the following: + +

    + +

    +
    +
    /usr/local/Apache/bin/apxs -Wc,-O2 -Wc,-Wall -Wc,-DEAPI -c -I/usr/... + +

    +gcc -DLINUX=22 -DNO_DBM_REWRITEMAP -DMOD_SSL=208111 -DUSE_HS...  + +

    +gcc -shared -o mod_log_sql.so mod_log_sql.o -Wc,-O2 -Wc,-Wall -Wc... +

    +
    You should see no errors and have a new file called "mod_log_sql.so" +in your directory. + +

    +

  8. +
  9. Instruct apxs to install the DSO. + +

    + +

    +
    +
    # make dsoinstall +
    +
    You should see output similar to the following: + +

    + +

    +
    +
    /usr/local/Apache/bin/apxs -i mod_log_sql.so  + +

    +cp mod_log_sql.so /usr/local/Apache/libexec/mod_log_sql.so  + +

    +chmod 755 /usr/local/Apache/libexec/mod_log_sql.so  +

    +
    +
  10. +
  11. Load and activate the module in httpd.conf: + +

    + +

      +
    1. Insert this line in the same area as other logging modules, e.g. near +``LoadModule config_log_module'': + +

      + +

      +
      +
      LoadModule sql_log_module libexec/mod_log_sql.so +
      +
      +
    2. +
    3. Insert this line in the same area as other logging modules, e.g. near +``AddModule mod_log_config.c'': + +

      + +

      +
      +
      AddModule mod_log_sql.c +
      +
      +
    4. +
    +
  12. +
  13. Module ordering within httpd.conf is important if you are logging +SSL information. Please ensure that + +

    + +

    +
    +
    LoadModule ssl_module libexec/libssl.so +
    +
    comes before + +

    + +

    +
    +
    LoadModule sql_log_module libexec/mod_log_sql.so +
    +
    in your httpd.conf file. If they are out of order, simply cut-and-paste +the ``ssl_module'' section so that it is at the top. If you do +not, you will get this error when you start Apache: + +

    + +

    +
    +
    /usr/local/apache/libexec/mod_log_mysql.so: undefined symbol: ssl_var_lookup + +

    +/usr/local/apache/bin/apachectl startssl: httpd could not be started +

    +
    (mod_log_sql has a dependency on mod_ssl for SSL symbols. If the +statements are out of order, mod_log_sql cannot recognize those +symbols.) + +

    +Now skip below to section 3, Configuration. + +

    +

  14. +
+ +

+ +

+
+2.5 Installation as a static module compiled into +httpd +

+ +

+ +

    +
  1. Perform all the following steps as root so that you have install privs, +etc. +
  2. +
  3. Unpack the archive into a working directory. + +

    + +

    +
    +
    # tar zxf mod_log_sql.tar.gz -C /usr/local/src  + +

    +# cd /usr/local/src/mod_log_sql +

    +
    +
  4. +
  5. Edit Makefile and change the values of the variables +in the first section. + +

    + +

      +
    1. These are necessary: + +

      +

      +
      APACHEINSTALLED:
      +
      the location where you installed Apache - usually +/usr/local/apache, 'locate apxs' can help you find it. +
      +
      APACHESOURCE:
      +
      the location of your Apache sources, find +using 'locate ABOUT_APACHE' +
      +
      APACHEHEADERS:
      +
      the location of your Apache header files, find using +'locate httpd.h' +
      +
      MYSQLLIBRARIES:
      +
      the location of your MySQL libraries, find using +'locate libmysqlclient.so' +
      +
      MYSQLHEADERS:
      +
      the location of your MySQL header files, find using +'locate mysql.h' +
      +
      +
    2. +
    3. Optional: if you compiled mod_ssl for Apache and want to +log SSL data such as 'keysize' and 'cipher type': + +

      +

      +
      MODSSLHEADERS:
      +
      the location of your mod_ssl header files, find +using 'locate mod_ssl.h' +
      +
      DB1HEADERS:
      +
      the location of your db1 header files, find using 'locate +ndbm.h' +
      +
      +
    4. +
    +You do not need to compile SSL support into mod_log_sql +in order to simply use it with a secure site. You only need to compile +SSL support into mod_log_sql if you want to log SSL-specific +data such as the cipher type. + +

    +

  6. +
  7. IMPORTANT: If you are not logging SSL info, comment out MODSSLHDRS +by putting a # character in front of it: + +

    + +

    +
    +
    #MODSSLHDRS=/usr/include/... +
    +
    +
  8. +
  9. Compile the module. + +

    + +

    +
    +
    # make static +
    +
    You should see output similar to the following: + +

    + +

    +
    +
    gcc -fpic -O2 -Wall -I/usr/local/Apache/include -I/usr/include/mysql -I/usr/lo... +
    +
    You should see no errors and have a new file called "mod_log_sql.o" +in your directory. + +

    +

  10. +
  11. Install the module. + +

    + +

    +
    +
    # make statinstall +
    +
    +
  12. +
  13. Change to your Apache source directory. + +

    + +

    +
    +
    # cd /usr/local/src/apache-1.3.22/src +
    +
    +
  14. +
  15. Re-compile your httpd binary as follows. + +

    + +

      +
    1. Make these changes to Configuration.apaci: + +

      + +

        +
      • Append the following string to the EXTRA_LIBS= line. ("/usr/lib/mysql" +is from step 3, and is where your MySQL libraries +live): +
      • +
      + +
      +
      +
      -L/usr/lib/mysql -lmysqlclient -lm -lz +
      +
      +
        +
      • Find the mod_log_config.o line, and insert this line immediately +after it: +
      • +
      + +
      +
      +
      AddModule modules/sql/mod_log_sql.o +
      +
      +
    2. +
    3. # cp Configuration.apaci Configuration +
    4. +
    5. # ./Configure +
    6. +
    7. # make +
    8. +
    9. # strip httpd +
    10. +
    +
  16. +
  17. Test your new apache binary: + +

    + +

    +
    +
    # ./httpd -l +
    +
    You should see something like: + +

    + +

    +
    +
    Compiled-in modules:  + +

    +http_core.c + +

    +mod_log_sql.c       <- That's the line you're looking for. + +

    +mod_env.c  + +

    +mod_log_config.c  + +

    +mod_mime.c  + +

    +mod_negotiation.c + +

    +etc... +

    +
    +
  18. +
  19. Install your httpd binary. Copy it over your old httpd binary, wherever +it lives. You can and should rename your old httpd first so that you +can easily revert to that working version in case of bugs with the +new version. + +

    + +

    +
    +
    # /etc/rc.d/init.d/httpd stop  + +

    +# mv /usr/local/Apache/bin/httpd ~/httpd-save  + +

    +# cp -f ./httpd /usr/local/Apache/bin/ +

    +
    +
  20. +
+ +

+


+ + +next + +up + +previous + +contents +
+ Next: 3 Configuration + Up: Installing and Running mod_log_sql + Previous: 1 Introduction +   Contents + +
+Chris Powell +2002-12-18 +
+ + -- cgit