TIPS Security/MySql on piaf-green-asterisk11-2-1-freepbx2-11 ami

Norman Domingo

New Member
Joined
Jul 2, 2014
Messages
8
Reaction score
1
I have installed PIAF Green using the piaf-green-asterisk11-2-1-freepbx2-11 ami on EC2 and installed Travelin Man.

I'm working my way on creating an IVR which is dependent on MySQL data. I have a website written on asp.net and hosted on SmarterAsp and MochaHost which serves as my data source. My asp.net site needed to access the MySQL database on my EC2 which is used by my IVR.

My problem is that my asp.net site throws an exception "Unable to connect to any of the specified MySQL hosts" when it connects to MySQL on EC2. I have a dedicated ip on both of my hosting sites.

I don't get the exception when I run my asp.net application on my home computer which uses Comcast dsl and also on my work.

My MySQL my.cnf is very basic:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
port=3306

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

I follow the following steps so my asp.net site can connect remotely to MySql
1. Created MySQL user account using GRANT ALL ON dbname.* TO user@'theIP' IDENTIFIED BY 'password'
2. Add MySQL/TCP/3306/theIP to my EC2 Security Groups
3. Add theIP using add-ip

The steps above are the same steps I used for my home and work computer and they both work but not for my 2 external hosting accounts.

I have contacted amazon and my hosting providers but they all claim that the problem is not on their side. Giving them the benefit of the doubt, I am now left with the piaf-green-asterisk11-2-1-freepbx2-11 ami I used. What could possibly be blocking the requests of my external hosting sites when they connect on port 3306?

Any insight and help will be greatly appreciated.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
So you can connect to the DB on EC2 from your home computer, but not your asp.net app? Could it be that the asp.net app hosting company is blocking outbound MySQL?
 

Norman Domingo

New Member
Joined
Jul 2, 2014
Messages
8
Reaction score
1
Thanks for your reponse Rossiv.

One of them (SmarterAsp) was blocking it and have to pay $24 to unblock outgoing messages to external hosts.

I did tcpdump on port 3306, then I loaded up my asp.net page that was getting the exception. It gave me this:
15:23:19.220634 IP wbm3.my-hosting-panel.com.64564 > ip-172-31-20-128.ec2.internal.mysql: Flags [SEW], seq 1282957530, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
15:23:22.262613 IP wbm3.my-hosting-panel.com.64564 > ip-172-31-20-128.ec2.internal.mysql: Flags [SEW], seq 1282957530, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
15:23:28.431660 IP wbm3.my-hosting-panel.com.64564 > ip-172-31-20-128.ec2.internal.mysql: Flags , seq 1282957530, win 8192, options [mss 1460,nop,nop,sackOK], length 0

It seems that my asp.net page is able to hit the server but for some reason is not able to communicate with MySQL.
 

Members online

No members online now.

Forum statistics

Threads
25,812
Messages
167,763
Members
19,241
Latest member
bellabos
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top