phpMyAdmin on FreeBSD 7

Prerequisites:

FreeBSD (Base + Autoconf, Automake, Bash and GCC)
Apache
MySQL
PHP

Overview:
 Step #1 - Download, Unzip, Untar and Install phpMyAdmin
 Step #2 - Configure and Test phpMyAdmin

Step #1

phpMyAdmin – Download and Install

Home: 

 http://www.phpmyadmin.net

# Download (Notes: Users behind a Proxy Server should read this and users without Internet but have a CDRom read this.)
cd /usr/src
fetch http://internap.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-3.0.0-all-languages.tar.gz

# Unzip and Untar
tar xvf phpMyAdmin-?.*.gz -C /usr/local/www/data/
mv /usr/local/www/data/phpMyAdmin-3.0.0-all-languages/ /usr/local/www/data/phpMyAdmin/

Create some directories
cd /usr/local/www/data/phpMyAdmin/
mkdir /usr/local/www/data/phpMyAdmin/config
mkdir /usr/local/www/data/phpMyAdmin/uploads
mkdir /usr/local/www/data/phpMyAdmin/exports

Set directory permissions
chmod o+rw /usr/local/www/data/phpMyAdmin/config
chown -R www:www /usr/local/www/data

# Optional web based configuration
# http://YourWebServer/phpMyAdmin/scripts/setup.php

 

Step #2

Configure and Test phpMyAdmin

# Create and edit the configuration
vi /usr/local/www/data/phpMyAdmin/config.inc.php

Set directory permissions
chown -R www:www /usr/local/www/data/phpMyAdmin

 

# Edit httpd.conf to allow "main.php" as a default web page for a directory listing, add main.php to the end of this line:
vi /usr/local/etc/apache22/httpd.conf
DirectoryIndex index.html index.php

Create an ".htaccess" file to permit only users you specify to access phpMyAdmin from the web
vi /usr/local/www/data/phpMyAdmin/.htaccess

Add the first user to create the password file:
/usr/local/sbin/htpasswd -c /etc/phpMyAdminhtpasswd.users admin

# Add more users if you want without creating a new file:
/usr/local/sbin/htpasswd /etc/phpMyAdminhtpasswd.users SomeOtherUserNameHere

# Edit the Apache configuration file  (Add to the very bottom of the file!)
vi /usr/local/etc/apache22/httpd.conf

# Update permissions
chown -R www:www /usr/local/www/data/

# Restart Apache
/usr/local/sbin/apachectl -k restart

Quick test in your web browser (You should be prompted for a password:
http://YourServerIP/phpMyAdmin