CentOS8上安装OpenResty安装

文章目录

  • 环境
  • 安装开发库
  • 下载源码包
  • 安装
  • 检查

环境

[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 8.1.1911 (Core)

安装开发库

[root@localhost ~]# yum install pcre-devel openssl-devel gcc curl wget tar -y

下载源码包

[root@localhost ~]# wget https://openresty.org/download/openresty-1.15.8.2.tar.gz

安装

[root@localhost ~]# tar -zxf openresty-1.15.8.2.tar.gz
[root@localhost ~]# cd openresty-1.15.8.2
[root@localhost openresty-1.15.8.2]# ./configure --prefix=/usr/local/openresty
[root@localhost ~]# gmake
[root@localhost ~]# gmake install

检查

[root@localhost openresty-1.15.8.2]# /usr/local/openresty/nginx/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.conf
[root@localhost openresty-1.15.8.2]# curl 127.0.0.1:80
<!DOCTYPE html>
<html>
<head>
<title>Welcome to OpenResty!</title>
<style>
    body {
     
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to OpenResty!</h1>
<p>If you see this page, the OpenResty web platform is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="https://openresty.org/">openresty.org</a>.<br/>
Commercial support is available at
<a href="https://openresty.com/">openresty.com</a>.</p>

<p><em>Thank you for flying OpenResty.</em></p>
</body>
</html>

你可能感兴趣的:(运维)