Flutter开发App的未来及其在各行业的应用潜力分析
1272
2022-11-21
Linux安装OpenResty
说明
Linux 是Centos7
安装
依次执行下面的命令:
# 安装依赖库:yum install -y pcre-devel openssl-devel gcc curl# -版本 wget 解压 tar -xzvf openresty-1.15.8.1.tar.gz# 进入解压目录 cd openresty-1.15.8.1/ # 检查配置环境, 生成 Makefile,默认安装到/usr/local/openresty:./configure# 编译安装 gmake && gmake install
安装完了显示
gmake[2]: 离开目录“/root/openresty-1.15.8.1/build/nginx-1.15.8”gmake[1]: 离开目录“/root/openresty-1.15.8.1/build/nginx-1.15.8”mkdir -p /usr/local/openresty/site/lualib /usr/local/openresty/site/pod /usr/local/openresty/site/manifestln -sf /usr/local/openresty/nginx/sbin/nginx /usr/local/openresty/bin/openresty[root@zjj101 openresty-1.15.8.1]#
可以看到openresty 实际上是nginx的软连接。
查看版本号
[root@zjj101 openresty-1.15.8.1]# /usr/local/openresty/bin/openresty -vnginx version: openresty/1.15.8.1
默认安装位置
安装完了openresty之后Nginx默认的位置是:
/usr/local/openresty/nginx
启动停止
下面的命令根据需求去执行
# 检验配置/usr/local/openresty/bin/openresty -t# 启动/usr/local/openresty/bin/openresty# 停止/usr/local/openresty/bin/openresty -s stop# 重新加载配置/usr/local/openresty/bin/openresty -s reload
查看进程是否启动
[root@zjj101 openresty-1.15.8.1]# ps -ef|grep openrestyroot 106088 1 0 19:07 ? 00:00:00 nginx: master process /usr/local/openresty/bin/openrestyroot 106131 96410 0 19:08 pts/0 00:00:00 grep --color=auto openresty
浏览器访问
to OpenResty!If you see this page, the OpenResty web platform is successfully installed and working. Further configuration is required.For online documentation and support please refer to openresty.org.Commercial support is available at openresty.com.Thank you for flying OpenResty.
配置/lib/systemd/system/openresty.service,通过systemctl启动:
vim /lib/systemd/system/openresty.service
[Unit]Description=openresty - high performance web serverAfter=network.target remote-fs.target nss-lookup.target[Service]Type=forkingExecStart=/usr/local/openresty/bin/openresty -c /usr/local/openresty/nginx/conf/nginx.confExecReload=/usr/local/openresty/bin/openresty -s reloadExecStop=/usr/local/openresty/bin/openresty -s stop[Install]WantedBy=multi-user.target
添加openresty.service后,使配置文件生效:
systemctl daemon-reload
然后,就可以使用systemctl管理openresty:
启动 systemctl start openresty查看启动状态 systemctl status openresty.service停止 systemctl stop openresty重载配置 systemctl reload openresty重启 systemctl restart openresty
参考
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~