Commit b66c6ef76c9ec2de9143973fe0d7dba1246d6df9
1 parent
eef50e78
Exists in
master
and in
2 other branches
Took some notes to test strategy
With apache2 and sinatra application
Showing
1 changed file
with
27 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | +Configurando apache para setar header Remote-User: | |
| 2 | + | |
| 3 | +1 - Instalar apache2 | |
| 4 | +2 - Criar arquivo de configuração (ex: proxy.conf) em /etc/apache2/sites-available | |
| 5 | + | |
| 6 | +<VirtualHost *:80> | |
| 7 | + | |
| 8 | + ProxyPass / http://localhost:9292/ | |
| 9 | + | |
| 10 | + RequestHeader set Remote-User "terceiro" | |
| 11 | + | |
| 12 | + ErrorLog ${APACHE_LOG_DIR}/error.log | |
| 13 | + CustomLog ${APACHE_LOG_DIR}/access.log combined | |
| 14 | + | |
| 15 | +</VirtualHost> | |
| 16 | + | |
| 17 | +3 - Habilitar site criado (a2ensite <conf>) | |
| 18 | +4 - Habilitar módulos (proxy, proxy-http, headers) utilizando o comando a2enmod | |
| 19 | +5 - Startar apache2 (service apache2 start) | |
| 20 | + | |
| 21 | +Referência: | |
| 22 | +http://stackoverflow.com/questions/567814/apache2-reverse-proxy-to-an-end-point-that-requires-basicauth-but-want-to-hide-t | |
| 23 | + | |
| 24 | +Executando aplicação sinatra: | |
| 25 | + | |
| 26 | +1 - Entrar no diretório que contem o arquivo conf.ru | |
| 27 | +2 - Executar aplicação (rackup) | ... | ... |