Select Page

PHPMyAdmin – Amazon Corpsite

Install phpmyadmin by typing the following command:

sudo apt-get install php 

 Add the following line to the end of of file /etc/apache2/apache2.conf:
Include

 /etc/phpmyadmin/apache.conf

Rename the phpmyadmin URL to increase security

/etc/phpmyadmin/apache.conf

Look for the following line:

# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

Change to:

Alias /secretadmin /usr/share/phpmyadmin

Restart Apache by giving this command on the command line:
sudo /etc/init.d/apache2 restart

Now visit the new URL, and phpMyAdmin should be there. For example, yoursite.com/secretadmin.

The main PHPMyAdmin is found:

http://www.imagine-publishing.co.uk/ip-phpmyadmin/

It is restricted to only be accessible from 86.28.80.249.

/etc/phpmyadmin/apache.conf

I added:

       order deny,allow
deny from all
allow from 86.28.80.249

So my apache.conf file looks like:

# phpMyAdmin default Apache configuration

Alias /ip-phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
Options FollowSymLinks
DirectoryIndex index.php

#Restrict by IP
order deny,allow
deny from all
allow from 86.28.80.249

<IfModule mod_php5.c>
AddType application/x-httpd-php .php

php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_admin_flag allow_url_fopen Off
php_value include_path .
php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/
</IfModule>

</Directory>

# Authorize for setup
<Directory /usr/share/phpmyadmin/setup>
<IfModule mod_authn_file.c>
AuthType Basic
AuthName “phpMyAdmin Setup”
AuthUserFile /etc/phpmyadmin/htpasswd.setup
</IfModule>
Require valid-user
</Directory>

# Disallow web access to directories that don’t need it
<Directory /usr/share/phpmyadmin/libraries>
Order Deny,Allow
Deny from All
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib>
Order Deny,Allow
Deny from All
</Directory>