OpenResty,简单可以理解为增强版的Nginx。但由于其默认路径是装在:

/usr/local/openresty/

所以用习惯yum安装的Nginx的同学,使用习惯上会有所变动,常用的路径会改变。

所以本文讲解一下安装,并通软链接的方式,保持原有的使用习惯。

具体指令如下:

yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo 
yum install openresty -y
mkdir /usr/local/openresty/nginx/conf/conf.d
mkdir /var/log/nginx/
ln -s /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx
ln -s /usr/local/openresty/nginx/conf /etc/nginx
mkdir -p /var/lib/nginx/tmp/
ln -s /usr/local/openresty/nginx/client_body_temp /var/lib/nginx/tmp/client_body
ln -s /usr/local/openresty/nginx/fastcgi_temp /var/lib/nginx/tmp/fastcgi
ln -s /usr/local/openresty/nginx/proxy_temp /var/lib/nginx/tmp/proxy
ln -s /usr/local/openresty/nginx/scgi_temp /var/lib/nginx/tmp/scgi
ln -s /usr/local/openresty/nginx/uwsgi_temp /var/lib/nginx/tmp/uwsgi

参考资料:centos yum 安装openresty



Related Posts: CentOS如何保持Nginx的使用习惯切换安装OpenResty :

留言