Zone security MySQL with Apache
|
|
|
|
| Articles Reviews Mysql | |||||||
| Written by Radu Mazare | |||||||
| Monday, 09 October 2006 | |||||||
Page 2 of 5 {mos_sb_discuss:27}Installing the Module
Once you have your database table set up, you'll need to actually download the
source for mod_auth_mysql, available at http://modauthmysql.sourceforge.net. At
the time of this writing, the current version was 2.9.0, so you would download
mod_auth_mysql-2.9.0.tar.gz.
After you've downloaded the module source, extract the tarball:
tar -xzvf mod_auth_mysql-2.9.0.tar.gz
Once the tarball is extracted, change directories to the newly created source
folder: cd mod_auth_mysql-2.9.0
To build the module from the downloaded source code, you're actually going to
use Apache's apxs command directly. Execute the following command, using
the path to your apxs binary on your system; the default Apache location
of /usr/local/apache2/bin is used here: /usr/local/apache2/bin/apxs -c -lmysqlclient -lm -lz
mod_auth_mysql.c
If the build is successful, you should see a couple of compilation lines, and
no errors. If, instead, you get an error about a missing mysql.h file,
and a whole slew of MySQL-related errors, you might need to manually specify
the paths to the MySQL libraries and include files. Using the default locations
from MySQL, your command might instead look like this: /usr/local/apache2/bin/apxs -c -lmysqlclient -lm -lz \ -L /usr/local/mysql/lib/mysql \ -I /usr/local/mysql/include/mysql \ mod_auth_mysql.c
To
install the newly compiled module, you'll need to execute the following command
as root. As usual, change the path to apxs to point to your apxs binary:
/usr/local/apache2/bin/apxs -i mod_auth_mysql.la The next installation task you need to perform is to add the necessary command to load the module in httpd.conf. To do this, open your httpd.conf file, find a suitable location to add a module definition -- usually at the very end of the configuration file, or next to other LoadModule statements -- and add the following:
LoadModule mysql_auth_module modules/mod_auth_mysql.so Finally, restart Apache.
|
|||||||
| Last Updated ( Sunday, 08 July 2007 ) | |||||||
| < Prev | Next > |
|---|







