你的位置:首页 > 软件开发 > 操作系统 > openresty安装配置

openresty安装配置

发布时间:2017-08-17 18:00:20
安装openresty需要的库 apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make build-essential 构建 OpenResty进入下载好的压缩包文 ...

openresty安装配置

安装openresty需要的库 apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make build-essential 构建 OpenResty进入下载好的压缩包文件中用下面的命令进行解压 VERSION 为当前openresty的版本tar -xzvf openresty-VERSION.tar.gz 然后在进入 openresty-VERSION/  目录, 然后输入以下命令配置(默认配置安装):./configure 编译安装下面命令进行编译make下面的命令安装 OpenResty到系统之中make install此时,我的系统中已经安装好了Openresty,因为在配置时使用了默认安装路径,所以我的程序被安装到了:/usr/local/openresty/中,该文件夹中包含了luajit、lualib、nginx三个目录。openresty的配置文件默认是在  /usr/local/openresty/nginx/conf

 

 运行nginx进入目录,执行./nginxopenresty安装配置

 

没报错就运行起来了执行nginx -V 查看nginx 版本信息   停止服务:
nginx -s reload :修改配置后重新加载生效nginx -s reopen :重新打开日志文件nginx -t -c /path/to/nginx.conf 测试nginx配置文件是否正确关闭nginx:nginx -s stop :快速停止nginx   quit :完整有序的停止nginx其他的停止nginx 方式:ps -ef | grep nginxkill -QUIT 主进程号  :从容停止Nginxkill -TERM 主进程号  :快速停止Nginxpkill -9 nginx   :强制停止Nginx启动nginx:nginx -c /path/to/nginx.conf平滑重启nginx:kill -HUP 主进程号

  

启动服务
通过下述方式启动Nginx。如果没有任何输出,说明启动成功,-p 指定我们的项目目录,-c 指定配置文件。/usr/local/openresty/nginx/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.conf/usr/local/openresty/nginx/sbin/nginx -p 'pwd' -c /usr/local/openresty/nginx/conf/nginx.conf为openresty下的nginx建立软链(非必需)ln -s /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx则可使用如下方式启动/usr/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.conf

安装成功

1、/usr/local/openresty/site/lualib里添加 resty和cjson的引用

  

问题解决:The program 'nginx' can be found in the following packages: 
* nginx-extras 
* nginx-full 
* nginx-light 
Try: apt-get install <selected package>  开始我以为是我的nginx安装错了,然后找各种教程仔细看安装步骤,觉得没有问题啊,折腾好久不知道该怎么办,最好在网友的提示下仔细看了提示,然后按照提示继续做,即:apt-get install nginx-extras 回车apt-get install nginx-full 回车apt-get install nginx-light回车

原标题:openresty安装配置

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录