icucoo

聊天源码Fakewechat搭建教程

安装Nginx、PHP7.2、Mysql5.5+、Redis、Mongodb

php安装扩展fileinfo redis Swoole4 mongodb

删除全部PHP禁用函数

开放80 8383 1236端口(或者直接开放全部端口)

修改mongodb 端口为28018

把代码中的http文件夹和socket文件夹都上传到服务器

导入数据库

/www/wwwroot/im/http/app/im/common/controller/ActionBegin1.php 修改GatwayWork服务地址
/www/wwwroot/im/http/config/database.php 修改数据库信息
/www/wwwroot/im/socket/app/im/common/controller/Main.php 修改数据库信息
/www/wwwroot/im/socket/app/im/common/controller/Config.php 修改IP

项目解析到 http/public 文件夹,用下面的伪静态

nginx伪静态:


location / {
    if (!-e $request_filename){
        rewrite  ^(.*)$  /index.php?s=$1  last;   break;
    }
}
location /wss {
        proxy_pass http://127.0.0.1:8383/; # 如果不行就改成你的ip:port
        proxy_connect_timeout 4s;
        proxy_read_timeout 7200s;
        proxy_send_timeout 12s;
    #     proxy_http_version 1.1;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
}

mongodb配置修改(这里以宝塔安装mongo位置示例)

cd /www/server/mongodb/bin
mkdir -p /www/wwwroot/mongodb/im
# ./mongorestore -h 127.0.0.1:28018 -d im -dir /www/wwwroot/mongodb/im  # 数据存放目录

ffmpeg安装

cd /opt
wget http://smiaoshen.oss-cn-hangzhou.aliyuncs.com/im/ffmeg.zip                          
unzip ffmeg.zip    

# 备用
#cd /opt
#wget http://www.ffmpeg.org/releases/ffmpeg-3.4.tar.gz
#tar -xvf ffmpeg-3.4.tar.gz
#mv ffmpeg-3.4 ffmpeg

安装yasm

cd /opt
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -zxvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure && make && make install
cd /opt
cd ffmpeg
./configure && make && make install

启动通信服务

cd /www/wwwroot/im/socket
php start.php start  # 这里执行完毕如果不报错,Ctrl + c 然后执行下面的语句
php start.php start -d # 守护进程启动

前端打包

工具使用HbuilderX,打开前端源码,项目的App.vue,修改里面的http_urlsocket_url static_url,打包即可

后台地址

后台地址:https://www.xxxx.com/admin_login

默认后台登录用户名:admin 密码:123456

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »