vesta-cp

How to access Phpmyadmin in vestacp and secure it

Vestacp phpmyadmin

Those who are familiar with cpanel knows that its easy to access phpMyAdmin through the long list of menu on front page of cpanel. But if you have decided to install a VPS or dedicated server with free control panel like VestaCP then this access is a little tricky.

In this tutorial we ll see about how to access the phpMyAdmin and also how to make it more private.

First lets see how to access phpMyAdmin. To access phpMyAdmin go to following url

http://change-to-your-server-ip-or-domain-setup/phpmyadmin

for e.g. http://pharmac.info/phpmyadmin

 

Now since you know how to access it and wanna make it more private then follow my instructions

Reasons why you should change phpMyAdmin access page are

  1. To secure your phpMyAdmin from bots which knows default destination
  2. From secure the login page from hacker 😀

1) Connect to your server ROOT access (SSH)

2) Open the apache2.conf.

nano /etc/phpmyadmin/apache2.conf

3) Find this line, should be at the top:

Alias /phpmyadmin /usr/share/phpmyadmin

4) Change /phpmyadmin to anything!! for example we will use /private_phpmyadmin like this:

Alias /private_phpmyadmin /usr/share/phpmyadmin

5) restart apache2, important!!

/etc/init.d/apache2 restart

6) Let’s go test it….
Type your old URL:

http://change-to-your-server-ip-or-domain-setup/phpmyadmin

— you should get a 404 error (page missing) Good!

Now Try the new private URL:

http://change-to-your-server-ip-or-domain-setup/private_phpmyadmin

That’s it, now only you and your private clients will know where the login page for phpmyadmin is located.

This change will not update the link in vestacp to the phpmyadmin link under websites, you will need to change the url destination in the theme also.

Leave a Reply

Your email address will not be published. Required fields are marked *