Click here to Skip to main content
Click here to Skip to main content

Tagged as

Running phpMyAdmin on different port

, 29 Jul 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
Securing Your phpMyAdmin

Introduction

I checked few tutorials on how to run phpMyAdmin on different port but they were a bit confusing for me since I do not work with apache that much. So I decided to write a newbie one.

Why do I want to do this? Well it's in my humble opinion more secure then allowing anyone to access your phpMyAdmin from well know path and public port.

How to?

First you need to remove phpMyAdmin config file /etc/apache2/conf-available/phpmyadmin.conf

rm /etc/apache2/conf-available/phpmyadmin.conf

or Include directive in apache config file /etc/apache2/apache2.conf

Include /etc/phpmyadmin/apache.conf

 

Then You need to add new listening port to Your ports.conf file located in /etc/apache2/ports.conf

Listen 8030

and new vhost with phpMyAdmin secret path to Your ports.conf file as well

<VirtualHost *:8030>
        Alias /SecretPathTophpMyAdmin /usr/share/phpmyadmin
</VirtualHost>

 

After You need to reload apache configuration by issuing following command

service apache2 reload

 

Now You can access your phpMyAdmin only on port 8030 with custom path

http://serverIP:8030/SecretPathTophpMyAdmin/

As You can see its not ppssible to access phpMyAdmin on port 80 with custom and default path nor on port 666 with default path (I used port 666 instead of port 8030 in my configuration)

 

But it is possible to access it on port 666 with custom path Smile | :)

Other articles that may be useful 

http://stackoverflow.com/questions/3687940/how-to-restrict-access-to-phpmyadmin

http://stackoverflow.com/questions/2631269/how-to-secure-phpmyadmin

http://httpd.apache.org/docs/2.2/vhosts/examples.html

http://serverfault.com/questions/487335/allow-access-to-phpmyadmin-only-on-a-specified-virtualhost

 

History

  • 07/29/2014 - First published.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Marin Cokarić
Systems / Hardware Administrator Cro-bit Ltd.
Croatia Croatia
I'm a PC Technician by profession, currently studying computing at Univeristy of Split, FESB
If you wish to contact me you may do so by LinkedIn on http://www.linkedin.com/in/marincokaric/
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150302.1 | Last Updated 29 Jul 2014
Article Copyright 2014 by Marin Cokarić
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid