Squeezebox Setup

Allowing network access to PHPMyAdmin

PhpMyAdmin is a web tool for administering (and browsing) mysql based databases. Its extremely useful, and we installed it when we put php on (if you didn’t then yum --enablerepo=remi install phpmyadmin will do it), but the default configuration is to only allow access from localhost – which is not so useful on a NAS. So lets open that up so that the local subnet can use it.  First edit the file /etc/httpd/conf.d/phpMyAdmin.conf and add the additional line to the directory settings:

<Directory /usr/share/phpMyAdmin/>
    order deny,allow
    deny from all
    allow from
    allow from

If you wanted to allow access to everybody then you could just change it to:

<Directory /usr/share/phpMyAdmin/>
    order allow,deny
    allow from all

A restart (service httpd restart) is enough to pick this up.  One other change that may be worth making is to add rewrite rules to force SSL on this connection.  To do that we need to change the root virtual host config in /etc/httpd/conf/httpd.conf – adding in the two extra rules below:

<VirtualHost *:80>
    DocumentRoot /home/apache
    ServerName yourhost.dyndns.org
    ErrorLog /var/log/httpd/error_log
    CustomLog /var/log/httpd/access_log combined
    RewriteEngine On
    RewriteRule ^/cube/(.*)$ https://mail.yourhost.dyndns.org/$1 [R=301,L]
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/phpmyadmin/(.*)$ https://%{HTTP_HOST}/phpmyadmin/$1 [R,L]
    RewriteRule ^/phpMyAdmin/(.*)$ https://%{HTTP_HOST}/phpmyadmin/$1 [R,L]

After doing another restart (service httpd restart) you should be able to access http://ip address/phpmyadmin to access the database.  The username and password you are prompted for it the database username and password.


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: