具体代码在https://gitee.com/owenzhang24/webman-owen
- php8.1
- redis6.0
- mysql8.0
- mangodb5.0
- env https://cloud.tencent.com/developer/article/2060142
- 内核优化 https://cloud.tencent.com/developer/article/2060138
- 多项目nginx配置 https://my.oschina.net/owenzhang24/blog/5585429
- 本地window开发运行php start.php start即可,无需配置nginx,composer install即可
- 安装数据库,根目录下的owenweb.sql
- 修改根目录下的.env1改为.env,修改数据库配置
- 运行 composer install
- 运行 php start.php start -d
- sudo chmod 755 runtime
- webman/admin 后台账号:admin,密码:123456,访问地址http://127.0.0.1:8241/app/admin/
- 自定义后台管理系统前后端分离,用app/admin来接后台接口,
- 集成的后台管理系统用webman/admin源代码位于 plugin/admin/app/controller是官方的后台集成好的
- 接口文档文件,下载apifox,导入根目录下的webman-owen.apifox.json
- 本地Windows开发,php环境下载phpstudy(https://old.xp.cn/download.html)
- 根目录php81 for phpstudy.zip解压复制到对应php目录(我的是D:\phpstudy_pro\Extensions\php) ,该php81版本已安装对应的redis等php扩展,解压后即可使用,
- app端时间随机数签名,后台jwt-token验证,接口限流
- 登录(苹果,微信,支付宝,QQ,手机短信,手机一键登录,微博),
- 支付(苹果,微信,支付宝),
- redis,redis-queue,
- topthink参数验证,
- 阿里云腾讯云OSS上传,
- mongodb,
- 定时任务crontab,
- wss,websocket+SSL,
- cache,
- aes加密,
- 监控系统TransferStatistics,
- 多应用nginx配置
- webman/admin 后台系统
- gatewayworker IM聊天 简易多人聊天表情包和图片文件(前后端)
- RabbitMQ 使用roiwk/rabbitmq 参考 https://github.com/roiwk/rabbitmq
- 后期添加-ElasticSearch
- ElasticSearch 参考:https://my.oschina.net/owenzhang24/blog/4981998
- https://my.oschina.net/owenzhang24/blog/5268463
- RabbitMQ 参考:https://my.oschina.net/owenzhang24/blog/5401729
- https://my.oschina.net/owenzhang24/blog/5051652
- webman/admin 后台账号:admin,密码:123456 源代码位于 plugin/admin是官方的后台集成好的,访问地址http://127.0.0.1: 8241/app/admin/,运行owenweb.sql,就可以用了,已经安装好了,如果要自己写的后台模块则删除 plugin/admin,用app/admin是前后端分离的后台接口,即可,官方webman/admin接口文档地址https://www.workerman.net/doc/webman-admin/
- gatewayworker 简易多人聊天表情包和图片文件,服务端:app/gatewayworker,前端v2:plugin/chatweb(效果图在该目录下的README.md) ,启用该功能config/plugin/webman/gateway-worker/process.php注释去除
- 在linux下运行php start.php start即可,app/gatewayworker代码已经同步到plugin/webman/gateway,和,config/plugin/webman/gateway-worker,运用webman/gatewayworker
- 在window下可以使用根目录下gatewayworker_start_for_win.bat来运行,然后代码写在app/gatewayworker,调试成功后,代码在同步到3
- 可以忽略4(删除gatewayworker_start_for_win.bat,和,app/gatewayworker),直接在3进行聊天gatewayworker操作
- workerman 链接:https://www.workerman.net/
- wolfcode 链接:https://gitee.com/wolf18
- hsk99 链接:https://github.com/hsk99
- qice IM通讯gatewayworker 链接:https://gitee.com/qice/QchatServer
- qice IM通讯VUE 链接:https://gitee.com/qice/qchat
- 有任何问题可以联系我邮箱,提交Issues不及时看,邮箱时刻在线
- E-mail:[email protected]
请使用 php start.php (restart | start | stop) 命令进行控制 守护模式 -d
php start.php stop #停止服务 测试环境用
php start.php start #启动服务 测试环境用
php start.php restart #重启服务 测试环境用
php start.php reload #重载代码
php start.php start -d #启动服务 守护模式 正式环境用
php start.php restart -d #重启服务 守护模式 正式环境用
觉得对你有帮助,就给我打赏吧,谢谢!
//外网访问项目地址:api.owenweb.com,转发到本地的端口127.0.0.1:8241
upstream webman {
server 127.0.0.1:8241;
keepalive 10240;
}
# HTTPS 配置
server
{
listen 443 ssl;
server_name test.owenweb.com;
access_log off;
root /home/www/owenweb;
# SSL 配置
ssl_certificate /etc/ssl/owenweb/fullchain.crt; # 包含服务器证书和中间证书
ssl_certificate_key /etc/ssl/owenweb/private.pem; # 私钥
# SSL 配置安全选项
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
add_header Strict-Transport-Security "max-age=31536000";
error_page 497 https://$host$request_uri;
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log /dev/null;
access_log /dev/null;
}
location ~ .*\.(js|css)?$
{
expires 12h;
error_log /dev/null;
access_log /dev/null;
}
location ^~ / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, PATCH, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Authorization-admin,token,AppVersion';
return 200;
}
if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, PATCH, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Authorization-admin,token,AppVersion';
}
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering on; # 启用缓冲提高性能
if (!-f $request_filename){
proxy_pass http://webman;
}
}
location /wss
{
proxy_pass http://127.0.0.1:2348;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
rewrite /wss/(.*) /$1 break;
proxy_redirect off;
}
}
//外网访问项目地址:110.14.109.123:8331,转发到本地的端口127.0.0.1:8241
server
{
listen 8331;
server_name 110.14.109.123:8331;
root /www/wwwroot/webman-owen;
access_log off;
location ^~ / {
proxy_pass http://127.0.0.1:8241;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
}
#或者
server
{
listen 80;
listen [::]:80;
server_name paytest.owenweb.com;
root /home/www/pay;
access_log off;
location ^~ / {
proxy_pass http://127.0.0.1:8241;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
}