网站首页 > 技术教程 正文
下载openresty
wget https://openresty.org/download/openresty-1.15.8.1.tar.gz tar zxvf openresty-1.15.8.1.tar.gz cd openresty-1.15.8.1
安装openresty
查看当前nginx的编译配置
nginx -V
如下所示,"configure arguments"就是编译nginx时的配置
nginx version: nginx/1.14.0 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) built with OpenSSL 1.0.2k-fips 26 Jan 2017 TLS SNI support enabled configure arguments: --with-http_ssl_module
编译openresty,把刚才的配置加到"configure"命令后方,如果需要使用lua也可以加上"--with-luajit"
./configure --with-http_ssl_module --with-luajit gmake && gmake install
gmake即GNU make,使用它的原因是非GNU平台可能占用了make命令,在linux系统下不用考虑这个问题。GNU,在Unix系统发明后,开始出现闭源收费软件,于是有人发起了自由软件的计划,即GNU计划,宣扬开源精神,编辑器Emacs和编译器GCC就属于GNU下的项目,但是GNU下缺少系统内核,后来机缘巧合地与Linux进行了合作,发布了GNU/Linux。
更换配置文件
把原有nginx配置文件移动到openresty目录
mv /usr/local/nginx/conf/*.conf /usr/local/openresty/conf mv /usr/local/nginx/conf/conf.d /usr/local/openresty/conf
停止原nginx
nginx -s stop
启动openresty
/usr/local/openresty/bin/openresty
如果提示"nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl"",原因是nginx1.15版本及以后已经不需要使用ssl on命令了,可以去掉。
软链接到bin目录
如果觉得命令使用不方便可以直接软链接到bin目录,并改名为nginx
ln -s /usr/local/openresty/bin/openresty /usr/local/bin/nginx
转自:https://www.linuxprobe.com/openresty-nginx.html
猜你喜欢
- 2024-10-11 Nginx、HAProxy、LVS三种负载均衡的区别和特点(附学习资料)
- 2024-09-19 运维干货-tengine与nginx的区别(nginx vs)
- 2024-09-19 Nginx之反向代理,正向代理和反向代理什么区别?
- 2024-09-19 Nginx——正向代理和反向代理的区别
- 2024-09-19 nginx反向代理和负载均衡区别(nginx反向代理和负载均衡区别)
- 2024-09-19 Nginx 原理和架构 | 原力计划(nginx工作原理图)
- 2024-09-19 Gateway和Nginx的区别是什么?#程序员
- 2024-09-19 iis和nginx的区别?(nginx和http的区别)
- 2024-09-19 nginx 和 apache 对比区别(apache2 nginx 对比)
- 2024-09-19 Apache和nginx哪个性能高?(apache2 nginx 对比)
你 发表评论:
欢迎- 最近发表
-
- Linux新手必看:几种方法帮你查看CPU核心数量
- linux基础命令之lscpu命令(linux中ls命令的用法)
- Linux lscpu 命令使用详解(linux常用ls命令)
- 如何查询 Linux 中 CPU 的数量?这几个命令要知道!
- 在linux上怎么查看cpu信息(linux如何查看cpu信息)
- 查看 CPU 的命令和磁盘 IO 的命令
- 如何在CentOS7上改变网卡名(centos怎么改网卡名字)
- 网工必备Linux网络管理命令(网工必备linux网络管理命令是什么)
- Linux 网络命令知多少(linux 网络 命令)
- Linux通过命令行连接wifi的方式(linux命令行连接无线网)
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)