Skip to content

Commit

Permalink
delta (#1), openresty (#16): Instalado OpenResty & GUI/lua-resty-auto…
Browse files Browse the repository at this point in the history
…-ssl na Delta (apenas nela por enquanto); salvo arquivos padrões do OpenResty para poder ver o que foi alterado neles
  • Loading branch information
fititnt committed Jun 23, 2019
1 parent 53e8a29 commit 467ff4e
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 1 deletion.
35 changes: 34 additions & 1 deletion diario-de-bordo/delta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
## TODO: rever permissões e usuário do NGinx/OpenResty em breve (fititnt, 2019-06-22 21:40 BRT)
119 changes: 119 additions & 0 deletions diario-de-bordo/delta/usr/local/openresty/nginx/conf/nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
# }
#}

}
21 changes: 21 additions & 0 deletions diario-de-bordo/delta/usr/local/openresty/nginx/html/50x.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>An error occurred.</h1>
<p>Sorry, the page you are looking for is currently unavailable.<br/>
Please try again later.</p>
<p>If you are the system administrator of this resource then you should check
the <a href="http://nginx.org/r/error_log">error log</a> for details.</p>
<p><em>Faithfully yours, OpenResty.</em></p>
</body>
</html>
25 changes: 25 additions & 0 deletions diario-de-bordo/delta/usr/local/openresty/nginx/html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<title>Welcome to OpenResty!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to OpenResty!</h1>
<p>If you see this page, the OpenResty web platform is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="https://openresty.org/">openresty.org</a>.<br/>
Commercial support is available at
<a href="https://openresty.com/">openresty.com</a>.</p>

<p><em>Thank you for flying OpenResty.</em></p>
</body>
</html>
Empty file.

0 comments on commit 467ff4e

Please sign in to comment.