Skip to content

Commit

Permalink
aguia-pescadora-bravo (#16), https-para-portas-localhost (#57): criad…
Browse files Browse the repository at this point in the history
…o HTTP/HTTPS para 2000, 3000, 4000, 5000, 6000, 7000, 8000, 8080, 9000
  • Loading branch information
fititnt committed Jun 1, 2019
1 parent 89c7381 commit 7a99f91
Show file tree
Hide file tree
Showing 2 changed files with 219 additions and 5 deletions.
54 changes: 49 additions & 5 deletions logbook/aguia-pescadora-bravo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ exit
# Send e-mail to Emerson Rocha: rocha(at)ieee.org.
################################################################################

#------------------------------------------------------------------------------#
sudo netstat -ntulp # Portas usadas
sudo lsof -i -P -n | grep LISTEN # Portas usadas (processo & usuário)
#------------------------------------------------------------------------------#

#------------------------------------------------------------------------------#
# SEÇÃO 0.1: Configuração inicial #
# TL;DR: Isso é feito ao receber uma VPS do zero #
Expand Down Expand Up @@ -348,18 +353,26 @@ sudo adduser fcomarcosmabreu
sudo passwd -e fcomarcosmabreu

### fititnt --------------------------------------------------------------------
sudo adduser fititnt
sudo passwd -e fititnt
sudo chsh -s /usr/bin/fish fititnt
sudo usermod -aG sudo fititnt

## Dominios customizados de fititnt (já adicionados na CloudFlare)
curl http://fititnt.apb.etica.ai
curl http://fititnt.lb-ap.etica.ai
curl http://php.fititnt.apb.etica.ai
curl http://php.fititnt.lb-ap.etica.ai
curl http://go.fititnt.apb.etica.ai
curl http://go.fititnt.lb-ap.etica.ai
curl http://js.fititnt.apb.etica.ai
curl http://js.fititnt.lb-ap.etica.ai
## Portas (Nota: apenas portas de aplicações 'mais permanentes')
# - 0.0.0.0:62000
# - 127.0.0.1:62001
#------------------------------------------------------------------------------#
sudo adduser fititnt
sudo passwd -e fititnt
sudo chsh -s /usr/bin/fish fititnt
sudo usermod -aG sudo fititnt

## Portas usadas
sudo lsof -i -P -n | grep LISTEN | grep fititnt

# Aviso: descrição da razão dessaes passos esta em usuariodeteste
sudo mkdir /home2/fititnt
Expand All @@ -372,10 +385,14 @@ sudo -u fititnt mkdir /home2/fititnt/web
sudo -u fititnt mkdir /home2/fititnt/web/public_html
sudo -u fititnt mkdir /home2/fititnt/web/public_api
sudo -u fititnt mkdir /home2/fititnt/web/php
sudo -u fititnt mkdir /home2/fititnt/web/js

sudo -u fititnt echo "fititnt <br>Servidor comunitario: http://aguia-pescadora-bravo.etica.ai <br>Arquivo: /home2/fititnt/web/public_html/index.html" > /home2/fititnt/web/public_html/index.html
sudo -u fititnt echo "fititnt <br>Servidor comunitario: http://aguia-pescadora-bravo.etica.ai <br>Arquivo: /home2/fititnt/web/php/index.php <br><?php phpinfo(); ?>" > /home2/fititnt/web/php/index.php

sudo -u fititnt vim /home2/fititnt/web/js/app.js
# Adicione conteudo de https://nodejs.org/en/docs/guides/getting-started-guide/

sudo cp /etc/nginx/sites-available/EXEMPLO-USUARIO.abp.etica.ai.conf /etc/nginx/sites-available/fititnt.apb.etica.ai.conf

sudo vim /etc/nginx/sites-available/fititnt.apb.etica.ai.conf
Expand Down Expand Up @@ -647,6 +664,9 @@ sudo chown compilebot:compilebot -R /home2/compilebot
#### botpress ------------------------------------------------------------------
# ISSUE: Botpress #55 https://github.com/fititnt/cplp-aiops/issues/54
# ISSUE: Chatbots / Chatops (discussão geral) #54 https://github.com/fititnt/cplp-aiops/issues/54
# DOMINIOS:
# - botpress.apb.etica.ai
# - botpress.lb-ap.etica.ai

sudo adduser botpress
sudo chsh -s /usr/bin/fish botpress
Expand Down Expand Up @@ -704,6 +724,8 @@ curl http://go.usuariodeteste.apb.etica.ai
curl http://go.usuariodeteste.lb-ap.etica.ai
curl http://python.usuariodeteste.apb.etica.ai
curl http://python.usuariodeteste.lb-ap.etica.ai
curl http://js.usuariodeteste.apb.etica.ai
curl http://js.usuariodeteste.lb-ap.etica.ai

## Certificado HTTPS para usuariodeteste
# Linha de comando para obter certificados. Automaticamente já edita configurações do NGinx
Expand Down Expand Up @@ -1485,6 +1507,28 @@ sudo systemctl reload nginx
# Em geral o principal motivo de erro serão permissões de arquivo e de
# diretório até o respectivo arquivo

### Portas internas ____________________________________________________________
# Subdomínios padronizados com HTTP/HTTPS para portas comuns
# ISSUE: https://github.com/fititnt/cplp-aiops/issues/57

vim /etc/nginx/sites-available/PORTAS-INTERNAS.apb.etica.ai.conf
# Adicione as configurações desejadas neste servidor no arquivo acima...
sudo ln -s /etc/nginx/sites-available/PORTAS-INTERNAS.apb.etica.ai.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

sudo certbot --nginx \
-d 2000.apb.etica.ai \
-d 3000.apb.etica.ai \
-d 4000.apb.etica.ai \
-d 5000.apb.etica.ai \
-d 6000.apb.etica.ai \
-d 7000.apb.etica.ai \
-d 8000.apb.etica.ai \
-d 8080.apb.etica.ai \
-d 8888.apb.etica.ai \
-d 9000.apb.etica.ai

#------------------------------------------------------------------------------#
# SEÇÃO: ADMINISTRAÇÃO DO DIA A DIA #
# TL;DR: Atalhos para algumas rotinas comuns do dia a dia de administrador de #
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
server {
listen 80;
listen [::]:80;
server_name 2000.apb.etica.ai 2000.lb-ap.etica.ai;
location / {
proxy_ignore_client_abort on;
proxy_pass http://127.0.0.1:2000;
}

listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/2000.apb.etica.ai/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/2000.apb.etica.ai/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
listen 80;
listen [::]:80;
server_name 3000.apb.etica.ai 3000.lb-ap.etica.ai;
location / {
proxy_ignore_client_abort on;
proxy_pass http://127.0.0.1:3000;
}

listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/2000.apb.etica.ai/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/2000.apb.etica.ai/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
listen 80;
listen [::]:80;
server_name 4000.apb.etica.ai 4000.lb-ap.etica.ai;
location / {
proxy_ignore_client_abort on;
proxy_pass http://127.0.0.1:4000;
}

listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/2000.apb.etica.ai/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/2000.apb.etica.ai/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
listen 80;
listen [::]:80;
server_name 5000.apb.etica.ai 5000.lb-ap.etica.ai;
location / {
proxy_ignore_client_abort on;
proxy_pass http://127.0.0.1:5000;
}

listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/2000.apb.etica.ai/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/2000.apb.etica.ai/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
listen 80;
listen [::]:80;
server_name 6000.apb.etica.ai 6000.lb-ap.etica.ai;
location / {
proxy_ignore_client_abort on;
proxy_pass http://127.0.0.1:6000;
}

listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/2000.apb.etica.ai/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/2000.apb.etica.ai/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
listen 80;
listen [::]:80;
server_name 7000.apb.etica.ai 7000.lb-ap.etica.ai;
location / {
proxy_ignore_client_abort on;
proxy_pass http://127.0.0.1:7000;
}

listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/2000.apb.etica.ai/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/2000.apb.etica.ai/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
listen 80;
listen [::]:80;
server_name 8000.apb.etica.ai 8000.lb-ap.etica.ai;
location / {
proxy_ignore_client_abort on;
proxy_pass http://127.0.0.1:8000;
}

listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/2000.apb.etica.ai/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/2000.apb.etica.ai/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
listen 80;
listen [::]:80;
server_name 8080.apb.etica.ai 8080.lb-ap.etica.ai;
location / {
proxy_ignore_client_abort on;
proxy_pass http://127.0.0.1:8080;
}

listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/2000.apb.etica.ai/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/2000.apb.etica.ai/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
listen 80;
listen [::]:80;
server_name 8888.apb.etica.ai 8888.lb-ap.etica.ai;
location / {
proxy_ignore_client_abort on;
proxy_pass http://127.0.0.1:8888;
}

listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/2000.apb.etica.ai/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/2000.apb.etica.ai/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
listen 80;
listen [::]:80;
server_name 9000.apb.etica.ai 9000.lb-ap.etica.ai;
location / {
proxy_ignore_client_abort on;
proxy_pass http://127.0.0.1:9000;
}

listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/2000.apb.etica.ai/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/2000.apb.etica.ai/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

0 comments on commit 7a99f91

Please sign in to comment.