0

My phpMyAdmin is located at /srv/www/htdocs/phpMyAdmin/. The IP of the webserver is 192.168.40.40

If I try to access phpMyAdmin like this: http://192.168.40.40/phpMyAdmin then I get redirected to a vhost which I created for a project (entwicklung.company).

VHOST of a project which I am getting redirected to, if I call entwicklung.phpmyadmin:

<VirtualHost *:80>

    ServerName entwicklung.company
    ServerAdmin black@company.de
    DocumentRoot /srv/www/vhosts/company
    ErrorLog /var/log/apache2/company_error.log
    CustomLog /var/log/apache2/company_access.log common

    <Directory "/srv/www/vhosts/company">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

</VirtualHost>

So I tried to create a virtual host for phpMyAdmin, but then I get 403 permission denied if I try to call it.

User and group are set to wwwrun with chown -R wwwrun:wwwrun /srv/www/vhosts/phpMyAdmin

VHOST for phpMyAdmin:

<VirtualHost *:80>

    ServerName entwicklung.phpmyadmin
    ServerAdmin black@company.de
    DocumentRoot /srv/www/vhosts/phpMyAdmin
    ErrorLog /var/log/apache2/phpmyadmin_error.log
    CustomLog /var/log/apache2/phpmyadmin_access.log common

    <Directory "/srv/www/vhosts/phpMyAdmin">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

</VirtualHost>

How can I solve this?

Black
  • 461
  • 1
  • 8
  • 20
  • What's in the error log? And what is in the other vhost? – Michael Hampton Oct 31 '18 at 15:57
  • There is nothing related to the redirection, in the error log. Which other vhost do you mean? And what exactly do you mean with "whats is in the other vhost?" – Black Nov 05 '18 at 08:45
  • You're getting a redirection, but it's from a URL that doesn't correspond to the vhost you posted above. So you need to look at the configuration of the other vhost. – Michael Hampton Nov 05 '18 at 12:34
  • I get redirected to the VHOST which I have posted above. – Black Nov 05 '18 at 14:14
  • Exactly! So that vhost configuration doesn't matter. It's the one you were redirected FROM that will contain the redirect. – Michael Hampton Nov 05 '18 at 14:16
  • I updated my post. I actually get 403 access denied, if I create the vhost for phpmyadmin and try to access it. – Black Nov 05 '18 at 14:44

1 Answers1

1

I solved it, I had to change the owner of /srv/www/vhosts/phpMyAdmin to wwwrun:root with

chown -R wwwrun:root /srv/www/vhosts/phpMyAdmin

Black
  • 461
  • 1
  • 8
  • 20