PHPMyAdmin 404 with Bitnami vhosts Enabled

Here’s a quick and neat solution if you are unable to access PHPMyAdmin after adding vhosts‘ on your Bitnami LAMP stack on, for example, when you’re hosting a site Amazon AWS or Google Cloud Platform. I came to this solution after doing some research, since the “Not Found” error was giving me a headache.

Basically, the only thing you need to do is to set up separate Virtual Hosts for each of your applications or websites. And to make sure that I don’t have to this research all-over, I am sharing my solution with you.

Make PHPMyAdmin great again!

First of all, remove (but make sure to copy your configuration so that you don’t have to do it all over) your Virtual Hosts from httpd-vhosts.conf, which is located here:

/opt/bitnami/apache2/conf/extra/httpd-vhosts.conf

Then, comment out the following line in your httpd.conf, just to do things the right way, as follows:

#Include conf/extra/httpd-vhosts.conf

Your httpd.conf is located here, by the way:

/opt/bitnami/apache2/conf/httpd.conf

Now, in your app – or website configuration folder, you will have to create a new httpdvhosts.conf file. I prefer to use the Nano editor. Here’s how it’s done:

sudo nano /opt/bitnami/apache2/htdocs/yourdomain.com/conf/httpd-vhosts.conf

OR

sudo nano /opt/bitnami/apps/yourapp/conf/httpd-vhosts.conf

Copy your previous Virtual Host configuration into this file and hit [ctrl]+[x] to exit and save the file.

Finally you need to include your newly created httpdvhosts.conf into the main Apache configuration file. Remember, it’s located here:

/opt/bitnami/apache2/conf/httpd.conf

Add either of the following lines, depending on your specific configuration, at the bottom of your httpd.conf file:

Include "/opt/bitnami/apache2/htdocs/yourdomain.com/conf/httpd-app.conf"

OR

Include "/opt/bitnami/apps/yourapp/conf/httpd-vhosts.conf"

That’s it. Restart Apache, and you will now be able to access both your Virtual Host and PHPMyAdmin on your Bitnami LAMP stack.