1

I am using ubuntu 16.04 hosted in digital ocean

I want to change phpmyadmin access url. I saw link but they gave 2 options :

1) /etc/phpmyadmin/apache.conf - I tried, no luck.

2) /etc/apache2/conf-available/phpmyadmin.conf , but here instead of conf file type, its displaying as Readbale folder what wrong here ?

enter image description here

spylh9999ggr
  • 243
  • 3
  • 8
  • 21
  • Possible duplicate of [Change phpMyAdmin port from 80 to another number](https://askubuntu.com/questions/896988/change-phpmyadmin-port-from-80-to-another-number) also [How to secure phpmyadmin](https://askubuntu.com/questions/938398/how-to-secure-phpmyadmin) – pa4080 Oct 26 '17 at 10:16
  • @pa4080 Thanks for your comment, i went through that link, i dont want to change the port but i want to change phpmyadmin access url path...... – spylh9999ggr Oct 26 '17 at 10:24
  • I'm sorry, I messed up the links. The first one can give you a general view to the configuration of `phpmyadmin`. The [first part of the second one](https://askubuntu.com/a/939241/566421) should be that you are looking for. I will write a short answer. – pa4080 Oct 26 '17 at 10:43

1 Answers1

3

Actually /etc/apache2/conf-available/phpmyadmin.conf, that is displayed as 'folder', is a symbolic link to /etc/phpmyadmin/apache.conf:

$ ls -l /etc/apache2/conf-available/phpmyadmin.conf

lrwxrwxrwx 1 root root 28 яну 20  2017 /etc/apache2/conf-available/phpmyadmin.conf -> ../../phpmyadmin/apache.conf

To change the URI (access path) of PhpMyAdmin. Edit /etc/phpmyadmin/apache.conf and change the first path (/phpmyadmin) of this directive:

Alias /phpmyadmin /usr/share/phpmyadmin
  • Explanation about the directive Alias. Let's assume that DocumentRoot is /var/www/html. In this case the directive Alias /phpmyadmin /usr/share/phpmyadmin will serve as this symlink:

    ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
    

References:


Update from the discussion: Indeed phpmyadmin.conf wasn't enabled, because the symbolic link /etc/apache2/conf-enabled/phpmyadmin.conf was missing. PhpMyAdmin was enabled within Apache's configuration by a symbolic link, created in /var/www/html, exactly as the above example. So the steps we perform were:

  • Tweak the Alias directive in /etc/phpmyadmin/apache.conf;
  • Enable phpmyadmin.conf: sudo a2enconf phpmyadmin.conf;
  • Restart Apache: sudo systemctl restart apache2.service;
  • Check whether the new URI path works;
  • Remove the unnecessary symbolic link: sudo rm /var/www/html/phpmyadmin.
pa4080
  • 29,351
  • 10
  • 85
  • 161