H5 Online IM Chat Instant Messaging Setup Tutorial Description

Server Operating System: Linux CentOS 7

Install BaoTa (Bt Panel)

BaoTa Environment: Nginx 1.18 + PHP 7.3 + MySQL 5.6 + MongoDB 4.0

Install PHP extensions: fileinfo, Swoole4, mongodb (three extensions)

Remove all disabled functions in PHP

BaoTa firewall: Open ports 1-65535

Add a website, upload files from the IM folder to the website root directory, set permissions to 777

Modify the website, set URL rewrite to thinkphp, website directory select /web/public

Move index.html to the top of default documents

Add a database and import data 3eym.com.sql.gz

The MongoDB database needs to be uploaded via SSH commands

First upload mongod.zip to a folder on the server, after uploading, extract the file, delete the zip file, then execute the following command via SSH:

mongorestore -d im path (this path is the folder you extracted)

Modify the database configuration information in webconfigdatabase.php

Modify the database configuration information in socketappimcommoncontrollerMain.php

Modify the IP on line 48 in webappimcommoncontrollerActionBegin1.php

Next is compiling the frontend files, the frontend files are in view-h5

First download HBuilderX tool, search and download via Baidu, for how to use it, check the tool’s instructions. If it prompts you to install plugins, you need to install the plugins first, install them directly under the Tools – Plugin Installation menu.

Open the view-h5 folder with the tool

Modify the domain name and IP on lines 11, 13, 15 in view-h5App.vue

Modify the domain name on line 21 in view-h5pagespushgame1.vue

Modify the domain name on line 21 in view-h5pagespushgame2.vue

Open the manifest.json file with the tool, the AppID in basic configuration needs to be re-obtained

After these configurations are done, click Website H5 Mobile Version under the Publish menu to compile. Open the compiled folder directory, cover the static folder and index.html to the webpublic directory

Finally, run the startup command in the server terminal:

cd /www/wwwroot/site directory/socket

php start.php start -d

Frontend access address: http://your domain name/