EDV:Apache2 mysql auth: Difference between revisions

From KIP Wiki
⧼kip-jumptonavigation⧽⧼kip-jumptosearch⧽
No edit summary
No edit summary
Line 41: Line 41:
apxs2 -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c
apxs2 -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c
mit Ausgabe:
mit Ausgabe:

/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-static i486-linux-gnu-gcc -prefer-pic -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo
<p style="background-color:yellow;">
/usr/share/apr-1.0/build/libtool --silent --mode=link --tag=disable-static i486-linux-gnu-gcc -o mod_auth_mysql.la -L/usr/lib/mysql -lmysqlclient -lm -lz -rpath /usr/lib/apache2/modules -module -avoid-version mod_auth_mysql.lo
/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-static i486-linux-gnu-gcc -prefer-pic -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo

/usr/share/apr-1.0/build/libtool --silent --mode=link --tag=disable-static i486-linux-gnu-gcc -o mod_auth_mysql.la -L/usr/lib/mysql -lmysqlclient -lm -lz -rpath /usr/lib/apache2/modules -module -avoid-version mod_auth_mysql.lo
</p>

Modul installieren
Modul installieren
apxs2 -i mod_auth_mysql.la
apxs2 -i mod_auth_mysql.la
mit Ausgabe
mit Ausgabe
<pre style="background-color:yellow;">
<pre>
/usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1.0/build/libtool' mod_auth_mysql.la /usr/lib/apache2/modules
/usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1.0/build/libtool' mod_auth_mysql.la /usr/lib/apache2/modules
/usr/share/apr-1.0/build/libtool --mode=install cp mod_auth_mysql.la /usr/lib/apache2/modules/
/usr/share/apr-1.0/build/libtool --mode=install cp mod_auth_mysql.la /usr/lib/apache2/modules/

Revision as of 13:56, 1 October 2007

mod_auth_mysql

mod_auth_mysql installieren auf debian etch.


ganz kurz

 aptitude install apache2-prefork-dev libmysqlclient15-dev
 cd /root/src/
 mkdir auth_mysql
 cd auth_mysql
 wget http://download.nuxwin.com/apache2.2-modules/auth_mysql/mod_auth_mysql-3.0.0.tar.gz
 wget http://download.nuxwin.com/apache2.2-modules/auth_mysql/patch/apache2.2.diff
 tar xzf mod_auth_mysql-3.0.0.tar.gz
 mv apache2.2.diff mod_auth_mysql-3.0.0/
 cd mod_auth_mysql-3.0.0
 patch -p0 < apache2.2.diff mod_auth_mysql.c
 apxs2 -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c
 apxs2 -i mod_auth_mysql.la
 echo "LoadModule mysql_auth_module /usr/lib/apache2/modules/mod_auth_mysql.so" > /etc/apache2/mods-available/auth_mysql.load
 a2enmod auth_mysql
 /etc/init.d/apache2 force-reload

Etwas ausführlicher

Entwicklungspakete installieren

 aptitude install apache2-prefork-dev libmysqlclient15-dev

Temporäres Verzeichnis erzeugen

 cd /root/src/
 mkdir auth_mysql
 cd auth_mysql

Quellen holen

 wget http://download.nuxwin.com/apache2.2-modules/auth_mysql/mod_auth_mysql-3.0.0.tar.gz
 wget http://download.nuxwin.com/apache2.2-modules/auth_mysql/patch/apache2.2.diff
 tar xzf mod_auth_mysql-3.0.0.tar.gz
 mv apache2.2.diff mod_auth_mysql-3.0.0/
 cd mod_auth_mysql-3.0.0

und patchen

 patch -p0 < apache2.2.diff mod_auth_mysql.c

compilieren

 apxs2 -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c

mit Ausgabe:

/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-static i486-linux-gnu-gcc -prefer-pic -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo /usr/share/apr-1.0/build/libtool --silent --mode=link --tag=disable-static i486-linux-gnu-gcc -o mod_auth_mysql.la -L/usr/lib/mysql -lmysqlclient -lm -lz -rpath /usr/lib/apache2/modules -module -avoid-version mod_auth_mysql.lo

Modul installieren

 apxs2 -i mod_auth_mysql.la

mit Ausgabe

/usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1.0/build/libtool' mod_auth_mysql.la /usr/lib/apache2/modules
/usr/share/apr-1.0/build/libtool --mode=install cp mod_auth_mysql.la /usr/lib/apache2/modules/
cp .libs/mod_auth_mysql.so /usr/lib/apache2/modules/mod_auth_mysql.so
cp .libs/mod_auth_mysql.lai /usr/lib/apache2/modules/mod_auth_mysql.la
PATH="$PATH:/sbin" ldconfig -n /usr/lib/apache2/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib/apache2/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 644 /usr/lib/apache2/modules/mod_auth_mysql.so

und eine Load-Datei im debian-Stil erzeugen

 echo "LoadModule mysql_auth_module /usr/lib/apache2/modules/mod_auth_mysql.so" > /etc/apache2/mods-available/auth_mysql.load

Modul aktivieren

 a2enmod auth_mysql

und apache neu laden

 /etc/init.d/apache2 force-reload

Beispielkonfiguration

Wenn für ein Verzeichnis 'Override Auth' gesetzt ist, dann kann man lokal in .htaccess foldendes definieren:

AuthMySQLEnable On
AuthBasicAuthoritative Off

AuthMySQLDb meinedatenbank
AuthMySQLUser meindbuser
AuthMySQLPassword meindbpasswort
AuthMySQLUserTable authusertabelle
AuthMySQLGroupTable authgruppentabelle

AuthMySQLPwEncryption Crypt
AuthMySQLPasswordField passwd
AuthMySQLGroupField groups
AuthMysqlNameField username
AuthMySQLHost localhost