Nvidia Xavier(ARM64)上安装openresty
发布日期:2021-10-03 22:59:19 浏览次数:27 分类:技术文章

本文共 2568 字,大约阅读时间需要 8 分钟。

OpenResty是一个基于 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态 Web 应用、Web 服务和动态网关。

 

OpenResty官方提供了大多数Linux发行版的预编译的包,所以安装非常简单,可以直接参考 进行安装。但是官方的二进制包只支持X86_64 和AMD64 的CPU,如果需要在ARM CPU上安装openresty就需要从源码开始安装了。

这里介绍在Nvidia的Jetson Xavier 套件上安装openrety的方法, 使用的操作系统为ubuntu18.04。

 

1安装依赖

sudo apt-get install libpcre3-dev libssl-dev perl make build-essential curl

 

2下载源码

download source from

 

3 编译安装

  1. tar -xzvf openresty-VERSION.tar.gz
  2. cd openresty-VERSION/
  3. ./configure
  4. Make
  5. sudo make install

 

安装完成后,位于目录/usr/local/openresty/

4 添加到systemd自动启动

1)在/lib/systemd/system目录创建文件openresty.service

> cd /lib/systemd/system

      > sudo touch openresty.service

2)在openresty.service中添加下面的内容:

 [Unit] 

Description=full-fledged web platform 

After=network.target 

[Service] 

Type=forking 

PIDFile=/usr/local/openresty/nginx/logs/nginx.pid 

ExecStartPre=/usr/local/openresty/nginx/sbin/nginx -t -q -g 'daemon on; master_process on;' 

ExecStart=/usr/local/openresty/nginx/sbin/nginx -g 'daemon on; master_process on;' 

ExecReload=/usr/local/openresty/nginx/sbin/nginx -g 'daemon on; master_process on;' -s reload 

ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /usr/local/openresty/nginx/logs/nginx.pid 

TimeoutStopSec=5 

KillMode=mixed 

 

[Install] 

WantedBy=multi-user.target

3)enable openresty

> sudo systemctl enable openresty

     输出如下:

         robin@ubuntu:/lib/systemd/system$ sudo systemctl enable openresty

Created symlink /etc/systemd/system/multi-user.target.wants/openresty.service /lib/systemd/system/openresty.service.

  4) 启动openresty

     > sudo systemctl start openresty

      >  sudo systemctl status openresty

robin@ubuntu:/lib/systemd/system$ sudo systemctl start openresty

robin@ubuntu:/lib/systemd/system$ sudo systemctl status openresty

openresty.service - full-fledged web platform

   Loaded: loaded (/lib/systemd/system/openresty.service; enabled; vendor preset: enabled)

   Active: active (running) since Mon 2020-06-22 11:00:03 CST; 1s ago

  Process: 32078 ExecStart=/usr/local/openresty/nginx/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

  Process: 32061 ExecStartPre=/usr/local/openresty/nginx/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

 Main PID: 32086 (nginx)

    Tasks: 2 (limit: 4915)

   CGroup: /system.slice/openresty.service

           ├─32086 nginx: master process /usr/local/openresty/nginx/sbin/nginx -g daemon on; master_process on;

           └─32088 nginx: worker process

6 22 11:00:03 ubuntu systemd[1]: Starting full-fledged web platform...

6 22 11:00:03 ubuntu systemd[1]: Started full-fledged web platform.

转载地址:https://blog.csdn.net/lclfans1983/article/details/107255857 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:LPMS-CU2 IMU在 Nvidia Xavier安装配置
下一篇:python文件编译与pyc反编译

发表评论

最新留言

能坚持,总会有不一样的收获!
[***.219.124.196]2024年03月29日 23时47分19秒