Managing a database can be done in multiple way: direct access via SQL commands or batches, system native GUI interface, web interfaces in several languages (PHP, Flash ActionScript, Ruby, ...). One of the most user friendly is certainly via a web interface as it does not require any specific installation on the user desktop. That's the choice that FREE is providing and that what we are going to mimic on our development platform with phpMyAdmin, generally referenced as PMA.

The first step consists in installing a very neat tool from Gentoo geared toward web server installation and configuration: webapp-config. This tool is generally used to help web server administrators to spread third party products configuration among their hosted sites when using virtual hosting. In our case, even if we only develop a single web site, this tool will be used during the installation of our database administration tool. So, there it goes:

emerge webapp-config

Now, this tool must be configured to match our formers installtion steps. In /etc/vhosts/webapp-config, at line 43, the value vhost_root must match the root of your local site:

vhost_root="/var/www/${vhost_hostname}"

should become:

vhost_root="/home/pierre/site"

Still under the same file, at line 70, web-app needs to be tell the kind of web server that we are running for this local site:

vhost_server="apache"

should become:

vhost_server="lighttpd"

Finally, some permissions must be reviewed for convenience beginning at line 169 to 178:

vhost_perms_serverowned_dir="0775"
vhost_perms_serverowned_file="0666"

vhost_perms_configowned_dir="0755"
vhost_perms_configowned_file="0644"

vhost_perms_defaultowned_dir="0755"
vhost_perms_virtualowned_file="o-w"

vhost_perms_installdir="0755"

should become:

vhost_perms_serverowned_dir="0775"
vhost_perms_serverowned_file="0666"

vhost_perms_configowned_dir="0777"
vhost_perms_configowned_file="0666"

vhost_perms_defaultowned_dir="0777"
vhost_perms_virtualowned_file="o+w"

vhost_perms_installdir="0777"

The next step consists in installing PMA. If you need virtual hosting, just set an appropriate USE flag under Portage:

echo "dev-db/phpmyadmin vhosts" >> /etc/portage/package.use

Now proceed with the installation:

emerge phpmyadmin

There is still a couple of things to do. Our webserver must be able to handle aliases. This is achieved in our web server configuration file: /etc/lighttpd.conf. In the server.modules section, uncomment the mod_alias at line 17. Finally, at the end of the file, set a proper alias to shorten long URL:

alias.url =("/phpmyadmin/" => "/home/pierre/site/htdocs/phpmyadmin/")

It's time to check our installation by restarting the web server:

/etc/init.d/lighttpd restart

and by pointing your favorite web browser to http://127.0.0.1/phpmyadmin/.