- 浏览: 717025 次
- 性别:
- 来自: 北京
最新评论
-
wxweven:
Surmounting 写道既然 Java 的跳表那么少,我决 ...
SkipList 跳表 -
暮雪云然:
写的不错,很透彻
Java静态内部类 -
bzhao:
好,赞扬!
Linux信号详解 -
jacktao219:
赞一个~! ,现在正在看redis 所以接触到跳表
SkipList 跳表 -
is_leon:
vote--后还要判断是否为0吧,如果为0则废掉重新置位can ...
现在有一个整数数组,已知一个数出现的次数超过了一半,请用O(n)的复杂度的算法找出这个数
最近做一个收集客户端数据的项目, 后台使用nginx, 通过实现nginx的模块来处理业务. nginx的模块编写不难,
但写完后对nginx的内部机制还是云里雾里, 趁周末好好阅读一下nginx的源代码. 下面记录一些阅读过程中遇
到的数据结构. 关于nginx的内部实现, 等看懂了源码再写.
模块四要素:
1 模块实例, 2 模块上下文, 3 模块指令, 4 指令参数
模块定义
===================================================
struct ngx_module_s {
ngx_uint_t ctx_index;
ngx_uint_t index;
ngx_uint_t spare0;
ngx_uint_t spare1;
ngx_uint_t spare2;
ngx_uint_t spare3;
ngx_uint_t version;
void *ctx;
ngx_command_t *commands;
ngx_uint_t type;
ngx_int_t (*init_master)(ngx_log_t *log);
ngx_int_t (*init_module)(ngx_cycle_t *cycle);
ngx_int_t (*init_process)(ngx_cycle_t *cycle);
ngx_int_t (*init_thread)(ngx_cycle_t *cycle);
void (*exit_thread)(ngx_cycle_t *cycle);
void (*exit_process)(ngx_cycle_t *cycle);
void (*exit_master)(ngx_cycle_t *cycle);
uintptr_t spare_hook0;
uintptr_t spare_hook1;
uintptr_t spare_hook2;
uintptr_t spare_hook3;
uintptr_t spare_hook4;
uintptr_t spare_hook5;
uintptr_t spare_hook6;
uintptr_t spare_hook7;
}; (core/ngx_conf_file.h)
模块实例定义
===================================================
1 核心模块
ngx_module_t ngx_core_module = {
NGX_MODULE_V1,
&ngx_core_module_ctx, /* module context */
ngx_core_commands, /* module directives */
NGX_CORE_MODULE, /* module type */
NULL, /* init master */
NULL, /* init module */
NULL, /* init process */
NULL, /* init thread */
NULL, /* exit thread */
NULL, /* exit process */
NULL, /* exit master */
NGX_MODULE_V1_PADDING
}; (core/nginx.c)
2 http模块
ngx_module_t ngx_http_module = {
NGX_MODULE_V1,
&ngx_http_module_ctx, /* module context */
ngx_http_commands, /* module directives */
NGX_CORE_MODULE, /* module type */
NULL, /* init master */
NULL, /* init module */
NULL, /* init process */
NULL, /* init thread */
NULL, /* exit thread */
NULL, /* exit process */
NULL, /* exit master */
NGX_MODULE_V1_PADDING
};
3 http核心模块
ngx_module_t ngx_http_core_module = {
NGX_MODULE_V1,
&ngx_http_core_module_ctx, /* module context */
ngx_http_core_commands, /* module directives */
NGX_HTTP_MODULE, /* module type */
NULL, /* init master */
NULL, /* init module */
NULL, /* init process */
NULL, /* init thread */
NULL, /* exit thread */
NULL, /* exit process */
NULL, /* exit master */
NGX_MODULE_V1_PADDING
}; (http/ngx_http_core_module.c)
4 日志模块
ngx_module_t ngx_errlog_module = {
NGX_MODULE_V1,
&ngx_errlog_module_ctx, /* module context */
ngx_errlog_commands, /* module directives */
NGX_CORE_MODULE, /* module type */
NULL, /* init master */
NULL, /* init module */
NULL, /* init process */
NULL, /* init thread */
NULL, /* exit thread */
NULL, /* exit process */
NULL, /* exit master */
NGX_MODULE_V1_PADDING
};
5 事件模块
ngx_module_t ngx_event_core_module = {
NGX_MODULE_V1,
&ngx_event_core_module_ctx, /* module context */
ngx_event_core_commands, /* module directives */
NGX_EVENT_MODULE, /* module type */
NULL, /* init master */
ngx_event_module_init, /* init module */
ngx_event_process_init, /* init process */
NULL, /* init thread */
NULL, /* exit thread */
NULL, /* exit process */
NULL, /* exit master */
NGX_MODULE_V1_PADDING
};
模块上下文定义
===================================================
1 核心模块上下文定义
typedef struct {
ngx_str_t name;
void *(*create_conf)(ngx_cycle_t *cycle);
char *(*init_conf)(ngx_cycle_t *cycle, void *conf);
} ngx_core_module_t; (见src/core/ngx_conf_file.h)
2 事件模块上下文定义
typedef struct {
ngx_str_t *name;
void *(*create_conf)(ngx_cycle_t *cycle);
char *(*init_conf)(ngx_cycle_t *cycle, void *conf);
ngx_event_actions_t actions;
} ngx_event_module_t;(见src/event/ngx_event.h)
3 http模块上下文定义
typedef struct {
ngx_int_t (*preconfiguration)(ngx_conf_t *cf);
ngx_int_t (*postconfiguration)(ngx_conf_t *cf);
void *(*create_main_conf)(ngx_conf_t *cf);
char *(*init_main_conf)(ngx_conf_t *cf, void *conf);
void *(*create_srv_conf)(ngx_conf_t *cf);
char *(*merge_srv_conf)(ngx_conf_t *cf, void *prev, void *conf);
void *(*create_loc_conf)(ngx_conf_t *cf);
char *(*merge_loc_conf)(ngx_conf_t *cf, void *prev, void *conf);
} ngx_http_module_t; (见src/http/ngx_http_config.h)
4 事件模块上下文定义
ngx_event_module_t ngx_event_core_module_ctx = {
&event_core_name,
ngx_event_create_conf, /* create configuration */
ngx_event_init_conf, /* init configuration */
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
};
模块上下文实例
===============================================================
1 核心模块上下文
static ngx_core_module_t ngx_core_module_ctx = {
ngx_string("core"),
ngx_core_module_create_conf,
ngx_core_module_init_conf
}; (core/nginx.c)
2 http核心模块上下文
static ngx_http_module_t ngx_http_core_module_ctx = {
ngx_http_core_preconfiguration, /* preconfiguration */
NULL, /* postconfiguration */
ngx_http_core_create_main_conf, /* create main configuration */
ngx_http_core_init_main_conf, /* init main configuration */
ngx_http_core_create_srv_conf, /* create server configuration */
ngx_http_core_merge_srv_conf, /* merge server configuration */
ngx_http_core_create_loc_conf, /* create location configuration */
ngx_http_core_merge_loc_conf /* merge location configuration */
}; (http/ngx_http_core_module.c)
存储指令参数的结构体
===============================================================
根指令的参数
typedef struct {
ngx_flag_t daemon;
ngx_flag_t master;
ngx_msec_t timer_resolution;
ngx_int_t worker_processes;
ngx_int_t debug_points;
ngx_int_t rlimit_nofile;
ngx_int_t rlimit_sigpending;
off_t rlimit_core;
int priority;
ngx_uint_t cpu_affinity_n;
u_long *cpu_affinity;
char *username;
ngx_uid_t user;
ngx_gid_t group;
ngx_str_t working_directory;
ngx_str_t lock_file;
ngx_str_t pid;
ngx_str_t oldpid;
ngx_array_t env;
char **environment;
} ngx_core_conf_t;
http指令的参数
typedef struct {
/* 保存所有server的配置信息 */
ngx_array_t servers; /* ngx_http_core_srv_conf_t */
ngx_http_phase_engine_t phase_engine;
ngx_hash_t headers_in_hash;
ngx_hash_t variables_hash;
ngx_array_t variables; /* ngx_http_variable_t */
ngx_uint_t ncaptures;
ngx_uint_t server_names_hash_max_size;
ngx_uint_t server_names_hash_bucket_size;
ngx_uint_t variables_hash_max_size;
ngx_uint_t variables_hash_bucket_size;
ngx_hash_keys_arrays_t *variables_keys;
ngx_array_t *ports;
ngx_uint_t try_files; /* unsigned try_files:1 */
ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1];
} ngx_http_core_main_conf_t;
server指令的参数
typedef struct {
/* array of the ngx_http_server_name_t, "server_name" directive */
ngx_array_t server_names;
/* server ctx,初始化http请求ngx_http_init_request时用得到 */
ngx_http_conf_ctx_t *ctx;
ngx_str_t server_name;
size_t connection_pool_size;
size_t request_pool_size;
size_t client_header_buffer_size;
ngx_bufs_t large_client_header_buffers;
ngx_msec_t client_header_timeout;
ngx_flag_t ignore_invalid_headers;
ngx_flag_t merge_slashes;
ngx_flag_t underscores_in_headers;
unsigned listen:1;
ngx_http_core_loc_conf_t **named_locations;
} ngx_http_core_srv_conf_t;
location指令的参数
struct ngx_http_core_loc_conf_s {
ngx_str_t name; /* location name */
unsigned noname:1; /* "if () {}" block or limit_except */
unsigned lmt_excpt:1;
unsigned named:1;
unsigned exact_match:1;
unsigned noregex:1;
unsigned auto_redirect:1;
/* pointer to the modules' loc_conf */
void **loc_conf;
uint32_t limit_except;
void **limit_except_loc_conf;
ngx_http_handler_pt handler;
/* location name length for inclusive location with inherited alias */
size_t alias;
ngx_str_t root; /* root, alias */
ngx_str_t post_action;
ngx_array_t *root_lengths;
ngx_array_t *root_values;
ngx_array_t *types;
ngx_hash_t types_hash;
ngx_str_t default_type;
off_t client_max_body_size; /* client_max_body_size */
off_t directio; /* directio */
off_t directio_alignment; /* directio_alignment */
size_t client_body_buffer_size; /* client_body_buffer_size */
size_t send_lowat; /* send_lowat */
size_t postpone_output; /* postpone_output */
size_t limit_rate; /* limit_rate */
size_t limit_rate_after; /* limit_rate_after */
size_t sendfile_max_chunk; /* sendfile_max_chunk */
size_t read_ahead; /* read_ahead */
ngx_msec_t client_body_timeout; /* client_body_timeout */
ngx_msec_t send_timeout; /* send_timeout */
ngx_msec_t keepalive_timeout; /* keepalive_timeout */
ngx_msec_t lingering_time; /* lingering_time */
ngx_msec_t lingering_timeout; /* lingering_timeout */
ngx_msec_t resolver_timeout; /* resolver_timeout */
ngx_resolver_t *resolver; /* resolver */
time_t keepalive_header; /* keepalive_timeout */
};
指令定义
===========================================================
struct ngx_command_s {
ngx_str_t name;
ngx_uint_t type;初始化http请求: ngx_http_init_request
char *(*set)(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
ngx_uint_t conf;
ngx_uint_t offset;
void *post;
};
cycle定义
===========================================================
struct ngx_cycle_s {
void ****conf_ctx;
ngx_pool_t *pool;
ngx_log_t *log;
ngx_log_t new_log;
ngx_connection_t **files;
ngx_connection_t *free_connections;
ngx_uint_t free_connection_n;
ngx_queue_t reusable_connections_queue;
ngx_array_t listening;
ngx_array_t pathes;
ngx_list_t open_files;
ngx_list_t shared_memory;
ngx_uint_t connection_n;
ngx_uint_t files_n;
ngx_connection_t *connections;
ngx_event_t *read_events;
ngx_event_t *write_events;
ngx_cycle_t *old_cycle;
ngx_str_t conf_file;
ngx_str_t conf_param;
ngx_str_t conf_prefix;
ngx_str_t prefix;
ngx_str_t lock_file;
ngx_str_t hostname;
};
http三大配置
===========================================================
typedef struct {
void **main_conf;
void **srv_conf;
void **loc_conf;
} ngx_http_conf_ctx_t;
解析配置文件的时候, 用结构体ngx_conf_s来暂时存放指令的参数
===========================================================
struct ngx_conf_s {
char *name;
ngx_array_t *args;
ngx_cycle_t *cycle;
ngx_pool_t *pool;
ngx_pool_t *temp_pool;
ngx_conf_file_t *conf_file;
ngx_log_t *log;
void *ctx;
ngx_uint_t module_type;
ngx_uint_t cmd_type;
ngx_conf_handler_pt handler;
char *handler_conf;
};
在ngx_init_cycle中声明一个这样的变量
ngx_conf_t conf;
然后开始解析配置文件, 这个结构体可以反复使用, 每次遇到一个指令, 就会改变conf的内容
阅读痕迹
=====================================================================
* ngx_init_cycle:
* ngx_conf_t.ctx = cycle->conf_ctx;
解析配置文件
* 从ngx_init_cycle调用ngx_conf_param开始解析配置文件
* ngx_conf_param再调用ngx_conf_parse解析配置文件
* ngx_conf_parse:
* 打开配置文件
* for循环:
* 读取文件, ngx_conf_read_token, 把指令名和参数存到ngx_conf_t结构体,
每次都一条指令便返回
* 调用ngx_conf_handler来处理这条指令:
* 寻找指令所在的模块
* 检验指令在配置文件中的位置是否正确
* 检验指令的参数个数是否合法
* 取得指令参数要存储的地方(比如ngx_core_conf_t,用conf指针指向),这个结构体由
模块的create_conf来创建, 然后把它安插在 ngx_conf_t.ctx 中
* 调用指令的 set 函数, 把ngx_conf_t中的参数值转存到conf指向的结构体
解析http block
如果ngx_conf_read_token返回"http {", 则调用ngx_http_block解析http block下面的配置
* ngx_http_block:
* 创建ngx_http_conf_ctx_t结构体, 这时conf指针不再指向ngx_core_conf_t,
而是指向ngx_http_conf_ctx_t
* 数一下有多少个http模块, 并设置每个模块的index
* 调用所有http模块的create_main_conf钩子,把返回的结构体安插在ngx_http_conf_ctx_t.main_conf表中
调用所有http模块的create_srv_conf钩子,把返回的结构体安插在ngx_http_conf_ctx_t.srv_conf表中
调用所有http模块的create_loc_conf钩子,把返回的结构体安插在ngx_http_conf_ctx_t.loc_conf表中
* ngx_conf_t.ctx不再指向cycle->conf_ctx, 而是指向ngx_http_conf_ctx_t
* 调用所有http模块的preconfiguration钩子
* 再次调用ngx_conf_parse来解析http block里面的指令, 至此http block,
server block, location block都解析完毕
* 调用所有http模块的init_main_conf钩子
* 待续...
解析server block
解析htto block的时候, 如果遇到"server {", 则调用
server command的set方法:ngx_http_core_server, 开始解析server block
ngx_http_core_server:
* 再创建一个ngx_http_conf_ctx_t结构体, 这时ngx_conf_t.ctx不再指向
http block的ngx_http_conf_ctx_t, 而是指向这个新的ngx_http_conf_ctx_t
ctx = new ngx_http_conf_ctx_t
http_ctx = cf->ctx
cf->ctx = ctx
* server ctx的main_conf从http ctx继承过来
ctx->main_conf = http_ctx->main_conf;
* 调用所有http模块的create_srv_conf钩子,把返回的结构体安插在ctx.srv_conf表中
调用所有http模块的create_loc_conf钩子,把返回的结构体安插在ctx.loc_conf表中
http block下面三大conf的偏移量
-----------------------------------------------------------
#define NGX_HTTP_MAIN_CONF_OFFSET offsetof(ngx_http_conf_ctx_t, main_conf)
#define NGX_HTTP_SRV_CONF_OFFSET offsetof(ngx_http_conf_ctx_t, srv_conf)
#define NGX_HTTP_LOC_CONF_OFFSET offsetof(ngx_http_conf_ctx_t, loc_conf)
根据ngx_http_request_t得到三大conf
-----------------------------------------------------------
#define ngx_http_get_module_main_conf(r, module) \
(r)->main_conf[module.ctx_index]
#define ngx_http_get_module_srv_conf(r, module) (r)->srv_conf[module.ctx_index]
#define ngx_http_get_module_loc_conf(r, module) (r)->loc_conf[module.ctx_index]
根据ngx_conf_t得到三大conf
-----------------------------------------------------------
#define ngx_http_conf_get_module_main_conf(cf, module) \
((ngx_http_conf_ctx_t *) cf->ctx)->main_conf[module.ctx_index]
#define ngx_http_conf_get_module_srv_conf(cf, module) \
((ngx_http_conf_ctx_t *) cf->ctx)->srv_conf[module.ctx_index]
#define ngx_http_conf_get_module_loc_conf(cf, module) \
((ngx_http_conf_ctx_t *) cf->ctx)->loc_conf[module.ctx_index]
根据cycyle的conf_ctx得到main conf
-----------------------------------------------------------
#define ngx_http_cycle_get_module_main_conf(cycle, module) \
(cycle->conf_ctx[ngx_http_module.index] ? \
((ngx_http_conf_ctx_t *) cycle->conf_ctx[ngx_http_module.index]) \
->main_conf[module.ctx_index]: \
NULL)
==================== ngx_http_log_module实例 ==================
ngx_http_log_create_main_conf返回的结构体
-----------------------------------------------------------
typedef struct {
ngx_array_t formats; /* array of ngx_http_log_fmt_t */
ngx_uint_t combined_used; /* unsigned combined_used:1 */
} ngx_http_log_main_conf_t;
ngx_http_log_create_loc_conf返回的结构体
-----------------------------------------------------------
typedef struct {
ngx_array_t *logs; /* array of ngx_http_log_t */
ngx_open_file_cache_t *open_file_cache;
time_t open_file_cache_valid;
ngx_uint_t open_file_cache_min_uses;
ngx_uint_t off; /* unsigned off:1 */
} ngx_http_log_loc_conf_t;
指令
-----------------------------------------------------------
static ngx_command_t ngx_http_log_commands[] = {
{ ngx_string("log_format"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_2MORE,
ngx_http_log_set_format,
NGX_HTTP_MAIN_CONF_OFFSET,
0,
NULL },
{ ngx_string("access_log"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
|NGX_HTTP_LMT_CONF|NGX_CONF_TAKE123,
ngx_http_log_set_log,
NGX_HTTP_LOC_CONF_OFFSET,
0, /* 如果使用自定义的set方法, 而且无须知道参数在结构体中的offset,那么offset就可以设为0 */
NULL },
{ ngx_string("open_log_file_cache"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
ngx_http_log_open_file_cache,
NGX_HTTP_LOC_CONF_OFFSET,
0,
NULL },
ngx_null_command
};
上下文
-----------------------------------------------------------
static ngx_http_module_t ngx_http_log_module_ctx = {
NULL, /* preconfiguration */
ngx_http_log_init, /* postconfiguration */
ngx_http_log_create_main_conf, /* create main configuration */
NULL, /* init main configuration */
NULL, /* create server configuration */
NULL, /* merge server configuration */
ngx_http_log_create_loc_conf, /* create location configration */
ngx_http_log_merge_loc_conf /* merge location configration */
};
模块实例
-----------------------------------------------------------
ngx_module_t ngx_http_log_module = {
NGX_MODULE_V1,
&ngx_http_log_module_ctx, /* module context */
ngx_http_log_commands, /* module directives */
NGX_HTTP_MODULE, /* module type */
NULL, /* init master */
NULL, /* init module */
NULL, /* init process */
NULL, /* init thread */
NULL, /* exit thread */
NULL, /* exit process */
NULL, /* exit master */
NGX_MODULE_V1_PADDING
};
==================== end of ngx_http_log_module实例 ==================
注意ngx_request_s保存有http block里面的三大conf
--------------------------------------------------------------------
struct ngx_http_request_s {
uint32_t signature; /* "HTTP" */
ngx_connection_t *connection;
void **ctx;
void **main_conf;
void **srv_conf;
void **loc_conf;
}
总共创建多少个ngx_http_conf_ctx_t结构体
----------------------------------------------------
http block下创建ngx_http_conf_ctx_t
在server block下创建ngx_http_conf_ctx_t
在location block下创建ngx_http_conf_ctx_t
在location block下创建ngx_http_conf_ctx_t
在location block下创建ngx_http_conf_ctx_t
结论: http block只创建一个, 每个server都会创建一个结构体, 每个location都会创建一个结构体
疑问:server block创建的ngx_http_conf_ctx_t会保存在ngx_http_core_srv_conf_t中
那么location block创建的ngx_http_conf_ctx_t保存在哪里呢?
调用 ngx_conf_parse 的时候会先保存ngx_conf_t
------------------------------------------------
ngx_conf_t save;
save = *cf;
cf->ctx = ctx;
cf->cmd_type = NGX_HTTP_LOC_CONF;
rv = ngx_conf_parse(cf, NULL);
*cf = save;
初始化http请求: ngx_http_init_request
-----------------------------------------------
ngx_http_core_srv_conf_t *cscf = addr_conf->default_server;
r->main_conf = cscf->ctx->main_conf;
r->srv_conf = cscf->ctx->srv_conf;
r->loc_conf = cscf->ctx->loc_conf;
自动收割子进程
-----------------------------------------------
在master process中, 函数 ngx_signal_handler 用来处理信号, 若
接收到 SIGCHLD 信号, 表示有一个子进程退出了, 然后把变量 ngx_reap 置为 1
然后在 ngx_master_process_cycle 函数中, 若检查到 ngx_reap 等于 1,则创建
一个子进程:
if (ngx_reap) { ngx_reap = 0; ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "reap children"); live = ngx_reap_children(cycle); }
发表评论
-
Memcached源码分析之网络模型篇
2012-03-02 01:46 4091memcached 采用多线程的工作方式, 主线程接收连接, ... -
Memcached源码分析之内存管理篇
2012-02-26 15:04 11988使用命令 set(key, value) ... -
多线程与volatile变量
2012-02-25 17:07 5358volatile 修饰的变量表示改变量的值是易变的,编译 ... -
memcopy 和 memmove 的实现
2012-02-18 14:25 3202一 memcopy 的实现 memcopy 不考虑源内 ... -
strlcpy实现
2011-09-13 22:41 2384#include <stdio.h> /* ... -
C语言类型转换的原则
2008-10-30 09:48 1982c语言类型转换的根本原则是必须保证数据不能丢失!在这个 ... -
fgets函数的理解
2008-11-12 19:45 3882fget函数的原型如下:char *fgets (char ...
相关推荐
Nginx 源码分析笔记 自己的源码分析笔记,未完。
Nginx的nginx学习笔记配合原始币可食用
其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名。2011年6月1日,nginx 1.0.4发布。 Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)...
Nginx是一个开源的,支持高性能、高并发的www服务和代理服务软件,由俄罗斯人IgorSyoer开发的,最初被应用在俄罗斯的大型网站www.rambler.ru上,后来作者将源代码以类BSD许可的形式开源出来供全球使用
Nginx (engine x) 是一个高性能的HTTP和反向代理服务器,也是一个IMAP/...其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名。2011年6月1日,nginx 1.0.4发布。
LNMP源码安装详细笔记(Linux+Nginx+Mysql+php).rar
LNMP源码安装详细笔记(Linux+Nginx+Mysql+php).pdf
·企业级笔试面试题目深入源码级讲解,拒绝死记硬背 4.代码量更大、案例更丰富、更贴近实战: ·Java语言基础阶段:12720行代码,Java语言高级阶段:11684行代码 ·课堂实战项目3套,课后实战项目2套 ·近百道企业...
简介: 网购商城系统源码 积分兑换商城系统源码 独立后台附教程 测试环境:Nginx+PHP7.0+MySQL5.6+thinkphp伪静态
配置rewrite、gzip、ssl、状态监控、缓存清理,编译及安装到指定位置:/alidata/server/nginx-1.10.1 解压可以直接使用
✦fastdfs-nginx-module-1.22.tar.gz ✦libfastcommon-1.0.43.zip ✦nginx-1.16.1.tar.gz ✦rabbitmq-server-3.9.13-1.el7.noarch.rpm ✦redis-6.2.6.tar.gz ✦rabbitmq-server-3.9.13-1.el7.noarch.rpm
现在git很流行,大家也都开始使用它来管理网站源码,但是.git数据目录在网站的源码根目录也会有一份,nginx通常配置的时候不会对隐藏目录进行特别处理,这样你的源文件就暴露在大庭广众之下了。为了安全,我们需要在...
采用当下最主流的微服务分布式架构,前后端分离技术,涵盖技术栈有:Vue、axios、Springboot、RESTful、mybatis、tkmapper、Swagger、任务调度Quartz/Elastic-Job、阿里云OSS、Linux、Nginx负载均衡、反向代理、CDN...
学习笔记及代码 1. 笔记 类型 笔记 Java Java基础笔记Java多线程笔记JUC笔记Java集合笔记JavaIO笔记 Docker Docker安装Docker安装常用软件Docker常见问题 Maven Maven常用命令 Nginx Nginx常用配置 日常笔记 项目...
韩顺平java笔记和源码 关于本笔记 这份笔记是笔者自学Golang时的资料总结,结合了很多书籍、博主以及开源作品的内容。 笔者也收到了大量的反馈和建议,笔记仍然会在我的学习旅程中不断更新,绝对不鸽。 很多章节仍然...
Spring+SpringMVC+MyBatis,用到了maven,...这个是淘宝上买的java项目总大小10.22G(包含视频、源码、笔记、sql脚本),这里上传了源码(不到200M),同时附上视频及其他文件云盘链接,亲测可用,受益匪浅,欢迎下载!
克隆源代码克隆源代码到本地: > git clone https://github.com/Ucer/codehaoshi.git2.配置本地的环境修改.env APP_NAME=Code好事 //网站名称APP_ENV=production //生产环境APP_DEBUG=falseAPP_LOG_LEVEL=
Spring+SpringMVC+MyBatis,用到了maven,redis,solr,nginx等技术;这个是淘宝上买的java项目总大小10.22G(包含视频、源码、笔记、sql脚本),附上视频及其他文件云盘链接,亲测可用,受益匪浅,欢迎下载!
LightPath CDN Nginx模块版本:1.0.0-beta描述CDN,内容交付网络,使用Openresty(Nginx)用Lua编写。... 如果您无法修改源代码以绕过这些要求,请提出一个问题,我们将尽力与您合作。特征边缘缓存字节范围缓存
源码 目录 c socket css golang base beego bolt confd etcd geecache gin gmq grpc influxdb nsq study supervisord java spring javascript linux mongodb mysql canal kindshard数据库中间件 mycat数据库中间件 ...