【openresty】openresty 下载与安装

1、下载源码和依赖:

虚拟机linux环境为:14.04.1-Ubuntu

openresty源码,http://openresty.org/cn/download.html,找到源码后,下载到linux环境,比如/opt目录下,tar -zxvf openresty-1.15.8.1.tar.gz 解压

此时先不要编辑,因为openresty还有一些依赖项需要安装。将要使用的编译参数为:
./configure --with-debug  --prefix=/opt/openresty/ --user=root --group=root  --with-pcre=/opt/openresty_third/pcre-8.40 --with-zlib=/opt/openresty_third/zlib-1.2.11 --with-openssl=/opt/openresty_third/openssl-1.0.2q --with-http_ssl_module --add-module=/opt/nginx-rtmp-module --with-cc-opt="-g -O0"

上面参数,--prefix=/opt/openresty/表示 openresty将要被安装到的目录。--with-pcre=/opt/openresty_third/pcre-8.40表示pcre被安装到的目录。依次类推。

依赖项,openssl,pcre-8.40,zlib-1.2.11。其中pcre可以去ftp://ftp.pcre.org/pub/pcre/查找下载。依赖项都需要进行解压,如果找不到,可以私信发你。

本工程放到如下目录:

tar -zxvf openssl-1.0.2q.tar.gz
  cd openssl-1.0.2q/
  sudo ./configure 
  sudo make 
  sudo make install

2、编译安装

进入 /opt/openresty/ 目录下,编译,

./configure --with-debug  --prefix=/opt/openresty/ --user=root --group=root  --with-pcre=/opt/openresty_third/pcre-8.40 --with-zlib=/opt/openresty_third/zlib-1.2.11 --with-openssl=/opt/openresty_third/openssl-1.0.2q --with-http_ssl_module --add-module=/opt/nginx-rtmp-module --with-cc-opt="-g -O0"

make
make install

可以看到在/opt/openresty下生成了运行目录。

添加nginx环境变量到系统,/etc/profile

root@ubuntu:/usr/local/bin# /opt/openresty/nginx/sbin/nginx -s reload 
root@ubuntu:/usr/local/bin# curl 127.0.0.1
<!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>

 

也可以在windows浏览器访问,

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值