From 467ff4e88e0c8127af1c29cc9d7c6667cdd5ae86 Mon Sep 17 00:00:00 2001 From: Emerson Rocha Luiz Date: Sat, 22 Jun 2019 22:08:14 -0300 Subject: [PATCH] =?UTF-8?q?delta=20(#1),=20openresty=20(#16):=20Instalado?= =?UTF-8?q?=20OpenResty=20&=20GUI/lua-resty-auto-ssl=20na=20Delta=20(apena?= =?UTF-8?q?s=20nela=20por=20enquanto);=20salvo=20arquivos=20padr=C3=B5es?= =?UTF-8?q?=20do=20OpenResty=20para=20poder=20ver=20o=20que=20foi=20altera?= =?UTF-8?q?do=20neles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- diario-de-bordo/delta.sh | 35 +++++- .../usr/local/openresty/nginx/conf/nginx.conf | 119 ++++++++++++++++++ .../usr/local/openresty/nginx/html/50x.html | 21 ++++ .../usr/local/openresty/nginx/html/index.html | 25 ++++ .../usr/local/openresty/nginx/logs/.gitkeep | 0 5 files changed, 199 insertions(+), 1 deletion(-) create mode 100644 diario-de-bordo/delta/usr/local/openresty/nginx/conf/nginx.conf create mode 100644 diario-de-bordo/delta/usr/local/openresty/nginx/html/50x.html create mode 100644 diario-de-bordo/delta/usr/local/openresty/nginx/html/index.html create mode 100644 diario-de-bordo/delta/usr/local/openresty/nginx/logs/.gitkeep diff --git a/diario-de-bordo/delta.sh b/diario-de-bordo/delta.sh index 1dae61f..3756bf0 100644 --- a/diario-de-bordo/delta.sh +++ b/diario-de-bordo/delta.sh @@ -156,5 +156,38 @@ sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_releas sudo apt-get update # Then you can install a package, say, openresty, like this: +sudo apt-get install openresty + +## Acesse o servidor. No caso de bravo, seria estas URLs +# - http://tsuru-dashboard.173.249.10.99.nip.io/ +# - http://173.249.10.99/ +## E você vera 'Welcome to OpenResty!', pagina padrão. + +#### OpenResty + GUI/lua-resty-auto-ssl, instalação básica _____________________ +# @see https://github.com/GUI/lua-resty-auto-ssl#installation + +# NOTA: sobre instalação do luarocks para o lua-resty-auto-ssl +# Não tenho certeza se a versão que tem no Ubuntu 18.04 do LuaRocks é suficiente +# O link da documentaçãodo Lua Resty Auto SSL manda para documentação padrão +# do OpenResty.org, que diz que instalar o Lua padrão é desaconselhado pois +# o OpenResty ja tem um package manager. Na documentação, falam que existia +# uma versão do lua 2.3.0, mas que usariam a 2.0.13 por questão de +# compatibilidade. Na documetnação do Luarocks eles dizem que a versão estável +# é 3.1.3 (vide https://github.com/luarocks/luarocks/wiki/Download). +# +# No nosso caso aqui, O padrão do Ubuntu 18.04 cita 2.4.2+dfsg-1. +# Vou usar essa padrão do ubuntu e apenas se der problema vou atrás. +# (fititnt, 2019-06-22 21:33 BRT) +sudo apt install luarocks + +# Instala o lua-resty-auto-ssl +sudo luarocks install lua-resty-auto-ssl + +$ sudo luarocks install lua-resty-auto-ssl + +# Create /etc/resty-auto-ssl and make sure it's writable by whichever user your +# nginx workers run as (in this example, "www-data"). +sudo mkdir /etc/resty-auto-ssl +sudo chown www-data /etc/resty-auto-ssl -sudo apt-get install openresty \ No newline at end of file +## TODO: rever permissões e usuário do NGinx/OpenResty em breve (fititnt, 2019-06-22 21:40 BRT) \ No newline at end of file diff --git a/diario-de-bordo/delta/usr/local/openresty/nginx/conf/nginx.conf b/diario-de-bordo/delta/usr/local/openresty/nginx/conf/nginx.conf new file mode 100644 index 0000000..3158886 --- /dev/null +++ b/diario-de-bordo/delta/usr/local/openresty/nginx/conf/nginx.conf @@ -0,0 +1,119 @@ +# FILE: /etc/openresty/nginx.conf +# SERVER: aguia-pescadora-delta.etica.ai + +#user nobody; +worker_processes 1; + +#error_log logs/error.log; +#error_log logs/error.log notice; +#error_log logs/error.log info; + +#pid logs/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include mime.types; + default_type application/octet-stream; + + #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + # '$status $body_bytes_sent "$http_referer" ' + # '"$http_user_agent" "$http_x_forwarded_for"'; + + #access_log logs/access.log main; + + sendfile on; + #tcp_nopush on; + + #keepalive_timeout 0; + keepalive_timeout 65; + + #gzip on; + + server { + listen 80; + server_name localhost; + + #charset koi8-r; + + #access_log logs/host.access.log main; + + location / { + root html; + index index.html index.htm; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} + } + + + # another virtual host using mix of IP-, name-, and port-based configuration + # + #server { + # listen 8000; + # listen somename:8080; + # server_name somename alias another.alias; + + # location / { + # root html; + # index index.html index.htm; + # } + #} + + + # HTTPS server + # + #server { + # listen 443 ssl; + # server_name localhost; + + # ssl_certificate cert.pem; + # ssl_certificate_key cert.key; + + # ssl_session_cache shared:SSL:1m; + # ssl_session_timeout 5m; + + # ssl_ciphers HIGH:!aNULL:!MD5; + # ssl_prefer_server_ciphers on; + + # location / { + # root html; + # index index.html index.htm; + # } + #} + +} diff --git a/diario-de-bordo/delta/usr/local/openresty/nginx/html/50x.html b/diario-de-bordo/delta/usr/local/openresty/nginx/html/50x.html new file mode 100644 index 0000000..dbebd9e --- /dev/null +++ b/diario-de-bordo/delta/usr/local/openresty/nginx/html/50x.html @@ -0,0 +1,21 @@ + + + +Error + + + +

An error occurred.

+

Sorry, the page you are looking for is currently unavailable.
+Please try again later.

+

If you are the system administrator of this resource then you should check +the error log for details.

+

Faithfully yours, OpenResty.

+ + diff --git a/diario-de-bordo/delta/usr/local/openresty/nginx/html/index.html b/diario-de-bordo/delta/usr/local/openresty/nginx/html/index.html new file mode 100644 index 0000000..3f2454a --- /dev/null +++ b/diario-de-bordo/delta/usr/local/openresty/nginx/html/index.html @@ -0,0 +1,25 @@ + + + +Welcome to OpenResty! + + + +

Welcome to OpenResty!

+

If you see this page, the OpenResty web platform is successfully installed and +working. Further configuration is required.

+ +

For online documentation and support please refer to +openresty.org.
+Commercial support is available at +openresty.com.

+ +

Thank you for flying OpenResty.

+ + diff --git a/diario-de-bordo/delta/usr/local/openresty/nginx/logs/.gitkeep b/diario-de-bordo/delta/usr/local/openresty/nginx/logs/.gitkeep new file mode 100644 index 0000000..e69de29