I used the following instructions to install phpMyAdmin into Centos 7 webserver:
wget https://files.phpmyadmin.net/phpMyAdmin/4.6.5.2/phpMyAdmin-4.6.5.2-all-languages.tar.gz
tar xvzf phpMyAdmin-4.6.5.2-all-languages.tar.gz
mv phpMyAdmin-4.6.5.2-all-languages phpmyadmin
mv phpmyadmin /var/www/html/
Oddly (different from what I read in other questions), phpMyAdmin was installed here:
/var/www/html/phpmyadmin
And the phpmyadmin config file is here:
/var/www/html/phpmyadmin/config.inc.php
With the default apache configuration, the website is viewed from /var/www/html and phpMyAdmin is viewed from /var/www/html/phpmyadmin, and looks like this in the URL:
http://www.foo.com/phpmyadmin
So far so good, all working.
However, I added a virtual host and am now serving the website out of /var/www/foo.com/public_html
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/foo.com/public_html
ServerName foo.com
ServerAlias www.foo.com
ErrorLog /var/www/foo.com/error.log
</VirtualHost>
It works if I mv /var/www/html/phpmyadmin /var/www/foo.com/public_html, but when logging in via FTP, I don't want the phpmyadmin folder to be visible under the /var/www/foo.com/public_html folder.
Is there a way to leave phpmyadmin in its original location at /var/www/html/phpmyadmin, but still be accessible via the url http://foo.com/phpmyadmin ?