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. -- Posted via http://www.ruby-forum.com/.
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 Blue <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > 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? > > 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. > -- > Posted via http://www.ruby-forum.com/. > > >
On Aug 12, 1:38 pm, Alpha Blue <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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? > > 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. > -- > 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?
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 </Location> alias /phpmyadmin /var/www/phpmyadmin <Directory "/var/www/phpmyadmin"> Options FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> 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"
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. -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser
2009-Aug-12 20:13 UTC
Re: Mapping a virtual route to phpmyadmin with rails
Alpha Blue 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 marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
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. :) 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.. http://github.com/redox/rbdb/tree/master -- Posted via http://www.ruby-forum.com/.
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 :) -- Posted via http://www.ruby-forum.com/.