即时通讯系统源码介绍
这是一个完整开源的即时通讯系统源码,该系统可以在Android、iOS和PC三个平台上运行。源码压缩包内有详细搭建教程。
这款即时通讯系统源码,服务器的配置要求4核CPU,4G内存,5M带宽(这是最低要求),如果配置太低,可能会引起卡顿,影响用户体验。
这款即时通讯系统源码是一个可以在Android、iOS和PC三个平台上运行的即时通讯独立系统源码。安装该通讯系统的步骤包括安装宝塔,替换Nginx配置文件,上传服务端并解压缩,以及配置IP和启动文件服务。
安装Nginx ,安装好Nginx 去配置文件 把以下 复制进去
user www www;
worker_processes auto;
error_log /www/wwwlogs/nginx_error.log crit;
pid /www/server/nginx/logs/nginx.pid;
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
multi_accept on;
}
http
{
include mime.types;
#include luawaf.conf;
include proxy.conf;
default_type aapplication/octet-stream;
server_names_hash_bucket_size 512;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.";
limit_conn_zone $binary_remote_addr zone=perip:10m;
limit_conn_zone $server_name zone=perserver:10m;
server_tokens off;
access_log off;
# 增加server
server{
listen 7002;
# 图片上传访问域名 upload.xx.xx
# server_name localhost;
# 拒接访问html 等类型的文件避免受到脚本攻击
location ~* /\.(html|htm|jsp|php|js)$ {
deny all;
}
location /{
root /data/www/resources;
expires 4d;
}
}
# 增加server
upstream apiweb{
server 127.0.0.1:8092;
}
# 此次是访问web路径
server{
listen 8099;
# api访问域名 api.xxx.xxx
server_name localhost;
#location /pages/ {
# alias /data/pages/;
#}
location / {
set $origin '*';
if ($http_origin) {
set $origin "$http_origin";
}
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' "$origin";
add_header 'Access-Control-Allow-Credentials' "true";
add_header 'Access-Control-Max-Age' 86400;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Connection,version-secret,access-control-allow-origin,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,access_token';
##注意,此处的token 取决于开发,有时候是user-token or doctor-token等。
add_header 'Content-Length' 0;
add_header 'Content-Type' 'text/plain, charset=utf-8';
return 204;
}
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding 'gzip';
proxy_pass http://127.0.0.1:8092;
}
}
include /www/server/panel/vhost/nginx/*.conf;
}
---------------------------------------------------------------------------
以下是启动服务命令
在opt目录下命令
cd mongodb-3.4.0
sh start.sh
cd redis-4.0.1
sh start.sh
cd spring-boot-imapi
sh start
cd upload
sh start.sh
cd tig-push
sh start
cd message-push
sh start.sh
cd tigase-server-7.1.3-b4482
sh start
cd rocketmq-all-4.3.2-bin-release
sh startBroker
sh startSrv