龙兵安装mq super配置教程
龙兵的配置比较复杂,站长特意整理了一下大概流程,安装的会员们注意喽~~
必备的环境条件:
```
1.CentOS 7.X
2.Mysql 5.6/5.7
3.PHP 7.1
```
以下命令均在linux下操作
1.检查php版本
```
php
-version
```
如果版本是7.1.X 就执行下一步操作,如果不是,执行下面命令(修改PHP默认版本为7.1)
```
rm -f /usr/bin/php
ln -sf /www/server/php/71/bin/php /usr/bin/php
```
2.安装rabbitmq-server
```
yum install rabbitmq-server -y
```
3.安装supervisor
```
yum install supervisor -y
```
4.启动supervisor
```
systemctl enable supervisord.service
systemctl start supervisord
supervisorctl reload
```
5.配置rabbitmq
```
service rabbitmq-server restart
rabbitmq-plugins enable rabbitmq_management
chkconfig rabbitmq-server on
service rabbitmq-server restart
```
6.进入目录( 6-10步都在该目录操作)
路径一般是:www/wwwroot/站点目录/addons/longbing_card/core2
```
cd /www/wwwroot/站点目录/addons/longbing_card/core2
```
7.进入第六步的目录后,在宝塔或linux 查看该文件内容 centos_install.sh
确保前面几行内容如下(跟下面一模一样也可以)
```
process_num=3
website=longbing
php_path=php
```
8.确保centos_install.sh文件权限是755
9.执行该文件,命令复制:
```
./centos_install.sh
```
10.执行
```
php think Swoole-Im restart
```
11.进入站点设置里的配置文件,粘贴以下内容
Nginx用此配置
```
location /longbingwss
{
proxy_pass http://127.0.0.1:8005;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
}
```
Apache用此配置
```
ProxyRequests Off
ProxyPass /longbingwss ws://127.0.0.1:8005
ProxyPassReverse /longbingwss ws://127.0.0.1:8005
```
12.宝塔-计划任务添加以下内容
```
Shell 每小时执行
systemctl start supervisord
supervisorctl reload
service rabbitmq-server restart
```