编译安装基于nginx与lua的高性能web平台-openresty
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的更多相关文章
- 通过 Lua 扩展 NGINX 实现的可伸缩的 Web 平台OpenResty®
OpenResty® 是一个基于 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库.第三方模块以及大多数的依赖项.用于方便地搭建能够处理超高并发.扩展性极高的动态 W ...
- OpenResty:通过 Lua 扩展 NGINX 实现的可伸缩的 Web 平台
关于 http://openresty.org/cn/about.html 这个开源 Web 平台主要由章亦春(agentzh)维护.在 2011 年之前曾由淘宝网赞助,在后来的 2012 ~ 201 ...
- OpenResty高性能web平台
openresty高性能web平台安装使用 简介:OpenResty® 是一个基于 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库.第三方模块以及大多数的依赖项.用 ...
- 单机闭环 使用Nginx+Lua开发高性能Web应用
[西域骆驼D1532101213]西域骆驼(VANCAMEL)D1532101213 休闲套脚鞋 卡其43[行情 报价 价格 评测]-京东 http://item.jd.com/1856564.htm ...
- Nginx之编译安装的nginx加入systemctl
编译安装的nginx需要添加rc.local 编译安装后设置 /usr/lib/systemd/system/nginx.service [Unit] Description=nginx After= ...
- 编译安装基于 fastcgi 模式的多虚拟主机的wordpress和discuz的LAMP架构
目录 实现CentOS 7 编译安装基于 fastcgi 模式的多虚拟主机的wordpress和discuz的LAMP架构 准备环境: 准备软件版本: 主机名修改用以区分 数据库服务器 实现数据库二进 ...
- 已经编译安装的nginx/tenginx编译增加新模块
只适用于自行编译安装的nginx配置 业务变更带来的Nginx增加模块需求 由于业务从php转为go开发,需要用到Http2的协议.这种协议在Nginx上需要http_v2_module这个模块的支持 ...
- 基于Spring + Spring MVC + Mybatis 高性能web构建
基于Spring + Spring MVC + Mybatis 高性能web构建 一直想写这篇文章,前段时间 痴迷于JavaScript.NodeJs.AngularJs,做了大量的研究,对前后端交互 ...
- CentOS6编译安装PHP7+Nginx
本文属于动手搭建PHP开发环境的一部分,更多点击链接查看. 本文以centos6为例. 安装PHP 下载 http://cn2.php.net/distributions/php-5.6.22.tar ...
随机推荐
- am335x mux配置
/**************************************************************** * am335x mux配置 * * am335x的引脚复寄存器是C ...
- DOM编程 学习笔记(二)
学习内容: 1.document对象 2.event对象 该对象将标记型文档进行封装 该对象的作用,是对可标记型文档进行操作 常见操作,想要实现动态效果,需要对节点操作,那么先获取到这个节点,想获取节 ...
- (转)windows平台时间函数性能比较QueryPerformanceCounter,GetTickCount,ftime,time,GetLocalTime,GetSystemTimeAsFileTime
执行 10000000 次, 耗时 2258,369 微秒 QueryPerformanceCounter 执行 10000000 次, 耗时 26,347 微秒 GetTickCoun ...
- linux -- Ubuntu Server 安装图形界面
1.连接网络,你一定要确保网络通畅,如果你和我一样使用Wireless,那先找根网线插上,因为下面的安装都要通过网络下载组件的. 2.进入图形界面的命令是startX,敲击后会有安装xinit的提示. ...
- ASP.NET WebApi 路由配置【转】
一.路由介绍 ASP.NET Web API路由是整个API的入口.我们访问某个资源就是通过路由映射找到对应资源的URL.通过URL来获取资源的. 对于ASP.NET Web API内部实现来讲,我们 ...
- Loadrunner中socket协议中的三个关联函数
这3个函数其实都可以动态获取运行中收到的数据包中的数据,只要跟在要获取的收取数据包脚本后面即可.其中:lrs_save_searched_string和lrs_save_param如果buf_desc ...
- HDFS特点
- parameter "timeout" in socketchannel does not work
// Accept the connection and make it non-blocking SocketChannel socketChannel = serverSocketChannel. ...
- ASIHttpRequest封装
ASIHttpRequest是一个非常好的库,只是直接使用稍嫌麻烦,以下就尝试来封装一下吧. 思路:每次请求时,须要创建一个ASIHttpRequest对象,设置它的属性(url,delegate.p ...
- HTML&CSS精选笔记_HTML与CSS网页设计概述
HTML与CSS网页设计概述 Web基本概念 认识网页 网页主要由文字.图像和超链接等元素构成.当然,除了这些元素,网页中还可以包含音频.视频以及Flash等. 名词解释 Internet网络 就是通 ...