| 两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 |
| zh:常见问题及解答:如何为astercc系统配置多台php服务器 [2016/11/17 02:21] – liuxl | zh:常见问题及解答:如何为astercc系统配置多台php服务器 [2016/11/23 01:38] (当前版本) – liuxl |
|---|
| |
| <note> 注:做分布之前,先确保所有服务器的asterCC的版本必须是一样的,其次 安装相同的模块。 </note> | <note> 注:做分布之前,先确保所有服务器的asterCC的版本必须是一样的,其次 安装相同的模块。 </note> |
| | |
| | <note important>多台集群服务器,请确保除了CTI上的asterccd进程正常启动外其它服务器该进程停止运行,且设置chkconfig关闭asterccd开机自动启动。mysql上crontab -e内设置的astercc定时任务全部用“#”号注释掉。</note> |
| |
| 1.对系统进行分布配置前,首先需要将CTI机器上的数据库备份。 | 1.对系统进行分布配置前,首先需要将CTI机器上的数据库备份。 |
| 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/ccscripts /opt/asterisk/scripts/astercc |
| </code> | </code> |
| |
| 设置开机自动挂载,主从机上可将所有挂载设置类似如下: | |
| <code>vim /etc/fstab</code> | |
| <code>文件末增加如下 : //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.修改 /etc/php-fpm.d/www.conf 配置文件内容 | 11.修改 /etc/php-fpm.d/www.conf 配置文件内容 |
| </code> | </code> |
| |
| | {{:zh:常见问题及解答:selection_052.png?750|}} |
| |
| PHP1机器上: | PHP1机器上: |
| 12-1:在http中添加以下内容: | 12-1:在http中添加以下内容: |
| <code> | <code> |
| http{ | |
| |
| upstream myphp { | upstream myphp { |
| #ip_hash; PHP负载均衡 | #ip_hash; PHP负载均衡 |
| server 192.168.1.70:9000 weight=2; | server 192.168.1.70:9000 weight=2; |
| } | } |
| } | |
| </code> | </code> |
| | |
| | {{:zh:常见问题及解答:selection_050.png?750|}} |
| |
| <note> 注:http中server内的listen xxxx default,是指的页面访问的端口号。 </note> | <note> 注:http中server内的listen xxxx default,是指的页面访问的端口号。 </note> |
| 12-2:在location中前面位置添加以下内容,并将默认配置的fastcgi_pass 127.0.0.1:9000; 用#号注释掉: | 12-2:在location中前面位置添加以下内容,并将默认配置的fastcgi_pass 127.0.0.1:9000; 用#号注释掉: |
| <code> | <code> |
| location ~ .*\.(php|php5)?$ | |
| { | |
| #这个表示login和reload时,使用本机的PHP服务,因此CTI的php-fpm服务是开启的,而且开机自启动 | #这个表示login和reload时,使用本机的PHP服务,因此CTI的php-fpm服务是开启的,而且开机自启动 |
| set $target myphp; | set $target myphp; |
| fastcgi_pass $target; | fastcgi_pass $target; |
| #fastcgi_pass 127.0.0.1:9000; | #fastcgi_pass 127.0.0.1:9000; |
| } | |
| </code> | </code> |
| | |
| | {{:zh:常见问题及解答:selection_051.png?750|}} |
| |
| <note> 注:PHP1与PHP2机器上,这些配置都不用管,因为PHP1和PHP2上不使用nginx服务,默认fastcgi_pass 均为 127.0.0.1:9000; | <note> 注:PHP1与PHP2机器上,这些配置都不用管,因为PHP1和PHP2上不使用nginx服务,默认fastcgi_pass 均为 127.0.0.1:9000; |