Apache mySQL authentication

From gr0x0rd
Jump to navigation Jump to search

Installing the module

Apache mySQL authentication is provided by an apache module. To install it,

$ sudo emerge -av mod_auth_mysql

After the emerge has completed, edit the apache configuration file so the module is loaded when the server starts.

$ sudo nano -w /etc/conf.d/apache2 

Ensure that the APACHE2_OPTS variable contains the directive

-D AUTH_MYSQL 

Next, log into mysql as root.

$ mysql -u root -p

Use the examples in the [mySQL] page to create a database and grant the desired user permissions to it. Next, create an authorization table.

mysql>USE yourdatabase;
    • to be updated **

Restart apache to enable the changes.

$ sudo /etc/init.d/apache2 restart