Question

I'm trying to connect to phpmyadmin through my Public DNS and I can't seem to get it to work.

I've tried following these directions:

Can't Access PHPMyAdmin

By default phpMyAdmin is restricted to localhost. If you want it to be accessible from anywhere you should follow the steps described in “How to enable phpMyAdmin or phpPgAdmin?” in virtual machines FAQ:

SSH to the instance Replace the line “Allow from 127.0.0.1” with “Allow from all” in the file /opt/bitnami/apps/phpmyadmin/conf/phpmyadmin.conf Restart apache: sudo /opt/bitnami/ctlscript.sh restart apache

The problem with this solution is that I don't have a phpmyadmin.conf file in that directory. I found this pertaining to that Phpmyadmin.conf does not exist in the phpmyadmin folder, but that didn't allow me to access.

Check the /opt/bitnami/apps/phpmyadmin/htdocs/config.inc.php and change the “$cfg[‘PmaAbsoluteUri’]” option with your URL.

I'm still getting the same For security reasons, this URL is only accesible using localhost (127.0.0.1) as the hostname error and it's driving me mad.

Any ideas? If needed, I can readily post relevant content from configuration files.

Was it helpful?

Solution

When looking at this article (How to enable phpMyAdmin or phpPgAdmin to be accessed remotely?), I needed to be looking at Virtual Machine and not Amazon cloud / Bitnami Hosting.

When I changed the /opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf file to the following, I was able to access via [PUBLIC_DNS/YOUR_DOMAIN_NAME/IP]/phpmyadmin].

Main changes being:

Allow from all

and

Require all granted

After the changes, remember to restart apache server. (or reboot your instance)

sudo /opt/bitnami/ctlscript.sh restart apache

/opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf

<Directory "/opt/bitnami/apps/phpmyadmin/htdocs">
# AuthType Basic
# AuthName phpMyAdmin
# AuthUserFile "/opt/bitnami/apache2/users"
# Require valid-user
AllowOverride None

<IfModule php5_module>
        php_value upload_max_filesize 80M
php_value post_max_size 80M
</IfModule>

<IfVersion < 2.3 >
Order allow,deny
Allow from all
Satisfy all
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>
ErrorDocument 403 "For security reasons, this URL is only accesible using localhost (127.0.0.1) as the hostname"
</Directory>

Docs Ref: https://docs.bitnami.com/virtual-machine/components/phpmyadmin/

OTHER TIPS

I faced the same issue. Though I was able to access phpMyAdmin by using the following steps

  1. SSH to the server using the following command

    ssh -N -L 8888:127.0.0.1:80 -i YourPemFile.pem bitnami@YourServerIP

  2. Then open the following link in your browser

    http://127.0.0.1:8888/phpmyadmin

  3. You will see the following page enter image description here

  4. Now just use root and the default wordpress password to login.

You should also restart your AWS server after you edited the http-app.conf .enter image description here

Instead of restarting the server you can just type this on SSH:

sudo /opt/bitnami/ctlscript.sh restart
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top