1、首先编译安装nginx(不多说)

2、开始安装openresty

cd /usr/local/src

wget https://openresty.org/download/openresty-1.11.2.2.tar.gz

tar xf openresty-1.11.2.2.tar.gz

cd openresty-1.11.2.2/

编译开始

--prefix=/usr/local/nginx --sbin-path=/usr/sbin/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/log/nginx.pid --error-log-path=/usr/local/nginx/log/error.log --http-log-path=/usr/local/nginx/log/access.log --lock-path=/var/lock/nginx.lock --with-luajit --with-http_gunzip_module --with-pcre --with-pcre-jit --with-http_perl_module --with-ld-opt="-Wl,-E" --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-select_module --with-poll_module --with-file-aio --with-http_degradation_module --with-libatomic --http-client-body-temp-path=/var/tmp/nginx/client_body --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi

编译过程中会出现各种确实库和模块的错误,根据提示自行补充缺少的依赖库和模块。

安装

gmake && gmake install

查看是否安装成功:

nginx -v

创建目录

mkdir -p /var/tmp/nginx

配置

user                                    nginx;
pid /var/run/nginx.pid; worker_processes 2;
worker_rlimit_nofile 65534; events {
use epoll;
worker_connections 65534;
multi_accept on;
} http {
client_body_buffer_size 16k;
client_body_timeout 30s;
client_header_buffer_size 2k;
large_client_header_buffers 4 16k;
client_header_timeout 30s;
client_max_body_size 8m;
keepalive_timeout 300;
output_buffers 2 16k;
send_timeout 60s;
server_names_hash_bucket_size 128;
reset_timedout_connection on; #gzip
gzip on;
gzip_min_length 512;
gzip_buffers 16 4k;
gzip_comp_level 4;
gzip_proxied any; #cache
open_file_cache max=204800 inactive=60s;
open_file_cache_errors on;
open_file_cache_min_uses 1;
open_file_cache_valid 60s; #proxy
proxy_buffer_size 32k;
proxy_buffers 8 32k;
proxy_busy_buffers_size 32k;
proxy_cache_path /var/tmp/nginx/proxy_cache levels=1:2 keys_zone=content:200m inactive=30d max_size=10g;
proxy_cache_path /var/tmp/nginx/proxy_cache/enginx levels=1:2 keys_zone=enginx:200m inactive=30d max_size=10g;
proxy_cache_key $host$proxy_host$uri$is_args$args;
proxy_connect_timeout 60s;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_temp_file_write_size 32k;
proxy_temp_path /var/tmp/nginx/proxy_temp;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header Accept-Encoding '';
real_ip_header X-Forwarded-For; #log
log_format main '$remote_addr - $remote_user [$time_local] "$request" $http_host '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'$upstream_addr $upstream_status $upstream_cache_status "$upstream_http_content_type" $upstream_response_time > $request_time'; open_log_file_cache max=204800 inactive=20s valid=1m min_uses=1;
error_log /var/log/nginx/error.log error; #host configure file
include /usr/local/nginx/conf.d/*.ngx.conf; #main configure
server_tokens off;
sendfile off;
tcp_nopush on;
tcp_nodelay off;
charset utf-8;
include /usr/local/nginx/mime.types;
default_type text/html;
}

创建目录

mkdir /usr/local/nginx/conf.d

新建文件

local.ngx.conf

server {

    listen                  80;

    server_name             www.web-t1.t.com;

    return 301 http://web-t1.t.com$request_uri;

}

server {

    listen                  80;

    server_name             web-t1.t.com;

    root                    /usr/local/html/web-t1.t.com/public_html/;

    access_log              /usr/local/html/web-t1.t.com/logs/ngx_access.log main;

    location / {

        index               index.html;

    }

}

启动测试停止nginx: nginx  、nginx -t 、nginx -s stop

编译安装基于nginx与lua的高性能web平台-openresty的更多相关文章

  1. 通过 Lua 扩展 NGINX 实现的可伸缩的 Web 平台OpenResty®

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

  2. OpenResty:通过 Lua 扩展 NGINX 实现的可伸缩的 Web 平台

    关于 http://openresty.org/cn/about.html 这个开源 Web 平台主要由章亦春(agentzh)维护.在 2011 年之前曾由淘宝网赞助,在后来的 2012 ~ 201 ...

  3. OpenResty高性能web平台

    openresty高性能web平台安装使用 简介:OpenResty® 是一个基于 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库.第三方模块以及大多数的依赖项.用 ...

  4. 单机闭环 使用Nginx+Lua开发高性能Web应用

    [西域骆驼D1532101213]西域骆驼(VANCAMEL)D1532101213 休闲套脚鞋 卡其43[行情 报价 价格 评测]-京东 http://item.jd.com/1856564.htm ...

  5. Nginx之编译安装的nginx加入systemctl

    编译安装的nginx需要添加rc.local 编译安装后设置 /usr/lib/systemd/system/nginx.service [Unit] Description=nginx After= ...

  6. 编译安装基于 fastcgi 模式的多虚拟主机的wordpress和discuz的LAMP架构

    目录 实现CentOS 7 编译安装基于 fastcgi 模式的多虚拟主机的wordpress和discuz的LAMP架构 准备环境: 准备软件版本: 主机名修改用以区分 数据库服务器 实现数据库二进 ...

  7. 已经编译安装的nginx/tenginx编译增加新模块

    只适用于自行编译安装的nginx配置 业务变更带来的Nginx增加模块需求 由于业务从php转为go开发,需要用到Http2的协议.这种协议在Nginx上需要http_v2_module这个模块的支持 ...

  8. 基于Spring + Spring MVC + Mybatis 高性能web构建

    基于Spring + Spring MVC + Mybatis 高性能web构建 一直想写这篇文章,前段时间 痴迷于JavaScript.NodeJs.AngularJs,做了大量的研究,对前后端交互 ...

  9. CentOS6编译安装PHP7+Nginx

    本文属于动手搭建PHP开发环境的一部分,更多点击链接查看. 本文以centos6为例. 安装PHP 下载 http://cn2.php.net/distributions/php-5.6.22.tar ...

随机推荐

  1. 关于Cocos Studio制作游戏资源

    没想到,Cocos Studio居然是做游戏资源的,而且可以做骨骼动画,虽然我还不会做,只能自己一个人慢慢研究了.学长以前说,Coocs Studio只是用来打包项目成Apk的,没有什么卵用,刚开始我 ...

  2. 图像边缘检測--OpenCV之cvCanny函数

    图像边缘检測--OpenCV之cvCanny函数 分类: C/C++ void cvCanny( const CvArr* image, CvArr* edges, double threshold1 ...

  3. db2 over()

    说起 DB2 在线分析处理,可以用很好很强大来形容.这项功能特别适用于各种统计查询,这些查询用通常的SQL很难实现,或者根本就无发实现.首先,我们从一个简单的例子开始,来一步一步揭开它神秘的面纱,请看 ...

  4. MathType中公式不对齐怎么办

    MathType是一款专门用来编辑数学公式的数学公式编辑器,利用它可以在文档中快速编辑公式,与文字完美结合,可以编辑出各种各样的数学符号与公式,省下你不少的时间. 一.对齐上标与下标 MathType ...

  5. Ocx控件注册不成功?可能是tlb文件导致~

    Ocx文件是最常用的文件,实际操作中常常需要注册之~ 但是问题来了,经常会出现注册不成功的问题: 解决方法: 1.以“管理员身份”注册 2.Dependency Walker查看依赖是否缺失 3.查看 ...

  6. 下载安装JDK,并且配置java环境变量

    如果想使用java语言编写程序,就必须搭建一个java开发环境,需要安装jdk,然后配置环境变量. 一:下载jdk 现在的jdk主流的是sun公司的jdk,当然IBM和其他一些商业公司都开发有自己的j ...

  7. Swift学习笔记之--类和对象

    通过在 class后接类名称来创建一个类.在类里边声明属性与声明常量或者变量的方法是相同的,唯一的区别的它们在类环境下.同样的,方法和函数的声明也是相同的写法 class Shape { func s ...

  8. Python 爬虫知识点 - 淘宝商品检索结果抓包分析(续一)

    通过前一节得出地址可能的构建规律,如下: https://s.taobao.com/search?data-key=s&data-value=44&ajax=true&_ksT ...

  9. python2.0 s12 day8 _ 堡垒机前戏paramiko模块

    堡垒机前戏 开发堡垒机之前,先来学习Python的paramiko模块,该模块机遇SSH用于连接远程服务器并执行相关操作 paramiko模块是做主机管理的,他模拟了一个ssh. 有两种形式连接形式, ...

  10. RF-template使用

    在测试案例中,可以使用template设置进行数据驱动的测试,template设置方法: 在设置项中填写模板的关键字名称,测试案例本身只能包含template关键字使用的数据: *** Setting ...