How can I make mysql access public and not restricted only to localhost? - wordpress

I'm trying to connect zapier to the mysql db installed with a bitnami wp site in aws, but it seems I cannot connect them if the access is only restricted to the localhost. Any idea on how to change this in order to make it work?
this is what my security group looks like:
https://pasteboard.co/HL2ALzP.png
this is what my registered targets look like:
https://pasteboard.co/HL2Aa1G.png
this is the info zapier asks for in order to connect:
https://pasteboard.co/HLa6HMC.png

WARNING: These instructions suppose an important security risk. I do not recommend to open your database to the public under any circumstances
You need to edit the /opt/bitnami/mysql/my.cnf and change
bind-address=127.0.0.1
to
bind-address=0.0.0.0
Then restart mysql
sudo /opt/bitnami/ctlscript.sh restart mysql
Apart from that, you will need to open your firewall port in AWS. Here you have a guide for that
https://docs.bitnami.com/aws/faq/administration/use-firewall/

Related

Azure SQL Server firewall not allowing operation to connect even though option is set to yes in firewall settings

I am trying to import my local SQL server database into Azure and I have all the requirements (storage, bacpac file, etc). When I try to import the db, I am getting the error below.
The Azure SQL Server firewall did not allow the operation to connect.
To resolve this, please select the "Allow All Azure" checkbox in the
Sql Server's configuration blade.
I have already checked yes on the Allow Azure services and resources to access this server option in the firewall settings and added my client IP. Is there something behind the scenes preventing it from allowing access? I am running my SQL server on a Docker container.
Imported bacpac file
Import Operation Azure
Import Error
Firewall Settings
After a week of trial and error, the database imported fine with no problems so I'll answer my question. What is interesting is that I don't have a concrete answer to my question since I don't know exactly why it did, but I'll give two tips anyway.
It might have been the cache on Azure's side. I got in contact with
an Azure rep recently and they stated that the cache may have not
updated yet. Clearing your cache could be the source of the problem
as well. To clear the cache see this document.
DBCC FLUSHAUTHCACHE;
Creating a new rule that spans from 0.0.0.0 to 255.255.255.255 in
your firewall settings.
Feel free to provide more solutions in the answers. Like I said, it was likely the cache on their side. It was really odd that it didn't work for a while, even with the firewall settings configured correctly.

How to configure ftp server in GCP VM instance?

I installed wordpress in a GCP VM and tried installing plugins and themes through the wp-admin dashboard, but it asks for an FTP server.
I installed vsftp but couldn't connect to the server, even after creating firewall rules. I was hoping someone could help.
As other have pointed out, knowing what type of firewall rules (and how) you have configured or if you followed a specific tutorial would be very helpful to provide a specific answer. I'll do my best to provide a general answer based on the details you shared.
It's not clear to me if you modified the firewall rules inside your instance or in the Cloud Console. This page describes the commands for working with firewall rules in GCP and offers some examples in using them. In case you were setting firewall rules within the instance, make sure both firewalls are configured properly.
I'm not familiar with vsftp but I found this tutorial that you may find helpful as it's specific for GCP.
As Gurpreet mentioned in his reply, you can use SSH keys to connect via SFTP instead. This is a tutorial to configure an SFTP connection with Filezilla and is also specific to GCP.
If you expanded your question with more details, screenshots, etc. maybe we could provide better suggestions to solve your issue.
You can use filezilla to connect to GCP through SFTP.
Web Host is your public IP
Username should be root by default unless you changed it
And, Password is your root password.
If you don't have the root password or not able to connect via SFTP You can use SSH keys.
Read this carefully regarding how to add SSH keys in Google Cloud Console:
https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys
After adding SSH keys, you can Filezilla without root password using SSH keys
https://tecadmin.net/import-private-key-in-filezilla/

How to launch PhpMyAdmin or MySQL Workbench for an AWS Ec2 WordPress instance?

I launched a WordPress instance in EC2 in AWS. Now I can access WordPress Dashboard. But how to access database? If I install WordPress in my PC I can easily access it via a local-host link. From AWS how can I access the same? Also, is there any possibility to connect the MySQL database via MySQL Workbench?
Thanks
Venkat
Venkata, you are able to access WordPress hosted on EC2 because the http port and https port is open in the firewall, check your inbound settings in security group.
You can access your MySQL Database hosted in same EC2 instance (in this specific case) if you can open the port for access, in inbound settings. Make sure you have a MySQL user created and you have user name and password for the user.
First On EC2 instance you have to configure complete LAMP stack and than you have to open the port from security groups from AWS console admin.
After installing LAMP stack and opening port you have to place adminer.php file on the /var/www/html directory or the directory where you installed the wordpress.
after that you can access the database and the wordpress

Connecting to MariaDB + Bitnami's Multi-tier

I'm still new to AWS and this is my first attempt at working with MariaDB; I'm used to dealing with hosting providers that already have something like cPanel installed so please be nice. :)
I'm using Bitnami's WordPress Multi-Tier with Amazon RDS for MariaDB
Bitnami's documentation is usually quite good, but in this particular case I'm not finding anything. I've reached out to their support and the only reply I've received until now was something akin to: "use a WordPress plugin to make database exports" which is obviously isn't going to cut the mustard when it comes to importing.
What I want to accomplish:
Connect to my database
Export my database
Import (overwrite) a database
Essentially, I want to deploy my local WordPress to AWS...files are all good, but I'm lost when it comes to databases.
(NOTE: I want to get out of the habit of relying on phpMyAdmin and, ideally, don't want to have to go through installing it, etc)
I started here: [Connecting to a DB Instance Running the MariaDB Database Engine][2]
After SSH'ing in I've tried:
Command: mysql
Outputs: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/bitnami/mariadb/tmp/mysql.sock' (2)
Command: mysql -h MY-DB-INSTANCE.us-east-1.rds.amazonaws.com -P 3306 -u bitnami
Outputs: Access denied for user 'bitnami'#'10.0.4.110' (using password: NO)
EDIT: I've split this thread into a separate one for other issues that I ran into.
Presumably your MySQL user bitnami actually has a password, so you may try this:
mysql -h MY-DB-INSTNACE.us-east-1.rds.amazonaws.com -P 3306 -u bitnami -p
^^^ add this
Your shell should prompt you for the password.
Beyond this, you need to make sure that you have opened your RDS instance to the IP from which you are trying to connect. You could open it to all IPs, but it is better practice to just open it to your dev machine, as well as the production machines which would be hitting the database. If you don't do this step, you also would not be able to connect.
Edit: If your user bitnami does not yet exist, then you may have to login as root and configure. Or perhaps you would have to reset the password if forgotten. You should always write down the admin credentials, as a last resort means of accessing your RDS instance.

woocommerce webhooks not firing

woocommerce webhooks aren't firing at all for me, even on a fresh install. I did the following:
Create a new MySQL database
Install WP from the zip file.
Set up WP.
Install Woocommerce.
Enable REST API and create a key.
Added "Coupon created" webhook, made sure it's set to active, and set it to a publicly accessible site.
When I create a coupon, the webhook does not fire, and no entry is created in the log. I tried this with orders as well and also doesn't work.
I think it's a machine configuration problem, but not sure what to change. The machine is an EC2 instance and has all ports opened in its security group policy.
Weirdest of all is that on a different EC2 instance does work, but it's a production machine and I want to have a dev server work so I can test out things. The only config differences between the production and dev machines that I can think of are the subnets and the firewall, but I don't understand why the subnet should matter and I opened all the firewall ports on the dev machine.
what Linux distributions are you running for prod and dev?
CentOS with SELinux enabled with not allow HTTPD scripts and modules to connect to network by default.
setsebool -P httpd_can_network_connect on
If above is not valid, please identify network problems by trying connecting to AWS RDS via SSH CLI. If you can open a connection via SSH CLI, the problem will be with your application. If you can't, it will be network problem. First thing to check in that case is AWS RDS security group. For testing you can open 3306 to public.
Let me know how it goes.

Resources