EDV:Apache2 mysql auth: Difference between revisions
From KIP Wiki
⧼kip-jumptonavigation⧽⧼kip-jumptosearch⧽
No edit summary  |
|||
Line 4: | Line 4: | ||
mod_auth_mysql installieren auf debian etch. |
mod_auth_mysql installieren auf debian etch. |
||
== ganz kurz == |
|||
aptitude install apache2-prefork-dev libmysqlclient15-dev |
aptitude install apache2-prefork-dev libmysqlclient15-dev |
||
Line 20: | Line 22: | ||
a2enmod auth_mysql |
a2enmod auth_mysql |
||
/etc/init.d/apache2 force-reload |
/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 |
|||
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 |
Revision as of 13:45, 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
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