I followed the tutorials “How to Install Rails, Apache, and MySQL on Ubuntu with Passenger” and “How to Install and Secure phpMyAdmin on Ubuntu 14.04” but attempts to access phpMyAdmin via “www.mysitename.com/phpmyadmin” result in a Rails routing error (404 Not Found.)
I followed the procedure suggested at http://kiran.gnufied.org/2010/12/23/rails-passenger-and-phpmyadmin-issue/ to disable passenger while attempting to access phpMyAdmin by adding the following to my site’s apache2 config file (at /etc/sites-available/mysitename.conf):
<LocationMatch “^/phpmyadmin/.+”>
PassengerEnabled off
AllowOverride All
</LocationMatch>
Alias /phpmyadmin “/usr/share/phpmyadmin”
<Directory “/usr/share/phpmyadmin”>
PassengerEnabled off
AllowOverride All
</Directory>
but this results in a 403 Forbidden error.
Does anyone know if this is the proper procedure to enable phpMyAdmin to work on a Rails site and if so how to get around the 403 error?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
The solution to this is so obvious that I am embarrassed that it took me two days to figure it out! When the Rails portion of the site is active then Passenger needs to be active, but when the phpMyAdmin is accessed then Passenger needs to be disabled. The code snippet above attempts to disable passenger when phpMyAdmin is in the path, but the disabling should really occur in phpMyAdmin’s configuration file and the re-enabling should be in my Rails testapp configuration file as shown below:
/etc/apache2/sites-available/testapp.conf:
/etc/apache2/conf-available/phpmyadmin.conf