nginx init
2015-09-25 17:07:55 0 举报
nginx init 是一个用于初始化 Nginx 服务器的命令。Nginx 是一个高性能的 Web 服务器,可以处理大量的并发请求。通过运行 nginx init 命令,您可以在计算机上安装和配置 Nginx,以便开始使用它来托管网站或应用程序。这个命令会根据您的操作系统和环境变量自动选择合适的配置文件,并完成 Nginx 的安装过程。在安装完成后,您可以通过修改配置文件来自定义 Nginx 的行为,以满足您的特定需求。总之,nginx init 是一个方便且强大的工具,可以帮助您轻松地启动和管理 Nginx 服务器。
作者其他创作
大纲/内容
# src/http/ngx_http_core_module.cngx_http_handler(ngx_http_request_t *r){ ... ngx_http_core_run_phases(r); ...}
ngx_connection_svoid *datangx_event_t *readngx_event_t *writengx_listening_t *listening
cycle = ngx_init_cycle(&init_cyle)
# event/ngx_event.cngx_int_t ngx_event_process_init(cycle){ ngx_event_timer_init() find module that config file using. module-actions.init(cycle) /* for each listening socket */ rev-handler = ngx_event_accept
if failed: rollback
os/unix/ngx_process_cycle.c void ngx_worker_process_init(){ for (i = 0; ngx_modules[i]; i++) ngx_modules[i]-init_process(cycle) ngx_add_channel_event()}
os/unix/ngx_process_cycle.c void ngx_worker_process_cycle(){ ngx_worker_process_init() ngx_setproctitle()
os/unix/ngx_process_cycle.cvoid ngx_master_process_cycle(){ ngx_setproctitle() ngx_start_worker_processes() ngx_start_garbage_collector() waiting for and process signals}
# http/ngx_http_request.cngx_http_process_request(ngx_http_request_t *r){ ... ngx_http_handler(r); ..}
ngx_daemon()ngx_create_pidfile()if master ngx_master_process_cycle();else ngx_single_process_cycle();
ngx_process_events(cycle) /* ngx_event_actions.process_events() */}
# http/ngx_http_request.cngx_http_init_request(){ rev-handler = ngx_http_process_request_line; r-read_event_handler = ngx_http_block_reading}
os/unix/ngx_process_cycle.cvoid ngx_start_worker_processes(){ ngx_spawn_process() /*ngx_worker_process_cycle*/ ngx_write_channel()}
# http/ngx_http.cvoid ngx_http_block(){ ... ls = ngx_listening_inet_stream_socket()
# http/ngx_http_request.cngx_http_process_request_headers(ngx_event_t *rev){ ... ngx_http_process_request(); ...}
ls-handler = ngx_http_init_connection}
ngx_open_listening_sockets(cycle)
new connection come
ngx_listening_s
# main() - core/nginx.cngx_time_init()ngx_log_init()ngx_cycle = &init_cycleinit_cycle.pool = ngx_create_pool()count ngx_max_module;
0 条评论
下一页