separate web and database configuration

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

separate web and database configuration

Postby asterguy » Thu May 09, 2013 6:04 am

Hi,

I'm building a setup where web server and database server is separated. According to some tutorials I managed to progress.. However I'm not sure if this is the only things I need to do.

Web
1. edit /var/www/agc/dbconnect.php and /var/www/vicidial/dbconnect.php with your credentials on the external DB.

AGC (/var/www/agc/dbconnect.php)
#defaults for DB connection
#defaults for DB connection
$VARDB_server = 'externaldbipaddress';
$VARDB_port = '3306';
$VARDB_user = 'dbuser';
$VARDB_pass = 'dbpassword';
$VARDB_database = 'dbname';

$WeBServeRRooT = '/var/www';

VICIDIAL (/var/www/vicidial/dbconnect.php)
#defaults for DB connection
$VARDB_server = 'externaldbipaddress';
$VARDB_port = '3306';
$VARDB_user = 'dbuser';
$VARDB_pass = 'dbpass';
$VARDB_database = 'dbname';

$WeBServeRRooT = '/var/www';

Questions:
1. Is $VARDB_pass the dbuser password?
2. Is $VARDB_database the database name?


2. Edit /etc/astguiclient.conf
# The IP address of this machine
VARserver_ip => webserverip

# Database connection information
VARDB_server => externaldbip
VARDB_database => externaldatabase
VARDB_user => dbuser
VARDB_pass => dbpass
VARDB_port => 3306


DB
1. edit my.cnf to allow remote connections
2. grant permissions to root and cron to allow remote connections.

Time (configured with NTP):
1. Go to the Web Server and check the timezone.
2. Go to the DB Server and check the timezone. Both of them should have the same.


Questions:
1. After doing this, do I still need to configure something in the VICIDIAL Admin panel?
2. Do I still need to configure something in the WEB Server console (perl scripts)?


Regards,
Lui
asterguy
 
Posts: 41
Joined: Thu Aug 07, 2008 4:30 pm

Re: separate web and database configuration

Postby asterguy » Thu May 09, 2013 9:04 am

Hi,

As for an update. I can now login as an agent on my vicidial server. I can hear the lady saying "your are now the only person in this conference". I set the campaign to manual dial just for test. The manual dial worked and i can call fine.

However I'm getting this error in my asterisk CLI.

Connect to 'agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----0---------------' failed: Connection refused


Does anyone know how what configuration file to modify to fix this issue?



Regards,
Lui
asterguy
 
Posts: 41
Joined: Thu Aug 07, 2008 4:30 pm

Re: separate web and database configuration

Postby asterguy » Thu May 09, 2013 10:14 am

Hi,

Another Update. The issue above is because the cron db user credentials were not setup.

mysql:

GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on dbname.* TO cron@'%' IDENTIFIED BY '{cronpassword}';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on dbname.* TO cron@localhost IDENTIFIED BY '{cronpassword}';
GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost;
flush privileges;
SET GLOBAL connect_timeout=60;
exit

Solved my own issues!


Regards,
Lui
asterguy
 
Posts: 41
Joined: Thu Aug 07, 2008 4:30 pm

Re: separate web and database configuration

Postby DomeDan » Thu May 09, 2013 3:59 pm

Thumbs up for postbacks! 8)
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: separate web and database configuration

Postby asterguy » Fri May 10, 2013 3:05 am

Thanks! @Domdan

I posted my updates so that other people will know how it was solved. By the way I might create some tutorials about vicidial on my blog http://asteriskopensourcev2.blogspot.com/ :)
asterguy
 
Posts: 41
Joined: Thu Aug 07, 2008 4:30 pm

Re: separate web and database configuration

Postby hashtagjet » Tue Aug 07, 2018 11:04 pm

What version of vicidial is this?

I'm running version 8.0.1. I'm wondering if the instructions on this page still works for version 8.
hashtagjet
 
Posts: 30
Joined: Thu Jul 12, 2018 3:16 am

Re: separate web and database configuration

Postby hashtagjet » Tue Aug 07, 2018 11:19 pm

I tried this a while back. This is the error that I had.
Image
Did you encounter the same issue after pointing it to another database before? Although I did only change ASTGUI db config and not the other vicidial db config.
hashtagjet
 
Posts: 30
Joined: Thu Jul 12, 2018 3:16 am

Re: separate web and database configuration

Postby hashtagjet » Wed Aug 08, 2018 4:51 am

Never mind. Issue resolved.
I was running the DB on Ubuntu and Vici on OpenSuse and they were connecting to different NTP server :-D Switched the Ubuntu NTP to opensuse :-)

server 0.opensuse.pool.ntp.org iburst
server 1.opensuse.pool.ntp.org iburst
server 2.opensuse.pool.ntp.org iburst
server 3.opensuse.pool.ntp.org iburst
hashtagjet
 
Posts: 30
Joined: Thu Jul 12, 2018 3:16 am

Re: separate web and database configuration

Postby williamconley » Wed Aug 08, 2018 10:48 am

Your system should have a single NTP server. That server should supply NTP to your cluster. That server should reach out to the world to get time. The other servers should use iBurst to "trust" that the time on your local NTP server is correct.

Note that the Vicidial servers don't need the correct time, but they MUST all have the same time.Thus having a single server checking with the world, but all servers syncing to that single master is the Best Way to get them all on the same time. iBurst allows almost immediate sync during boot so your cluster is UP immediately.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: separate web and database configuration

Postby hashtagjet » Thu Aug 09, 2018 1:27 am

Thanks for the Tip. Actually switched to the local time server.

Back to the separate DB topic.
After running using different DB, I noticed logging into admin is okay from the web ui but logging into agent generates issue. Says "System Settings Missing.
I look into the error logs and it points to a line in the code that was failed. (In the screenshot below).
I ran the DB query mentioned on the logs on the Database and it works so I'm a bit lost.
Is it because it's a different version? Do I need to install the same exact version of MariaDB?


Image

Edited. I think I truncated the error on the screenshot. Added error below.
Code: Select all
PHP Warning:  mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in /srv/www/htdocs/vicidial/admin.php on line 36357
hashtagjet
 
Posts: 30
Joined: Thu Jul 12, 2018 3:16 am

Re: separate web and database configuration

Postby williamconley » Thu Aug 09, 2018 6:32 pm

If you moved the DB to a different server with a different IP address, the servers must all have that new IP address to reach out and get their data for every single operations. And the new server must have appropriate credentials in place to allow these requests to succeed (ie: the cron user must exist and have the password listed in the astguiclient.conf file ... and the cron user must have permission to hit the asterisk DB from the IP of each of the servers ... beware private IP vs public ip, use the right one).

Credentials are stored in /etc/astguiclient.conf on every server. Use THOSE credentials to make that same query from the CLI of the server failing to connect. It should fail for the same reason. When you make the CLI query succeed, the rest should succed as well if you have matching settings in the CLI and astguiclient.conf file.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Support

Who is online

Users browsing this forum: No registered users and 87 guests

cron