Mapping a virtual route to phpmyadmin with rails

How do I setup a route to a virtual path in rails for phpmyadmin, if I
want to use that to look over my database?

Say the path is at the following:

myvirtualpath/admin/phpmyadmin/

If I went to …

http://mysite.com/myvirtualpath/admin/phpmyadmin/

phpmyadmin will show up fine…

With rails if I do it, I will get a routing error…

I’m not sure how to add virtual paths in routes.rb with say map.connect
etc.

Any advice would be appreciated.

thanks.

On Aug 12, 1:38 pm, Alpha B. [email protected]
wrote:


Posted viahttp://www.ruby-forum.com/.

I’m confused. Rails routes only map URLs that are passed to Rails to
various controllers/actions. phpMyAdmin is not part of your Rails app.
What exactly are you trying to accomplish?

Is there any way I can convince you that phpmyadmin is a security hole
waiting to happen? If not, then you might just be best off setting up
a subdomain for it.

Hunted and pecked from my iPhone

On Aug 12, 2009, at 10:38 AM, Alpha B.
<[email protected]

heimdull wrote:

this will protect phpadmin and also encrypt any traffic to and from
phpadmin. If you want to open phpadmin from your rails application
just use link_to “phpadmin”, “https://yourserver/phpmyadmin

thank you - this is the route I will go.

Alpha B. wrote:

How do I setup a route to a virtual path in rails for phpmyadmin, if I
want to use that to look over my database?

As others have said, this is a dreadful idea. Set up a separate vhost
for it.

And if you’re using Webmin as I suggested, you may not need phpmyadmin
at all. (The mySQL module isn’t as full-featured as PMA, but it may do
what you need.)

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

If you have apache as your frontend you should setup a https
virtualhost and put this in the vh

<Location “/phpmyadmin”>
AuthType Basic
AuthName “Restricted Site”
AuthUserFile /usr/local/apache2/conf/passwd/passwords
Require user username
Order allow,deny
Satisfy Any

alias /phpmyadmin /var/www/phpmyadmin
<Directory “/var/www/phpmyadmin”>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

this will protect phpadmin and also encrypt any traffic to and from
phpadmin. If you want to open phpadmin from your rails application
just use link_to “phpadmin”, “https://yourserver/phpmyadmin

Marnen Laibow-Koser wrote:

As others have said, this is a dreadful idea. Set up a separate vhost
for it.

And if you’re using Webmin as I suggested, you may not need phpmyadmin
at all. (The mySQL module isn’t as full-featured as PMA, but it may do
what you need.)

Heya Marnen,

That’s why I ask mate. :slight_smile:

I have never heard of Webmin - I’ll look into it. I did find an
interesting database admin tool that’s being worked on that is fully
ruby on rails…

I found my solution and didn’t use any of this. Here’s what I did:

I used MySQL Query Browser through an SSH tunnel on Putty

The following guide worked great:

http://www.vbmysql.com/articles/security/connecting-the-mysql-gui-tools-to-a-remote-server-through-a-firewall

No more phpmyadmin :slight_smile: