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. 【转】7Z命令行解压缩

    7z.exe在CMD窗口的使用说明如下: 7-Zip (A) 4.57 Copyright (c) 1999-2007 Igor Pavlov 2007-12-06 Usage: 7za <co ...

  2. 介绍Unity中相机的投影矩阵与剪切图像、投影概念

    这篇作为上一篇的补充介绍,主要讲Unity里面的投影矩阵的问题: 上篇的链接写给VR手游开发小白的教程:(三)UnityVR插件CardboardSDKForUnity解析(二) 关于Unity中的C ...

  3. Android camera 竖直拍照 获取竖直方向照片

    竖直拍照 if (Integer.parseInt(Build.VERSION.SDK) >= 8) {     camera.setDisplayOrientation(90); } else ...

  4. CentOS 6.5 下Vim 配置图解

    分享个CentOS 6.5 下Vim 配置图文详解,希望对大家有所帮助. 1. 登录并进入你常用的用户名下,查看其主目录 命令: # su xxx $ cd xxx $ ls -a 2.查看并建立目录 ...

  5. js unicode处理

    //岗位详细界面 var str="1.\u000D\u21B52.\u000D\u21B53"; var pad = function() { var tbl = []; ret ...

  6. pclzip 压缩文件与解压

    类PclZip.class.php下载:PclZip.rar<?php header("Content-type: text/html; charset=utf-8"); f ...

  7. JavaScript-事件冒泡简介及应用

    一.什么是事件冒泡 在一个对象上触发某类事件(比如单击onclick事件),如果此对象定义了此事件的处理程序,那么此事件就会调用这个处理程序,如果没有定义此事件处理程序或者事件返回true,那么这个事 ...

  8. chrome浏览器默认启动时打开2345导航的解决方法

    2345并没有改动chrome内部设置.它仅仅是把全部的快捷方式改动了.包含開始菜单旁边的快捷启动图标. 仅仅须要右键chrome快捷方式.在目标一栏中,把"----chrome.exe&q ...

  9. js时间转化

    const defaultTicks = 621355968000000000; export function convertDateToTicks(date = new Date()) { ret ...

  10. Linux jstack分析cpu占用100%

    背景: 运行测试程序后,top命令发现某个进程(pid)占用cpu达到100%.   查看哪个线程占用最多资源: ps mp pid -o THREAD,tid,命令查看这个进程下面的所有线程占用情况 ...