openresty quickstart

# 安装依赖
apt-get install libpcre3-dev     libssl-dev perl make build-essential curl
# 下载 编译 安装
mkdir /demo
cd /demo
wget https://openresty.org/download/openresty-1.13.6.2.tar.gz
tar -xzvf openresty-1.13.6.2.tar.gz 
cd openresty-1.13.6.2
./configure
make
make install
du -sh /usr/local/*
cd -
mkdir ~/work
cd ~/work
mkdir logs/ conf/
vim conf/nginx.conf
worker_processes  1;
error_log logs/error.log;
events {
    worker_connections 1024;
}
http {
    server {
        listen 8888;
        location / {
            default_type text/html;
            content_by_lua '
                ngx.say("

hello, world

") '; } } } PATH=/usr/local/openresty/nginx/sbin:$PATH export PATH nginx -p `pwd`/ -c conf/nginx.conf curl -v http://localhost:8888 # 查看版本 /usr/local/openresty/nginx/sbin/nginx -v nginx version: openresty/1.13.6.2 # 查看模块详情 /usr/local/openresty/nginx/sbin/nginx -V nginx version: openresty/1.13.6.2 built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) built with OpenSSL 1.0.2g 1 Mar 2016 TLS SNI support enabled configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt=-O2 --add-module=../ngx_devel_kit-0.3.0 --add-module=../echo-nginx-module-0.61 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2rc3 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.13 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.7 --add-module=../rds-json-nginx-module-0.15 --add-module=../rds-csv-nginx-module-0.09 --add-module=../ngx_stream_lua-0.0.5 --with-ld-opt=-Wl,-rpath,/usr/local/openresty/luajit/lib --with-stream --with-stream_ssl_module --with-http_ssl_module

你可能感兴趣的:(openresty quickstart)