这里会显示出您选择的修订版和当前版本之间的差别。
| 两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
|
zh:常见问题及解答:如何为astercc系统配置多台php服务器 [2016/11/08 06:49] liuxl |
zh:常见问题及解答:如何为astercc系统配置多台php服务器 [2017/12/12 03:05] (当前版本) |
||
|---|---|---|---|
| 行 9: | 行 9: | ||
| <note> 注:做分布之前,先确保所有服务器的asterCC的版本必须是一样的,其次 安装相同的模块。 </note> | <note> 注:做分布之前,先确保所有服务器的asterCC的版本必须是一样的,其次 安装相同的模块。 </note> | ||
| + | |||
| + | <note important>多台集群服务器,请确保除了CTI上的asterccd进程正常启动外其它服务器该进程停止运行,且设置chkconfig关闭asterccd开机自动启动。mysql上crontab -e内设置的astercc定时任务全部用“#”号注释掉。</note> | ||
| 1.对系统进行分布配置前,首先需要将CTI机器上的数据库备份。 | 1.对系统进行分布配置前,首先需要将CTI机器上的数据库备份。 | ||
| 行 152: | 行 154: | ||
| 同PHP1 | 同PHP1 | ||
| - | <note tip><code> | + | <code> |
| 端口说明:请按实际情况,对/etc/sysconfig/iptables文件中端口进行保留。 | 端口说明:请按实际情况,对/etc/sysconfig/iptables文件中端口进行保留。 | ||
| 21:FTP默认端口 | 21:FTP默认端口 | ||
| 行 175: | 行 177: | ||
| 9000:php默认端口 | 9000:php默认端口 | ||
| 10000:20000:Asterisk中RTP要使用的端口 | 10000:20000:Asterisk中RTP要使用的端口 | ||
| - | </code></note> | + | </code> |
| 行 292: | 行 294: | ||
| 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?400|}} | ||
| 11.修改 /etc/php-fpm.d/www.conf 配置文件内容 | 11.修改 /etc/php-fpm.d/www.conf 配置文件内容 | ||
| 行 303: | 行 299: | ||
| <code> | <code> | ||
| [www] | [www] | ||
| - | listen=127.0.0.1 | + | listen=127.0.0.1:9000 |
| listen.allowed_clients=127.0.0.1 | listen.allowed_clients=127.0.0.1 | ||
| </code> | </code> | ||
| + | |||
| + | {{:zh:常见问题及解答:selection_052.png?750|}} | ||
| PHP1机器上: | PHP1机器上: | ||
| 行 327: | 行 325: | ||
| 12-1:在http中添加以下内容: | 12-1:在http中添加以下内容: | ||
| <code> | <code> | ||
| - | http{ | ||
| - | |||
| upstream myphp { | upstream myphp { | ||
| #ip_hash; PHP负载均衡 | #ip_hash; PHP负载均衡 | ||
| 行 334: | 行 330: | ||
| 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> | ||
| 行 341: | 行 338: | ||
| 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; | ||
| 行 353: | 行 348: | ||
| 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; | ||