phpMyAdmin and phpPgAdmin

    This sections describes how to access your phpMyAdmin and phpPgAdmin installation.

    phpMyAdmin is an easy to use management tool for MySQL that allows you to create and drop databases, create, drop and modify tables, delete, edit and add fields, execute SQL statements, manage keys on fields, manage privileges and export data in various formats through a web-based interface.

    phpPgAdmin is a web-based administration tool for PostgreSQL. It is perfect for PostgreSQL DBAs, newbies and hosting services.

    How to enable phpMyAdmin or phpPgAdmin to be accessed remotely?

    For security reasons, these applications will be accessible only when using 127.0.0.1 as the hostname. If you are using a native installer you can access from your own machine but if you are using a Virtual Machine, Amazon cloud image or Windows Azure cloud image, please check the connection steps below.

    Amazon cloud / BitNami Hosting

    By default phpMyAdmin and phpPgAdmin are not accessible from the outside for security reasons. In order to access them, you can create an SSH tunnel to Apache, sending your requests to your webserver from 127.0.0.1 (localhost).

    You should follow these steps to create the tunnel:

    1. Get your SSH private key if you don't have it already. More info

     

    Note: Below we use port 8888 as an example, in most cases this port will be available and you will be able to use it. If that port is already used by other application in your local machine you can replace the port 8888 with any other port number greater than 1024.

     

    2. Create the tunnel.

    - If you are in Linux or Mac you can run the following in a Terminal in your local machine (using your Public DNS instead of xyz.bitnamiapp.com):

    $ ssh -N -L 8888:127.0.0.1:80 -i bitnami-hosting.pem bitnami@xyz.bitnamiapp.com
    

    Note: If everything is ok you will not get an output and the command will be running in your command prompt while the tunnel is active.

    - If you are using Windows, you can use Putty:

    • Follow the steps described here
    • Before opening the connection. Go to Connection -> SSH -> Tunnels, enter the values below and click "Add" button:
      • Source port: "8888"
      • Destination: "localhost:80" 
    • Click Open

    3. While the tunnel is active you can connect to the web application at http://127.0.0.1:8888/phpmyadmin or http://127.0.0.1:8888/phppgadmin in your browser. The default login is:

    • username: root ("administrator" for legacy versions) for MySQL or postgres for PostgreSQL database.
    • password: bitnami (for BitNami AMIs), <application password> (for BitNami Cloud Hosting)

    Take a look at this link about how to get your application password for BCH servers

     

    Note: If you have enabled Varnish, it is possible that you changed the Apache port to 81. In this case you should specify this port to access phpMyAdmin

    $ ssh -N -L 8888:127.0.0.1:81 -i bitnami-hosting.pem bitnami@xyz.bitnamiapp.com

    Native Installer

    To test your phpMyAdmin installation, first make sure that your Apache and MySQL servers are up and running.  For phpPgAdmin you should check that the PostgreSQL database is running.
     
    To do so, you can use the included "ctlscript.sh" utility. The installdir for Virtual Appliances and AMIs is "/opt/bitnami".
    $ cd your_installdir
    $ ./ctlscript.sh status
    

    If you need to start or stop the servers, you just have to follow the steps described here.

    You can access your phpMyAdmin installation by opening a browser and typing http://127.0.0.1:8080/phpmyadmin or http://127.0.0.1/phpmyadmin. And to access phpPgAdmin, you can type the following urls instead: http://127.0.0.1:8080/phppgadmin or http://127.0.0.1/phppgadmin

    phpmyadmin.png

    For phpMyAdmin the default root user is root, and for phpPgAdmin the default database root user is postgres. The password is the same that you set during the installation.

    Virtual Machine

    If you are running the Virtual Appliance in a secure environment, you can enable it by editing the "/opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf" file and replace "Allow from 127.0.0.1" with "Allow from all" (if your server is running Apache 2.2) or "Require local" with "Require all granted" (if you server is running Apache 2.4 or later) :

     <IfDefine USE_PHP_FPM>
        <Proxy "unix:/opt/bitnami/php/var/run/phpmyadmin.sock|fcgi://phpmyadmin-fpm" timeout=300>
        </Proxy>
    </IfDefine>
    <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"
    
    
        <IfDefine USE_PHP_FPM>
           <FilesMatch \.php$>
             SetHandler "proxy:fcgi://phpmyadmin-fpm/"
           </FilesMatch>
        </IfDefine>
    
    </Directory>
    

    Then you should restart Apache to load the changes:

    $ cd /opt/bitnami
    $ sudo ./ctlscript.sh restart apache
    

    Then you can access at the same URL with "/phpmyadmin" or "/phppgadmin", for example http://YOUR_IP/phpmyadmin

    For phpMyAdmin the default root user is root, and for phpPgAdmin the default database root user is postgres. For Virtual Appliances the password is "bitnami" (or "bitnami1" in the Magento case)

    Azure cloud

    By default phpMyAdmin and phpPgAdmin are not accessible from the outside for security reasons. In order to access them, you can create an SSH tunnel to Apache, sending your requests to your webserver from 127.0.0.1 (localhost).

    You should follow these steps to create the tunnel:

    1. Create the tunnel.

    - If you are in Linux or Mac you can run the following in a Terminal in your local machine (using your Public DNS instead of xyz.bitnamiapp.com):

    $ ssh -N -L 8888:127.0.0.1:80 your_azure_user@xxx.cloudapp.com
    

    - If you are using Windows, you can use Putty:

    • Follow the steps described here
    • Before opening the connection. Go to Connection -> SSH -> Tunnels, enter the values below and click "Add" button:
      • Source port: "8888"
      • Destination: "localhost:80" 
    • Click Open

    2. While the tunnel is active you can connect to the web application at http://127.0.0.1:8888/phpmyadmin or http://127.0.0.1:8888/phppgadmin in your browser. The default login is:

    • username: root for MySQL or postgres for PostgreSQL database.
    • password: bitnami (for BitNami Azure images) or bitnami1 in the Magento case.

    Tabs end

    Increasing the security of phpMyAdmin and phpPgAdmin's login pages.

     
    If you would like, you can add an additional layer of security by enabling Apache's authentication when accessing PHPMyAdmin or phpPgAdmin. To do this for PHPMyAdmin, open /installdir/apps/phpmyadmin/conf/httpd-app.conf and uncomment the following lines by removing the # symbol:
     
    For Virtual Appliances and AMIs you can edit the file with "nano":
    $ sudo nano /opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf
    # AuthType Basic
    # AuthName phpMyAdmin
    # AuthUserFile "install_directory/apache2/users"
    # Require valid-user
    
     
    For phpPgAdmin, the steps are the same but replacing "phpmyadmin" for "phppgadmin". Open /installdir/apps/phppgadmin/conf/httpd-app.conf and uncomment the following lines by removing the # symbol: 
    # AuthType Basic
    # AuthName phpPgAdmin
    # AuthUserFile "install_directory/apache2/users"
    # Require valid-user
    
     
    Now, when accessing phpMyAdmin or phpPgAdmin you will have to log in twice: First, with the username administrator and second, with the username root. Password will be the one you specified at install time or in the case of the Amazon Machine Images and Virtual Appliances, "bitnami". If you would like to change this password, you just have to follow these instructions.

    How to modify the allowed size for uploaded files?

    You can modify the following option in the httpd-app.conf file to increase the allowed size for uploads:

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

    This file is located inside  install_directory/apps/phppgadmin/conf for phpPgAdmin and  install_directory/apps/phpmyadmin/conf for phpMyAdmin. 

    How to modify the execution time?

    This paremeter sets the timeout for Apache to run a script. You can modify the following option in the php.ini file.

    max_execution_time = 120     ; Maximum execution time of each script, in seconds 
    

    How to change the phpMyAdmin or phpPgAdmin password?

    The phpMyAdmin and phpPgAdmin credentials are the same that the MySQL and PostgreSQL database respectively. If you want to modify the password, check how to change the MySQL root password or how to change the PostgreSQL password

    Legacy versions

    The phpMyAdmin application can be protected by an Apache directory password for security reasons. You can change the phpMyAdmin access password using the following command:

    $ sudo /installdir/apache2/bin/htpasswd -cb /installdir/apache2/users administrator <new_phpmyadmin_password>
    

    Comments

    You must login to post a comment.