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. Docker之删除container和image

    删除所有停止的container: docker rm $(docker ps -a -q) 删除所有未标记的image docker rmi $(docker images | grep " ...

  2. python with妙用

    class aa(): def bb(self): print("hhhh") return "hello world" def __enter__(self) ...

  3. (转)SCR, PCR, ESCR, PTS, DTS

    1.       SCR SCR是存在于PS中的,即PS的pack里面的一个field.他用来指定这个PS的pack期望的到达decoder的时间. 2.       ESCR ESCR是位于PES里 ...

  4. MySQL 插入数据时,中文乱码问题的解决

    当向 MySQL 数据库插入一条带有中文的数据形如 insert into employee values(null,'张三','female','1995-10-08','2015-11-12',' ...

  5. CentOS 7拨号上网(ADSL & PPPoE)

    步骤概述: 1.搜寻PPPoE相关软件,本人使用的是rp-pppoe yum search pppoe 2.使用yum安装rp-pppoe yum install rp-pppoe -y 3.开始配置 ...

  6. jquery widgets 弹框

    <div id='dialog' style="display:none;"> <div style="text-align:center;" ...

  7. MVC上传(单文件)

    后台代码: public ActionResult upload() { //获取文件对象 var file = Request.Files[0]; string suffix/*文件格式*/ = S ...

  8. Shell脚本中$0、$?、$!、$$、$*、$#、$@等的意义

    http://blog.csdn.net/slovyz/article/details/47400107

  9. makefile--参数传递、条件判断、include (五)

    原创博文,转载请标明出处--周学伟http://www.cnblogs.com/zxouxuewei/ 在多个Makefile嵌套调用时,有时我们需要传递一些参数给下一层Makefile.比如我们在顶 ...

  10. asp.net返回值当文件下载问题

    mvc中返回的javascript当做文件下载 解决方案 Response.ContentEncoding = System.Text.Encoding.UTF8;   Response.Conten ...