Guy Rutenberg

Keeping track of what I do

phpMyAdmin + Lighttpd in Gentoo

with one comment

Usually installing software in Gentoo is a piece of cake. Just emerge what you want and (with the right USE flags) and everything will be ready for you. However, as today I’ve found out today, installing phpMyAdmin with Lighttpd isn’t trivial as it should be.

In this post I’ll try to walk you through the necessary steps to install phpMyAdmin with Lighttpd in Gentoo.

Installing Lighttpd and PHP

Before installing Lighttpd and PHP you’ll need to enable some USE flags. For Lighttpd you’ll need to at least enable the php and fastcgi USE flags. For PHP enable the cgi, crypt, ctype, pcre, session, unicode. The first one is required for working with Lighttpd, while the others are required for phpMyAdmin.

See the handbook for information about enabling USE flags.

Now install the packages

emerge -av lighttpd php

After installation is complete, start the Lighttpd process

/etc/init.d/lighttpd start

and you should have a working Lighttpd server with PHP support.

Installing phpMyAdmin

phpMyAdmin depends on a package called webapp-config. While usually we let Portage take care of dependencies, this time we’ll have to install webapp-config manually before we install phpMyAdmin, so we can change its configuration for suit Lighttpd.

emerge -av --oneshot webapp-config

After installation is done edit using your favourite editor the /etc/vhosts/webapp-config and change the line:

vhost_server="apache"

to

vhost_server="lighttpd"

Now we are ready to install phpMyAdmin.

emerge -av phpmyadmin

After installation is complete, you’ll need to create a phpMyAdmin configuration file

cp /var/www/localhost/htdocs/phpmyadmin/config.sample.inc.php /var/www/localhost/htdocs/phpmyadmin/config.inc.php

Now open the newly created configuration file and edit the line with the blowfish_secret (at the top of the file) as explained in it. An easy way to generate the password would be to use spass.

Now if you use the default Lighttpd configurations you’re done. You can access the phpMyAdmin via http://localhost/phpmyadmin. If however you’ve changed the document root, there is one more step for you. Enable the mod_alias module in /etc/lighttpd/lighttpd.conf and append to the file

alias.url += ("/phpmyadmin" => "/var/www/localhost/htdocs/phpmyadmin")

and don’t forget to restart the Lighttpd server after making the changes.

You should have by now everything installed and configured to work. If you have any further questions don’t hesitate to comment.

Share and Enjoy:
  • del.icio.us
  • StumbleUpon
  • Digg
  • Facebook
  • Mixx
  • Google Bookmarks
  • Simpy

Written by Guy

January 20th, 2009 at 7:14 pm

Posted in Linux, Tutorials

Tagged with , ,

One Response to 'phpMyAdmin + Lighttpd in Gentoo'

Subscribe to comments with RSS or TrackBack to 'phpMyAdmin + Lighttpd in Gentoo'.

  1. Thanks help alot!

    Christofer

    14 Mar 09 at 13:24

Leave a Reply