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. selenium测试(Java)--浏览器控制(四)

    1. 控制浏览器窗口大小 1 package com.test.window; 2 3 import org.openqa.selenium.Dimension; 4 import org.openq ...

  2. jQuery的Ajax操作小结——$.ajax和$.getJSON等用法小结

    一.$.ajax用法与举例 jQuery.ajax(url,[settings])     ——返回值:XMLHttpRequest 通过 HTTP 请求加载远程数据,这个是jQuery 的底层 AJ ...

  3. 同一页面中引入多个JS库产生的冲突解决方案(转)

    发生JS库冲突的主要原因:与jQuery库一样,许多JS库都使用‘$’符号作为其代号.因此在一个页面中引入多个JS库,并且使用‘$’作为代号时,程序不能识别其代表哪个库(这个是我自己的解释,但更深的原 ...

  4. CentOS运行级别和开机过程

    linux运行级别: 1)0:关机 2)1:单用户 3)2:多用户状态没有网络服务 4)3:多用户状态有网络服务 5)4:系统未使用保留给用户 6)5:图形界面 7)6:系统重启 注:常用运行级别是3 ...

  5. php中ignore_user_abort函数的用法(定时)

    PHP中的ignore_user_abort函数是当用户关掉终端后脚本不停止仍然在执行,可以用它来实现计划任务与持续进程,下面会通过实例讨论ignore_user_abort()函数的作用与用法. i ...

  6. 【MYSQL】导入中文后乱码问题

    http://fatkun.com/2011/05/mysql-alter-charset.html

  7. MVC+LINQToSQL的Repository模式之(一)数据工厂 DataContext绑定线程

    namespace Data{    /// <summary>    /// 数据库建立工厂    /// Created By : 张占岭    /// Created Date:20 ...

  8. VC实现波形不闪烁动态绘图 .

    http://blog.csdn.net/xuyongbeijing2008/article/details/8064284 源代码:http://www.vckbase.com/index.php/ ...

  9. java总结(1)——java的特点

    之前学习java仅仅是单纯的学习,老师要求学习.所以就学习.可是没有细致考虑过java的一些特别之处,比方,我们为什么要学习java而不是其它的语言,它必定有选择它的特点.所以,从如今開始,仅仅有埋头 ...

  10. 查看系统负载:uptime

    uptime命令用于查看系统负载,跟 w 命令的输出内容一致 [root@localhost ~]$ uptime :: up days, :, users, load average: 0.03, ...