My FreePBX on a VPS has been running for quite some time already.
Just recently I tried maximizing my VPS by adding some virtual hosts (multiple domains in 1 VPS).
I had also removed (via Webmin) all anonymous/no_password mysql users as my server was compromised (i.e. someone added an unauthorized route).
I don’t know which caused the problem but when I tried logging in on the FreePBX Administration link am getting this error.
FATAL ERROR
DB Error: connect failed
Both Voicemail & Recordings (ARI and Flash Operator Panel (FOP)links are still working.
Already remove the virtual host…
Also, I can still register to my SIP extensions and can do outgoing calls…
I need the login to work for me to administer (e.g add extensions, users, trunks, routes, etc).
Hoping for some guide/help in resolving the issue.
Changing back the default account freepbx/pbx (user/password) seems to did the trick. I can already login to the http interface w/o any error.
(Perhaps this is the same account used to hack into my server.)
Question left now is, how can I change the default freepbx/fpbx account w/o getting the same error? It can’t be modified by the passwd command?
Will try to change manually in the amportal.conf, hopefully it won’t cause any error though (previous change was made via Webmin).
On security:
I already tried limiting access to my server by only allowing specific IP ranges for Webmin & SHH… but I dunno how to limit access to http freepbx interface and all others-- although, entering the server’s IP address will now route to my other website. Entering the domain will still get the http interface.
from a command prompt as root run the command “mysql” without the quotes. Depending on if you’ve overridden the username/password combination you might need to pass switches “mysql –u root –p” or some combination to login.
once inside the mysql prompt run the SQL statement “use mysql”
then run the SQL statement “UPDATE user set Password=PASSWORD(‘newsecretpassword’) WHERE User=’freepbx’
then run the SQL statement “flush privileges”
exit the mysql prompt
use a text editor to open /etc/amportal.conf
find the AMPDBPASS line and change the value fpbx to your newsecretpassword that you set earlier in MySQL
text editor next on /etc/asterisk/cdr_mysql.conf
find the fpbx password value and replace the old password with your newsecretpassword
text editor next on /etc/asterisk/extensions_additional.conf (I know you shouldn’t edit this directly but you need to since you can’t “Apply Changes” to regenerate this file yet)
find the fpbx password value and replace the old password with your newsecretpassword
now that you’ve changed these files execute a amportal restart command and you should be good to go
hi…
someone please help me i have same problem
i has tried command # /etc/amportal.conf
then i got this>> -bash: /etc/amportal.conf: Permission denied
what happen with our FreePBX??
Working fine on Friday. Didn’t change anything.
Then Monday morning, I tried to use admin gui and failed.
Server says mysql is not running.
Hope I have better luck with a response than he did.
Got most recent stable version of FreePBX (Stable-5.211.65-5) mostly set up yesterday. Shut down machine overnight and planned on finishing set up today, but after starting up this morning I’m receiving this when trying to login to GUI:
FATAL ERROR
DB Error: connect failed
Trace Back
/var/www/html/admin/libraries/db_connect.php:63 die_freepbx()
[0]: DB Error: connect failed
Tried restarting mysqld service. Here’s what I get:
[root@localhost etc]# service mysqld restart
Stopping mysqld: [ OK ]
Another MySQL daemon already running with the same unix socket.
Starting mysqld: [FAILED]
Tried stopping mysqld and starting as separate operations, same problem.
No login attempts to mysql from the command line succeed. I get…
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
When I try to nano mysql.sock I get…
Error reading mysql.sock: No such device or address
This is a default installation. I’ve only worked through the GUI so far. The install is fresh, there’s plenty of space both in RAM and on the hard disk. Every suggestion I’ve looked up advises going into mysql to try this or that, but I can’t get in. MySQL appears to be running; I appear to be able to stop it successfully; but whenever I try to start it, it says it’s already running.
I’m stumped. Have things somehow corrupted on day 2? Any advice would be much appreciated.
Solved the problem by renaming the mysql.sock file and then restarting both the mysqld service and the asterisk service. I was in a hurry to shutdown the machine last night and just powered it off rather than shutting it down smoothly. That this tanked the pbx makes me nervous. I’m in a rural area and we have power outages semi-regularly. Is this normal behavior? No other linux distro I’ve worked with gets so messed up by a simple loss of power. Anything to do about it? I’ll not always be around to clean up after an outage.
I have the same issue, which I solved with following:
service mysqld stop
mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
service mysqld start
service asterisk restart
The problem is that if I shutdown the server and restart, I have to do this again! I had this issue twice, in both times Freebbx was working fine, and then I got a bunch of errors on the centos console. The firs time I rebuilt the system from scratch and restored backup. When it happen again after a few days working… I used the above. Both times I built from an USB Key on my netbook.
There is a bug in the variant of CentOS we use that doesnt shutdown mysql correctly leaving the socket file behind, when mysql starts it sees the socket file and thinks that it’s already running so aborts.
If you run: yum install mysql-init-fixer
It removes the socket file on startup to avoid this issue.