Home > front end >  How can I secure or change phpmyadmin for my wordpress site that is hosted on Google Cloud Platform?
How can I secure or change phpmyadmin for my wordpress site that is hosted on Google Cloud Platform?

Time:09-20

I'm using GCP for hosting my Wordpress website, which is using php 7.4 and Debian. I followed the steps for Google Click to Deploy and I am able to access <IP/Domain>/phpmyadmin to get to the database. How can I make this more secure or change the URL??

I've looked at other solutions and cannot find the file or path for /etc/phpmyadmin/apache.conf or /etc/apache2/conf.d/phpmyadmin.conf

CodePudding user response:

First, you download the puTTY application that will create an SSH Tunnel environment for the localhost. Then, it will be used to establish the connection between Google Cloud and the localhost machine.

After installation, open puTTY, generate an SSH key and set it up on Google Cloud console Virtual Machine.

Generate the SSH using the puTTY key generator. Please follow the steps in the same order as described below.

  1. Enter key comment ,
  2. Now copy the public key.
  3. Save the public key in a safe location for future use.
  4. Save the private key with the public key.

Note: Public key is for server-side service, and private is for the user side. These keys can be used for FileZilla and don’t place on public computers for security reasons.

Save SSH Public key to Google Cloud. Now open Google Cloud Platform Dashboard and visit the section Compute Engine> Metadata.

Now paste the public key (copied from the puTTY key generator) in the metadata section of Google Cloud.

  1. Paste the SSH key by adding a blank item.
  2. Save the settings.

Configure the puTTY application to access PHPMyAdmin localhost

Putty Session Configuration Now you’ve to configure the puTTY application for the PHPMyAdmin access

Copy the IP address of the Virtual Machine VM.

  1. Paste the IP address in the saved sessions
  2. Click on the Save button.

Final settings of session:

  1. Select the IP Address
  2. Click on the Save button
  3. Now click on the load button provided.
  4. Paste the IP address in Host Name

For your reference, you can check this documentation.

CodePudding user response:

I don't know GCP specifically, but you've mentioned Debian so I'll take a stab at this.

The phpMyAdmin package for Debian configures this as part of the Alias statement at the top of /etc/phpmyadmin/apache.conf:

Alias /phpmyadmin /usr/share/phpmyadmin

You can change the path to anything you'd like (although note that, depending on your settings, it might get reverted when you update the package), such as

Alias /superSecretObscurePath /usr/share/phpmyadmin

Afterwords, you'll have to reload or restart Apache.

  • Related