当前位置: 首页 > Linux

CentOS安装OpenResty

时间:2023-04-07 03:14:47 Linux

参考文档:http://openresty.org/cn/installation.htmlOpenResty的安装过程比较简单,官方文档已经有详细的说明。这里主要是做安装记录1.安装#下载wgethttps://openresty.org/download/openresty-1.13.6.2.tar.gz#安装依赖库yuminstallpcre-developenssl-develgcccurl#解压tar-zxvfopenresty-1.13.6.2.tar.gzcdopenresty-1.13.6.2/#配置(检测环境,生成Makefile,准备编译)./configure#编译make#安装makeinstall。主要有两点需要注意:安装前需要准备依赖库。/configuredefault--prefix=/usr/local/openresty,程序会安装到/usr/local/openresty目录下,可以指定各种选项你自己,比如./configure--prefix=/opt/openresty\--with-luajit\--without-http_redis2_module\--with-http_iconv_module\--with-http_postgres_module使用./configure--help查看更多选项./configure运行报错可以去build/nginx-1.13.6.2/objs/autoconf.err查看2、启动配置环境变量shell>vim/etc/profileadd一行exportPATH=/usr/local/openresty/bin:/usr/local/openresty/nginx/sbin:$PATHshell>source/etc/profile启动shell>nginx-c/usr/local/openresty/nginx/conf/nginx.conf重新加载配置shell>nginx-sreload3,测试