skip to Main Content

We build a Ubuntu 18.04 server dedicated for running phpMyAdmin.
Databases are on several different servers and are accessed remotely.
No other services or sites are running on this server.
We want the phpMyAdmin site to be the default site.
At the moment the server is showing a Apache2 Ubuntu Default Page.

Basicaly we would like that http://server/ is showing the same site as http://server/phpmyadmin.

We tried to setup a redirect which seems to get stuck in an infinite loop:

redirect permanent / /phpmyadmin

or

redirect permanent / http://server/phpmyadmin

The result is that there are numerous appends of the string phpmyadmin to the original url until the browser cuts the redirects off.

3

Answers


  1. Chosen as BEST ANSWER

    In the answers given it was suggested to move the phpmyadmin installation one level up. This was not possible in my case due to the installation being in a different path. This however pointed me in a different possible direction to a solution.

    Here is how we eventually made it work like we wanted to. Just 2 simple steps in the end.

    1. Remove the folder which is used by Apache as default. In my case this was the /var/www/html. I found this location in the file /etc/apache2/sites-available/000-default.conf. look for the value of DocumentRoot.
    2. Create a symbolic link instead of the removed folder. The redirect is now taking place on the file system level before Apache accesses them. In my case this link looks like this:
    lrwxrwxrwx  1 root root   22 Jun 17 12:31 html -> /usr/share/phpmyadmin/
    

  2. Edit the file /etc/apache2/conf-available/phpmyadmin.conf or /etc/phpmyadmin/apache.conf

    Line 1 should looks like this : Alias /phpmyadmin "some/path"

    Change it to :

    Alias / "some/path"
    

    And restart apache

    Login or Signup to reply.
  3. in your apache2.conf find this:

    <Directory /var/www/>
            Options Indexes FollowSymLinks
            AllowOverride None
            Require all granted
    </Directory>
    

    and update /var/www/ to /var/www/phpmyadmin

    or move phpmyadmin content to /var/www as you prefer

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search