Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:faq:how_to_use_multiple_servers_for_astercc_system [2017/12/12 03:05] (current)
Line 1: Line 1:
 +====== How to configure multiple PHP servers for the asterCC system ======
 +
 +===== System Details =====
 +
 +  * CTI(Asterisk)、Nginx:192.168.1.62 ​ (Extranet IP:110.249.148.246)
 +  * MySQL:192.168.1.60
 +  * PHP1:192.168.1.61
 +  * PHP2:192.168.1.70
 +
 +<​note>​ Note: Before doing the distribution,​ make sure that the version of asterCC for all servers must be the same, followed by the same module. </​note>​
 +
 +1.Before distributing the system, you need to back up the database on the CTI machine. ​
 +<​code>​ mysqldump -uroot -ppassword astercc10 > file.sql </​code>​
 +
 +And then in the new mysql database server (192.168.1.60) on the backup data import.
 +<​code>​ mysql -uroot -ppassword astercc10 < file.sql </​code>​
 +
 +
 +2.On the MySQL machine, the CTI, PHP1, PHP2 machine database authorization.
 +In the mysql> under the implementation of the following order:
 +<​code>​ grant all privileges on astercc10.* to astercc@'​192.168.1.%'​ identified by '​asterccpw';​ </​code>​
 +
 +
 +3.In the CTI, PHP1, PHP2 three machines /​etc/​astercc.conf,​ revised: [database] and [statistics] tab under the database information:​
 +<​code>​
 +[database] ​
 +dbtype = mysql 
 +dbhost = 192.168.1.60 ​
 +dbname = astercc10 ​
 +dbport = 3306 
 +username = astercc ​
 +password = asterccpw ​
 +prefix= cc10_ 
 +
 +[statistics] ​
 +;​on/​off ​
 +status = on 
 +dbtype = mysql 
 +dbhost = 192.168.1.60 ​
 +dbname = astercc10 ​
 +dbport = 3306 
 +dbuser = astercc ​
 +dbpassword = asterccpw ​
 +prefix= cc10_ 
 +
 +
 +[system] ​
 +;if Cluster no,​php,​asterisk,​all ​
 +cluster = php 
 +</​code>​
 +
 +<​note>​ Note: The conf file in the system under the label, do what cluster, it will be modified into what. </​note>​
 +
 +
 +4.In /​var/​www/​html/​asterCC/​app/​config/​database.php file var $default=array database at the end of the file information is modified as follows:
 +
 +class DATABASE_CONFIG { 
 +        var $default = array( ​
 +                '​driver'​ => '​mysql', ​
 +                '​persistent'​ => false, ​
 +                '​host'​ => '​192.168.1.60', ​
 +                '​login'​ => '​astercc', ​
 +                '​password'​ => '​asterccpw', ​
 +                '​database'​ => '​astercc10', ​
 +                '​prefix'​ => '​cc10_', ​
 +                '​encoding'​ => '​utf8', ​
 +        ); 
 +
 +<​note>​ Note: The contents of $test need not be modified。 </​note>​
 +
 +
 +5.Configure the iptables service, the implementation of the machine configuration is complete:service iptables restart ​
 +
 +CTI (and Nginx) machines:
 +<​code>​
 +*filter ​
 +:INPUT DROP [32888:​6036616] ​
 +:FORWARD DROP [0:0] 
 +:OUTPUT ACCEPT [38964:​13133002] ​
 +-A INPUT -p udp -m udp --dport 5060 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 4569 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 5036 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 10000:20000 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 2727 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 137:138 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 123 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 8081 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 21 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 139 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 389 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 445 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 5038 -j ACCEPT ​
 +-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT ​
 +-A INPUT -s 127.0.0.1/​32 -d 127.0.0.1/​32 -j ACCEPT ​
 +-A INPUT -m state --state ESTABLISHED -j ACCEPT ​
 +COMMIT
 +</​code>​
 +
 +
 +On a MySQL machine:
 +<​code>​
 +*filter ​
 +:INPUT DROP [32888:​6036616] ​
 +:FORWARD DROP [0:0] 
 +:OUTPUT ACCEPT [38964:​13133002] ​
 +-A INPUT -p udp -m udp --dport 5060 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 4569 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 5036 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 10000:20000 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 2727 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 21 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 161 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 161 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 162 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 162 -j ACCEPT ​
 +-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT ​
 +-A INPUT -s 127.0.0.1/​32 -d 127.0.0.1/​32 -j ACCEPT ​
 +-A INPUT -m state --state ESTABLISHED -j ACCEPT ​
 +COMMIT ​
 +</​code>​
 +
 +
 +On PHP1 machines:
 +<​code>​
 +*filter ​
 +:INPUT ACCEPT [32888:​6036616] ​
 +:FORWARD ACCEPT [0:0] 
 +:OUTPUT ACCEPT [38964:​13133002] ​
 +-A INPUT -p udp -m udp --dport 5060 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 4569 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 5036 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 10000:20000 -j ACCEPT ​
 +-A INPUT -p udp -m udp --dport 2727 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 9000 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 21 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT ​
 +-A INPUT -p tcp -m tcp --dport 5038 -j ACCEPT ​
 +COMMIT ​
 +</​code>​
 +
 +
 +On PHP2 machines:
 +like PHP1
 +
 +<​code>​
 +Port: According to the actual situation, the /​etc/​sysconfig/​iptables file to retain the port.
 +21: FTP default port
 +22: SSH default port
 +80: http acquiescence port, because I changed the machine 8081, the CTI iptables added 8081
 +123: NTP default port
 +137: udp samba port
 +138: udp samba port
 +139: tcp samba port
 +389: tcp samba port
 +445: tcp samba port
 +901: tcp samba port
 +161: Port of SNMP
 +162: Port of the SNMP trap
 +443: https default port
 +2727: MGCP default port
 +3306: mysql default port
 +4569: IAX2 default port
 +5036: IAX1 default port
 +5038: Asterisk default port
 +5060: sip The default port
 +9000: php default port
 +10000: 20000: Asterisk RTP to use the port
 +</​code>​
 +
 +
 +6.In CTI, PHP1 installed samba services, the Executive Order:
 +<​code>​ yum install samba </​code>​
 +
 +
 +7.After installation is complete, create samba user and password, such as: sbu/123456,
 +run:
 +<​code>​ useradd sbu </​code>​
 +And then, when prompted, enter 123456:
 +<​code>​ smbpasswd -a sbu </​code>​
 +
 +8.Modify the samba configuration file /​etc/​samba/​smb.conf,​ smb.conf file at the end add the following:
 +
 +On a CTI machine:
 +<​code>​
 +[ccastspool] ​
 +        path = /​var/​spool/​asterisk ​
 +        comment = Home Directories ​
 +        browseable = no 
 +        writable = yes 
 +;       valid users = %S 
 +;       valid users = MYDOMAIN\%S ​
 +        create mask=777 ​
 +        directory mask = 777 
 +        force user = asterisk ​
 +
 +[ccastetc] ​
 +        path = /​etc/​asterisk/ ​
 +        comment = Home Directories ​
 +        browseable = no 
 +        writable = yes 
 +;       valid users = %S 
 +;       valid users = MYDOMAIN\%S ​
 +        create mask=777 ​
 +        directory mask = 777 
 +        force user = asterisk ​
 +
 +[ccastlib] ​
 +        path = /​var/​lib/​asterisk/ ​
 +        comment = Home Directories ​
 +        browseable = no 
 +        writable = yes 
 +;       valid users = %S 
 +;       valid users = MYDOMAIN\%S ​
 +        create mask=777 ​
 +        directory mask = 777 
 +        force user = asterisk ​
 +
 +[ccscripts] ​
 +        path = /​opt/​asterisk/​scripts/​astercc ​
 +        comment = Home Directories ​
 +        browseable = no 
 +        writable = yes 
 +;       valid users = %S 
 +;       valid users = MYDOMAIN\%S ​
 +        create mask=777 ​
 +        directory mask = 777 
 +        force user = asterisk
 +</​code>​
 +
 +On PHP1 machines:
 +<​code>​
 +[ccdata] ​
 +        path = /​var/​www/​html/​asterCC/​data ​
 +        comment = Home Directories ​
 +        browseable = no 
 +        writable = yes 
 +;       valid users = %S 
 +;       valid users = MYDOMAIN\%S ​
 +        create mask=777 ​
 +        directory mask = 777 
 +        force user = asterisk ​
 +
 +[ccstatistics] ​
 +        path = /​var/​www/​html/​asterCC/​statistics ​
 +        comment = Home Directories ​
 +        browseable = no 
 +        writable = yes 
 +;       valid users = %S 
 +;       valid users = MYDOMAIN\%S ​
 +        create mask=777 ​
 +        directory mask = 777 
 +        force user = asterisk ​
 +</​code>​
 +
 +
 +9.After the configuration is complete, restart the Samba service configuration to take effect, execute the command:
 +<​code>​ service smb restart </​code>​
 +
 +10.The samba file, mounted on each other. (For example, on a CTI machine, mount the ccdata from the PHP1 machine to the /​var/​www/​html/​asterCC/​data directory on the CTI machine, and then mount the cdt file on the CTI machine. Then need to CTI machines, /​var/​www/​html/​asterCC/​data backup, the backup process is not described here in detail)
 +
 +
 +On the CTI machine, execute the following commands to mount:
 +<​code>​
 +mount -t cifs -o username=sbu,​password=123456 //​192.168.1.61/​ccdata /​var/​www/​html/​asterCC/​data
 +mount -t cifs -o username=sbu,​password=123456 //​192.168.1.61/​ccstatistics /​var/​www/​html/​asterCC/​statistics ​
 +</​code>​
 +
 +PHP1 machines, followed by the implementation of orders, carrying:
 +<​code>​
 +mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccastspool /​var/​spool/​asterisk ​
 +mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccscripts /​opt/​asterisk/​scripts/​astercc ​
 +mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccastlib /​var/​lib/​asterisk ​
 +mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccastetc /​etc/​asterisk
 +</​code>​
 +
 +PHP2 machines, followed by orders for carrying:
 +<​code>​
 +mount -t cifs -o username=sbu,​password=123456 //​192.168.1.61/​ccstatistics /​var/​www/​html/​asterCC/​statistics
 +mount -t cifs -o username=sbu,​password=123456 //​192.168.1.61/​ccdata /​var/​www/​html/​asterCC/​data
 +mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccastspool /​var/​spool/​asterisk ​
 +mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccastlib /​var/​lib/​asterisk ​
 +mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccastetc /​etc/​asterisk ​
 +mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccscripts /​opt/​asterisk/​scripts/​astercc
 +</​code>​
 +
 +Set the boot automatically mount, master and slave can be mounted on all the settings are similar to the following:
 +<​code>​vim /​etc/​fstab</​code>​
 +<​code>​At the end of the document, add the following: //​192.168.1.61/​ccdata /​var/​www/​html/​asterCC/​data cifs defaults,​username=sbu,​password=123456 0 0</​code>​
 +
 +{{:​zh:​常见问题及解答:​selection_004.png?​750|}}
 +
 +11.Modify the contents of the /​etc/​php-fpm.d/​www.conf configuration file
 +On a CTI machine:
 +<​code>​
 +[www]
 +listen=127.0.0.1
 +listen.allowed_clients=127.0.0.1
 +</​code>​
 +
 +On PHP1 machines:
 +<​code>​
 +[www]
 +listen=192.168.1.61:​9000
 +listen.allowed_clients=127.0.0.1,​192.168.1.61,​192.168.1.62
 +</​code>​
 +
 +On PHP2 machines:
 +<​code>​
 +[www]
 +listen=192.168.1.70:​9000
 +listen.allowed_clients=127.0.0.1,​192.168.1.70,​192.168.1.62
 +</​code>​
 +
 +
 +12.Modify the /​usr/​local/​nginx/​conf/​nginx.conf configuration file
 +On a CTI machine:
 +
 +12-1:In http add the following:
 +<​code>​
 +http{
 +
 +upstream myphp { 
 +        #ip_hash; PHP load balancing
 +        server 192.168.1.61:​9000 weight=2; ​
 +        server 192.168.1.70:​9000 weight=2; ​
 +    }
 +}
 +</​code>​
 +
 +<​note>​ 注:http中server内的listen xxxx default,Is the port number of the page access. </​note>​
 +
 +12-2:In the location in front of the location to add the following, and the default configuration fastcgi_pass 127.0.0.1:​9000;​ commented out with '#':​
 +<​code>​
 +location ~ .*\.(php|php5)?​$ ​
 +
 +      # This means that the login and reload, the use of the machine'​s PHP service, so CTI's php-fpm service is turned on, and boot from the start
 +        set $target myphp; ​
 +        if ($request_uri ~* login) { 
 +            set $target 127.0.0.1:​9000; ​
 +        } 
 +        if ($request_uri ~* reloadConf) { 
 +            set $target 127.0.0.1:​9000; ​
 +        } 
 +        fastcgi_pass ​ $target; ​
 +        #​fastcgi_pass ​ 127.0.0.1:​9000; ​
 +}
 +</​code>​
 +
 +<​note>​ Note: PHP1 and PHP2 machines, these configurations do not control, because PHP1 and PHP2 do not use nginx services, the default fastcgi_pass are 127.0.0.1:​9000;​
 +
 +If you only use one server (such as: PHP1) to run PHP services, rather than using PHP load balancing, then, CTI does not need to add any content. And the location of the first sentence set $ target myphp; content also need to modify the address plus PHP1 port, namely: set $ target 192.168.1.61:​9000;​
 +</​note>​
 +
 +
 +13.Authorize the sharing of related documents
 +
 +On a CTI machine:
 +
 +13-1:First copy to the mount directory:
 +<​code>​ cp -Rp /​var/​www/​html/​asterCC/​app/​views/​agents/​agentsxindesk.ctp /​var/​www/​html/​asterCC/​statistics/​agentsxindesk.ctp </​code>​
 +Then execute:
 +<​code>​ ln -s /​var/​www/​html/​asterCC/​statistics/​agentsxindesk.ctp /​var/​www/​html/​asterCC/​app/​views/​agents/​agentsxindesk.ctp </​code>​
 +
 +13-2:copy:​
 +<​code>​ cp -Rp /​var/​www/​html/​asterCC/​app/​config/​database.php /​var/​www/​html/​asterCC/​statistics/​database.php </​code>​
 +Then execute:
 +<​code>​ ln -s /​var/​www/​html/​asterCC/​statistics/​database.php /​var/​www/​html/​asterCC/​app/​config/​database.php </​code>​
 +
 +13-3:/​opt/​asterisk/​scripts/​astercc/​identity.astercc file, do not do anything, but to ensure that the file is the beginning of the CTI machine mount before the backup file.
 +13-4:/​opt/​asterisk/​scripts/​astercc/​license.astercc文件, do not do anything, but to ensure that the document is the beginning of the CTI machine before loading the backup file.
 +
 +13-5:copy:
 +<​code>​ cp -Rp /​usr/​local/​conf/​hcdesk.conf /​opt/​asterisk/​scripts/​astercc/​hcdesk.conf </​code>​
 +run:
 +<​code>​ ln -s /​opt/​asterisk/​scripts/​astercc/​hcdesk.conf /​usr/​local/​conf/​hcdesk.conf </​code>​
 +
 +
 +13-6:copy:
 +<​code>​ cp -Rp /​etc/​astercc.conf /​opt/​asterisk/​scripts/​astercc/​astercc.conf </​code>​
 +run:
 +<​code>​ ln -s /​opt/​asterisk/​scripts/​astercc/​astercc.conf /​etc/​astercc.conf </​code>​
 +
 +
 +PHP1 machine:
 +
 +13-7:Back up the agentsxindesk.ctp file of the machine into agentsxindesk.ctp.bak
 +Backup:
 +<​code>​ mv /​var/​www/​html/​asterCC/​app/​views/​agents/​agentsxindesk.ctp /​var/​www/​html/​asterCC/​app/​views/​agents/​agentsxindesk.ctp.bak </​code>​
 +run:
 +<​code>​ ln -s /​var/​www/​html/​asterCC/​statistics/​agentsxindesk.ctp /​var/​www/​html/​asterCC/​app/​views/​agents/​agentsxindesk.ctp </​code>​
 +
 +13-8:Backup:
 +<​code>​ mv /​var/​www/​html/​asterCC/​app/​config/​database.php /​var/​www/​html/​asterCC/​app/​config/​database.php.bak </​code>​
 +run:
 +<​code>​ ln -s /​var/​www/​html/​asterCC/​statistics/​database.php /​var/​www/​html/​asterCC/​app/​config/​database.php </​code>​
 +
 +
 +13-9:The machine'​s hcdesk.conf file backup hcdesk.conf.bak
 +Backup:
 +<​code>​ mv /​usr/​local/​conf/​hcdesk.conf /​usr/​local/​conf/​hcdesk.conf.bak </​code>​
 +run:
 +<​code>​ ln -s /​opt/​asterisk/​scripts/​astercc/​hcdesk.conf /​usr/​local/​conf/​hcdesk.conf </​code>​
 +
 +13-10:The local astercc.conf file backup astercc.conf.bak
 +Backup:
 +<​code>​ mv /​etc/​astercc.conf /​etc/​astercc.conf.bak </​code>​
 +run:
 +<​code>​ ln -s /​opt/​asterisk/​scripts/​astercc/​astercc.conf /​etc/​astercc.conf </​code>​
 +
 +On PHP2 machines:
 +
 +13-11:Back up the agentsxindesk.ctp file of the machine into agentsxindesk.ctp.bak
 +Backup:
 +<​code>​ mv /​var/​www/​html/​asterCC/​app/​views/​agents/​agentsxindesk.ctp /​var/​www/​html/​asterCC/​app/​views/​agents/​agentsxindesk.ctp.bak </​code>​
 +run:
 +<​code>​ ln -s /​var/​www/​html/​asterCC/​statistics/​agentsxindesk.ctp /​var/​www/​html/​asterCC/​app/​views/​agents/​agentsxindesk.ctp </​code>​
 +
 +13-12:Backup:
 +<​code>​ mv /​var/​www/​html/​asterCC/​app/​config/​database.php /​var/​www/​html/​asterCC/​app/​config/​database.php.bak </​code>​
 +run:
 +<​code>​ ln -s /​var/​www/​html/​asterCC/​statistics/​database.php /​var/​www/​html/​asterCC/​app/​config/​database.php </​code>​
 +
 +13-13:The machine'​s hcdesk.conf file backup hcdesk.conf.bak
 +Backup:
 +<​code>​ mv /​usr/​local/​conf/​hcdesk.conf /​usr/​local/​conf/​hcdesk.conf.bak </​code>​
 +run:
 +<​code>​ ln -s /​opt/​asterisk/​scripts/​astercc/​hcdesk.conf /​usr/​local/​conf/​hcdesk.conf </​code>​
 +
 +13-14:The local astercc.conf file backup astercc.conf.bak
 +Backup:
 +<​code>​ mv /​etc/​astercc.conf /​etc/​astercc.conf.bak </​code>​
 +run:
 +<​code>​ ln -s /​opt/​asterisk/​scripts/​astercc/​astercc.conf /​etc/​astercc.conf </​code>​
 +
 +
 +14.Modify the contents of some files
 +
 +On a CTI machine:
 +
 +/​etc/​asterisk/​manager.conf file,at the end of the file, add the following information on the network segment, and then save and exit, execute the command:
 +<​code>​ asterisk -rx "​manager reload"​ </​code>​
 +
 +<​code>​
 +[astercc]
 +secret = asterccsecret ​
 +deny=0.0.0.0/​0.0.0.0 ​
 +permit=127.0.0.1/​255.255.255.0 ​
 +permit=192.168.1.0/​255.255.255.0 ​
 +read = system,​call,​agent ​
 +write = system,​call,​agent,​user,​config,​command,​reporting,​originate ​
 +</​code>​
 +
 +/​etc/​astercc.conf file, [asterisk] under the label, server fill CTI IP
 +<​code>​
 +[asterisk] ​
 +server = 192.168.1.62 ​
 +port = 5038 
 +username = astercc ​
 +secret = asterccsecret ​
 +</​code>​
 +
 +
 +15.Note / etc / asterisk permissions,​ asterisk: asterisk
 +
 +16.Crontab file content, the implementation of: crontab-e for its content editing. Crontab start monitoring procedures can be complementary,​ do not have to repeat the operation. ​
 +
 +CTI:
 +
 +<​code>​
 +30 12 * * * /​opt/​asterisk/​scripts/​astercc/​processmonitors -d 
 +30 20 * * * /​opt/​asterisk/​scripts/​astercc/​processmonitors -d 
 +30 23 * * * /​opt/​asterisk/​scripts/​astercc/​processmonitors -d 
 +* * * * * /​var/​www/​html/​asterCC/​cake/​console/​cake -app /​var/​www/​html/​asterCC/​app asterccdelete >/​dev/​null 2>&​1 ​
 +10 2 * * * /​var/​www/​html/​asterCC/​cake/​console/​cake -app /​var/​www/​html/​asterCC/​app nighttask >/​dev/​null 2>&​1 ​
 +10 0 * * * /​opt/​asterisk/​scripts/​astercc/​agent_report -d 
 +20 0 * * * /​opt/​asterisk/​scripts/​astercc/​agentgroup_report -d 
 +</​code>​
 +
 +MySQL:
 +Delete all, do not need to carry out any procedure.
 +
 +
 +PHP1 and PHP2, the two machines need to be divided according to the configuration and load the implementation of the script, the two machines do not have to do, so complementary to the following script:
 +<​code>​
 +* * * * * /​var/​www/​html/​asterCC/​cake/​console/​cake -app /​var/​www/​html/​asterCC/​app checkonline >/​dev/​null 2>&​1 ​
 +* 2 * * * /​opt/​asterisk/​scripts/​astercc/​astcc_backup.sh >/​dev/​null 2>&​1 ​
 +* * * * * /​var/​www/​html/​asterCC/​cake/​console/​cake -app /​var/​www/​html/​asterCC/​app monitortar >/​dev/​null 2>&​1 ​
 +* * * * * /​var/​www/​html/​asterCC/​cake/​console/​cake -app /​var/​www/​html/​asterCC/​app backupmonitor >/​dev/​null 2>&​1 ​
 +* * * * * /​var/​www/​html/​asterCC/​cake/​console/​cake -app /​var/​www/​html/​asterCC/​app export >/​dev/​null 2>&​1 ​
 +* * * * * /​var/​www/​html/​asterCC/​cake/​console/​cake -app /​var/​www/​html/​asterCC/​app asterccimport >/​dev/​null 2>&​1 ​
 +*/5 * * * * /​var/​www/​html/​asterCC/​cake/​console/​cake -app /​var/​www/​html/​asterCC/​app calculate >/​dev/​null 2>&​1 ​
 +* * * * * /​var/​www/​html/​asterCC/​cake/​console/​cake -app /​var/​www/​html/​asterCC/​app mailman >/​dev/​null 2>&​1 ​
 +* * * * * /​var/​www/​html/​asterCC/​cake/​console/​cake -app /​var/​www/​html/​asterCC/​app campaignpackgetask >/​dev/​null 2>&​1 ​
 +* * * * * /​var/​www/​html/​asterCC/​cake/​console/​cake -app /​var/​www/​html/​asterCC/​app blacklistfilter >/​dev/​null 2>&​1 ​
 +* * * * * /​var/​www/​html/​asterCC/​cake/​console/​cake -app /​var/​www/​html/​asterCC/​app asterccfilter >/​dev/​null 2>&​1 ​
 +* * * * * /​opt/​asterisk/​scripts/​astercc/​astcc_historydata -d 
 +</​code>​
 +
 +
 +17.Mount mount detection, need to be added to the crontab.
 +CTI:
 +<​code>​
 +*/5 * * * * dfccdata=`df |grep ccdata`; [ "​X${dfccdata}"​ = "​X"​ ] && `mount -t cifs -o username=sbu,​password=123456 //​192.168.1.61/​ccdata /​var/​www/​html/​asterCC/​data`; ​
 +*/5 * * * * dfccstatistics=`df |grep ccstatistics`;​ [ "​X${dfccstatistics}"​ = "​X"​ ] && `mount -t cifs -o username=sbu,​password=123456 //​192.168.1.61/​ccstatistics /​var/​www/​html/​asterCC/​statistics`;​
 +</​code>​
 +
 +
 +PHP1:
 +<​code>​
 +*/5 * * * * dfccastspool=`df |grep ccastspool`;​ [ "​X${dfccastspool}"​ = "​X"​ ] && `mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccastspool /​var/​spool/​asterisk/​`; ​
 +*/5 * * * * dfastetc=`df |grep etc/​asterisk`;​ [ "​X${dfastetc}"​ = "​X"​ ] && `mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccastetc /​etc/​asterisk/​`; ​
 +*/5 * * * * dfccastlib=`df |grep ccastlib`; [ "​X${dfccastlib}"​ = "​X"​ ] && `mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccastlib /​var/​lib/​asterisk/​`; ​
 +*/5 * * * * dfccscripts=`df |grep ccscripts`; [ "​X${dfccscripts}"​ = "​X"​ ] && `mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccscripts /​opt/​asterisk/​scripts/​astercc/​`;​
 +</​code>​
 +
 +
 +PHP2:
 +<​code>​
 +*/5 * * * * dfccdata=`df |grep ccdata`; [ "​X${dfccdata}"​ = "​X"​ ] && `mount -t cifs -o username=sbu,​password=123456 //​192.168.1.61/​ccdata /​var/​www/​html/​asterCC/​data`; ​
 +*/5 * * * * dfccstatistics=`df |grep ccstatistics`;​ [ "​X${dfccstatistics}"​ = "​X"​ ] && `mount -t cifs -o username=sbu,​password=123456 //​192.168.1.61/​ccstatistics /​var/​www/​html/​asterCC/​statistics`; ​
 +
 +*/5 * * * * dfccastspool=`df |grep ccastspool`;​ [ "​X${dfccastspool}"​ = "​X"​ ] && `mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccastspool /​var/​spool/​asterisk/​`; ​
 +*/5 * * * * dfastetc=`df |grep etc/​asterisk`;​ [ "​X${dfastetc}"​ = "​X"​ ] && `mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccastetc /​etc/​asterisk/​`; ​
 +*/5 * * * * dfccastlib=`df |grep ccastlib`; [ "​X${dfccastlib}"​ = "​X"​ ] && `mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccastlib /​var/​lib/​asterisk/​`; ​
 +*/5 * * * * dfccscripts=`df |grep ccscripts`; [ "​X${dfccscripts}"​ = "​X"​ ] && `mount -t cifs -o username=sbu,​password=123456 //​192.168.1.62/​ccscripts /​opt/​asterisk/​scripts/​astercc/​`;​
 +</​code>​
 +
 +
 +18.At last,
 +
 +On CTI machine,​run:​
 +<​code>​ /​opt/​asterisk/​scripts/​astercc/​asterccc --RNI </​code>​
 +On PHP1 machine,​run:
 +<​code>​ /​opt/​asterisk/​scripts/​astercc/​asterccc --ADI </​code>​
 +On php2 machine,run
 +<​code>​ /​opt/​asterisk/​scripts/​astercc/​asterccc --ADI </​code>​
 +
 +Normal CTI will be prompted: 001, in PHP1 will prompt 002, PHP2 will prompt 003, and then re-do authorization. In the CTI run: service asterccd restart, the process of see if there is an error.
  
en/faq/how_to_use_multiple_servers_for_astercc_system.txt · Last modified: 2017/12/12 03:05 (external edit)
Recent changes RSS feed Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki