|
|
3 years ago | |
|---|---|---|
| app | 3 years ago | |
| config | 3 years ago | |
| extend | 4 years ago | |
| public | 3 years ago | |
| route | 4 years ago | |
| runtime | 3 years ago | |
| vendor | 3 years ago | |
| view | 4 years ago | |
| .example.env | 3 years ago | |
| .gitattributes | 4 years ago | |
| .gitignore | 4 years ago | |
| .travis.yml | 4 years ago | |
| LICENSE.txt | 4 years ago | |
| README.md | 4 years ago | |
| addDrawCount.sql | 3 years ago | |
| build.cmd | 4 years ago | |
| clear.sql | 3 years ago | |
| composer.json | 3 years ago | |
| composer.lock | 3 years ago | |
| endActivity.sql | 3 years ago | |
| initGameCount.sql | 3 years ago | |
| license | 4 years ago | |
| sql.sql | 3 years ago | |
| startActivity.sql | 3 years ago | |
| think | 4 years ago | |
| update.sql | 3 years ago | |
| updateGameCount.sql | 3 years ago | |
| updateRank.sql | 3 years ago | |
| updateUserRank.sql | 3 years ago |
composer模块vendor目录,下载后需要自行composer install安装;6、配置 nginx , https 相关配置请自行参考 nginx 相关教程,或者在 LVS 负载均衡层配置 vhost 参考配置:
log_format logid '[$time_local] "$host" "$http_x_real_ip" "$http_x_forwarded_for" "$remote_addr" "$remote_user" "$request" "$request_time" "$request_length" "$body_bytes_sent" "$status" '
'"$server_addr" "$upstream_addr" "$upstream_response_time" "$upstream_status" "$http_referer" "$http_user_agent" "logId=$temp_request_id"';
server {
server_name www.weibo.cn;
listen 80;
root /var/www/html/public;
index index.php index.html index.htm;
set $temp_request_id $http_x_request_id;
if ($temp_request_id = "") {
set $temp_request_id $request_id;
}
access_log /var/log/access.log logid;
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ ^/(composer.json|composer.lock|ThinkPHP/|vendor/|src/|bin/|App/|.git) {
deny all;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param HTTP_X_REQUEST_ID $temp_request_id;
}
}
fastcgi_params 配置参考:
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
fastcgi_split_path_info ^(.+\.php)(/.+)$; #增加这一句
fastcgi_param PATH_INFO $fastcgi_path_info; #增加这一句
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
7、配置 fpm 配置参考:
[www]
user = www-data
group = www-data
; listen = /var/run/php7-fpm.sock
listen = 127.0.0.1:9000
listen.owner = www-data
listen.group = www-data
pm = static
pm.max_children = 32
pm.start_servers = 32
pm.min_spare_servers = 32
pm.max_spare_servers = 32
pm.max_requests = 20000
request_terminate_timeout = 10
rlimit_files=1048576
pm.status_path = /status
;FPM状态页面的网址. 如果没有设置, 则无法访问状态页面. 默认值: none. munin监控会使用到
ping.path = /ping
;FPM监控页面的ping网址. 如果没有设置, 则无法访问ping页面. 该页面用于外部检测FPM是否存活并且可以响应请求. 请注意必须以斜线开头 (/)。
ping.response = pong
;#用于定义ping请求的返回相应. 返回为 HTTP 200 的 text/plain 格式文本. 默认值: pong.
chroot =
;#启动时的Chroot目录. 所定义的目录需要是绝对路径. 如果没有设置, 则chroot不被使用.
chdir =
;#设置启动目录,启动时会自动Chdir到该目录. 所定义的目录需要是绝对路径. 默认值: 当前目录,或者/目录(chroot时)
catch_workers_output = yes
;#重定向运行过程中的stdout和stderr到主要的错误日志文件中. 如果没有设置, stdout 和 stderr 将会根据FastCGI的规则被重定向到 /dev/null . 默认值: 空
php_admin_value[memory_limit] = 64M
env[ENV] = prod
8、导入根目录下的 sql.sql 文件
注解权限是指通过方法注释来实现后台 RBAC 授权管理,用注解来管理功能节点。
开发人员只需要写好注释,RBAC 的节点会自动生成,只需要配置角色及用户就可以使用 RBAC 权限。
@auth true表示访问需要权限验证@menu true显示在菜单编辑的节点可选项其中@login true需要强制登录才可访问
/**
* 操作的名称
* @auth true # 表示需要验证权限
* @menu true # 在菜单编辑的节点可选项
* @login true # 需要强制登录可访问
*/
public function index(){
// @todo
}
build.cmd 可更新 composer 插件,会删除并替换 vendor 目录php think run 启用本地开发环境,访问 http://127.0.0.1:8000php think xadmin:fansall 同步微信粉丝数据(依赖于 wechat 模块)php think xadmin:version 查看当前版本号,显示 ThinkPHP 版本及 ThinkLibrary 版本php think xadmin:install admin 从线上服务更新 admin 模块的所有文件(注意文件安全)php think xadmin:install wechat 从线上服务更新 wechat 模块的所有文件(注意文件安全)php think xadmin:install static 从线上服务更新 static 静态资料文件(注意文件安全)php think xadmin:install config 从线上服务更新 config 常用配置文件(注意文件安全)php think xadmin:queue listen [监听]启动异步任务监听服务php think xadmin:queue start [控制]检查创建任务监听服务(建议定时任务执行)php think xadmin:queue query [控制]查询当前任务相关的进程php think xadmin:queue status [控制]查看异步任务监听状态php think xadmin:queue stop [控制]平滑停止所有任务进程php think xadmin:queue webstop [调试]停止本地调试服务php think xadmin:queue webstart [调试]开启本地调试服务(建议定时任务执行)php think xadmin:queue webstatus [调试]查看本地调试状态