在 Ubuntu 上使用源码安装 OpenResty

镜像下载、域名解析、时间同步请点击 阿里云开源镜像站
本文将介绍如何在 ubuntu 上使用源码安装 openresty。
  目标 ubuntu 18.04 openresty 1.19.3.2   安装依赖 启用 http 基本状态模块:--with-http_stub_status_module 启用 http gzip 静态文件压缩模块:--with-http_gzip_static_module 启用 http/2 模块:--with-http_v2_module  
zlib1g-dev: the http gzip module requires the zlib library.
apt-get update -yapt-get install -y libpcre3-dev \ libssl-dev \ perl \ make \ build-essential \ curl \ zlib1g-dev   下载 openrestycd /optcurl -lo https://openresty.org/download/openresty-1.19.3.2.tar.gztar zxf openresty-1.19.3.2.tar.gz   安装 openresty.configure \ --with-http_gzip_static_module \ --with-http_v2_module \ --with-http_stub_status_modulemakemake install   使用 systemd 管理 openresty 服务   编写 service 文件 在 /usr/lib/systemd/system 目录下创建一个 openresty.service 文件,文件内容如下:
# stop dance for openresty# =========================## execstop sends sigstop (graceful stop) to openresty's nginx process.# if, after 5s (--retry quit/5) nginx is still running, systemd takes control# and sends sigterm (fast shutdown) to the main process.# after another 5s (timeoutstopsec=5), and if nginx is alive, systemd sends# sigkill to all the remaining processes in the process group (killmode=mixed).## nginx signals reference doc:# http://nginx.org/en/docs/control.html#[unit]description=the openresty application platformafter=syslog.target network-online.target remote-fs.target nss-lookup.targetwants=network-online.target[service]type=forkingpidfile=/usr/local/openresty/nginx/logs/nginx.pidexecstartpre=/usr/local/openresty/nginx/sbin/nginx -t -q -g 'daemon on; master_process on;'execstart=/usr/local/openresty/nginx/sbin/nginx -g 'daemon on; master_process on;'execreload=/usr/local/openresty/nginx/sbin/nginx -g 'daemon on; master_process on;' -s reloadexecstop=-/sbin/start-stop-daemon --quiet --stop --retry quit/5 --pidfile /usr/local/openresty/nginx/logs/nginx.pidtimeoutstopsec=5killmode=mixed[install]wantedby=multi-user.target   启动 openresty# 设置自启动systemctl enable openresty# 启动 openrestysystemctl start openresty# 查看 openresty 服务状态systemctl status openresty● openresty.service - the openresty application platform loaded: loaded (/usr/lib/systemd/system/openresty.service; enabled; vendor preset: enabled) active: active (running) since sat 2021-07-10 11:36:07 cst; 26min ago process: 12735 execstart=/usr/local/openresty/nginx/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/success) process: 12734 execstartpre=/usr/local/openresty/nginx/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/success) main pid: 12736 (nginx) tasks: 2 (limit: 1126) cgroup: /system.slice/openresty.service ├─12736 nginx: master process /usr/local/openresty/nginx/sbin/nginx -g daemon on; master_process on; └─12737 nginx: worker processjul 10 11:36:07 izj6c0qglm7rjjctj7zxnfz systemd[1]: starting the openresty application platform...jul 10 11:36:07 izj6c0qglm7rjjctj7zxnfz systemd[1]: openresty.service: failed to parse pid from file /usr/local/openresty/nginx/logs/nginx.pid:jul 10 11:36:07 izj6c0qglm7rjjctj7zxnfz systemd[1]: started the openresty application platform. 一键安装脚本 github gist
本文转自:https://segmentfault.com/a/1190000040325948


三星Galaxy M10s手机规格曝光,配备6.4英寸AMOLED水滴屏
基于区块链的应用程序“DApp”介绍
我们真的还能相信自己的芯片产业链吗?
日本开发出用于振动发电新合金
特斯拉的FSD芯片HW3和HW4的区别
在 Ubuntu 上使用源码安装 OpenResty
固德威逆变器wifi设置_方法步骤教程_常见问题汇总
什么是Linux内核 Linux内核体系结构
传Linux系统用户名会触礁Steam反作弊机制
上海生物芯片推出信号通路分析系统
电动平衡车厂家要小心了,中国首个电动平衡车标准已经公布
认清人形机器人的内在价值
振动台/振动试验台-上海一硕电子科技有限公司
潜在的加密机会在哪里
单端玻封 NTC热敏电阻 温度传感器 100K
无线病房呼叫器LED显示电路
特斯拉:疫情遇冷,中国市场逆流向上,“神话”能否续写?
AT32讲堂051 | 雅特力AT32F435/437 ACC使用指南
中兴 Axon 20 5G 首款屏下摄像头手机现已在全球上市
Samsung电容器知识全解