Mudanças entre as edições de "Apache2"
Ir para navegação
Ir para pesquisar
| (3 revisões intermediárias pelo mesmo usuário não estão sendo mostradas) | |||
| Linha 53: | Linha 53: | ||
sudo nano /etc/apache2/sites-available/000-default.conf | sudo nano /etc/apache2/sites-available/000-default.conf | ||
| − | + | *Dspace | |
<VirtualHost *:80> | <VirtualHost *:80> | ||
ProxyPreserveHost On | ProxyPreserveHost On | ||
ProxyPass / http://127.0.0.1:8080/jspui | ProxyPass / http://127.0.0.1:8080/jspui | ||
ProxyPassReverse / http://127.0.0.1:8080/jspui | ProxyPassReverse / http://127.0.0.1:8080/jspui | ||
| + | </VirtualHost> | ||
| + | *Dataverse | ||
| + | <VirtualHost *:80> | ||
| + | ProxyPreserveHost On | ||
| + | ProxyPass / http://127.0.0.1:8080/ | ||
| + | ProxyPassReverse / http://127.0.0.1:8080/ | ||
</VirtualHost> | </VirtualHost> | ||
| Linha 131: | Linha 137: | ||
ServerName vitrinedadosabertos.rnp.br | ServerName vitrinedadosabertos.rnp.br | ||
ServerAdmin renefgj@gmail.com | ServerAdmin renefgj@gmail.com | ||
| − | |||
| − | |||
DocumentRoot "/var/www/html/" | DocumentRoot "/var/www/html/" | ||
| − | |||
ProxyPass /s1 ! | ProxyPass /s1 ! | ||
ProxyPass /dataview ! | ProxyPass /dataview ! | ||
ProxyPass /dvn ! | ProxyPass /dvn ! | ||
ProxyPass /Shibboleth.sso ! | ProxyPass /Shibboleth.sso ! | ||
| − | |||
| − | |||
| − | |||
Alias "/s1/" "/var/www/html/s2" | Alias "/s1/" "/var/www/html/s2" | ||
Alias "/dataview/" "/var/www/DataView/public/" | Alias "/dataview/" "/var/www/DataView/public/" | ||
Alias "/dvn/" "/var/www/dataverse/branding/" | Alias "/dvn/" "/var/www/dataverse/branding/" | ||
| − | |||
<Directory "/var/www/DataView/public/"> | <Directory "/var/www/DataView/public/"> | ||
Options Indexes FollowSymLinks MultiViews | Options Indexes FollowSymLinks MultiViews | ||
| Linha 153: | Linha 152: | ||
Require all granted | Require all granted | ||
</Directory> | </Directory> | ||
| − | |||
<Directory "/var/www/dataverse/branding/"> | <Directory "/var/www/dataverse/branding/"> | ||
Options Indexes FollowSymLinks MultiViews | Options Indexes FollowSymLinks MultiViews | ||
| Linha 161: | Linha 159: | ||
Require all granted | Require all granted | ||
</Directory> | </Directory> | ||
| − | |||
| − | |||
SSLCertificateFile /etc/letsencrypt/live/vitrinedadosabertos-dev.rnp.br/fullchain.pem | SSLCertificateFile /etc/letsencrypt/live/vitrinedadosabertos-dev.rnp.br/fullchain.pem | ||
SSLCertificateKeyFile /etc/letsencrypt/live/vitrinedadosabertos-dev.rnp.br/privkey.pem | SSLCertificateKeyFile /etc/letsencrypt/live/vitrinedadosabertos-dev.rnp.br/privkey.pem | ||
Include /etc/letsencrypt/options-ssl-apache.conf | Include /etc/letsencrypt/options-ssl-apache.conf | ||
| − | + | ||
# don't pass paths used by Shibboleth to Payara | # don't pass paths used by Shibboleth to Payara | ||
ProxyPassMatch ^/Shibboleth.sso ! | ProxyPassMatch ^/Shibboleth.sso ! | ||
| Linha 172: | Linha 168: | ||
# pass everything else to Payara | # pass everything else to Payara | ||
ProxyPass / ajp://localhost:8009/ | ProxyPass / ajp://localhost:8009/ | ||
| − | |||
<Location /shib.xhtml> | <Location /shib.xhtml> | ||
AuthType shibboleth | AuthType shibboleth | ||
| Linha 180: | Linha 175: | ||
</VirtualHost> | </VirtualHost> | ||
</IfModule> | </IfModule> | ||
| + | |||
| + | == Apache2 Python == | ||
| + | === Install module wsgi === | ||
| + | sudo apt-get update | ||
| + | sudo apt-get install apache2 libapache2-mod-wsgi-py3 | ||
| + | === Instalar o Flask === | ||
| + | pip install flask | ||
Edição atual tal como às 01h34min de 27 de agosto de 2024
Índice
- 1 Instalando o APACHE2
- 1.1 Ubuntu
- 1.2 Debian
- 1.3 Verificar as configurações
- 1.4 Habilitando os MODs do proxy
- 1.5 Configurando Site em Outras portas
- 1.6 Configurações para o WAMP
- 1.7 Configurando Site para redirecionamento - PROXY
- 1.8 Redirecionando para outro servidor
- 1.9 Criando uma Alias para sub-site
- 1.10 REDIRECIONAMENTO - DSPACE
- 2 Multi site
Instalando o APACHE2
Ubuntu
apt-get install apache2
Debian
apt install apache2
Verificar as configurações
apache2 -t
or
httpd -t
Para saber as portas liberadas consulte Linux:Netstat
Habilitando os MODs do proxy
sudo a2enmod ssl sudo a2enmod proxy sudo a2enmod proxy_http sudo a2enmod proxy_balancer sudo a2enmod lbmethod_byrequests
Configurando Site em Outras portas
<VirtualHost *:81>
ServerAdmin renefgj@gmail.com
ServerName pocdadosabertos.inep.rnp.br
ServerAlias 20.197.236.31
DocumentRoot /data/html/Brapci3.0/public/
<Directory "/data/html/Brapci3.0/public/">
Require all granted
</Directory>
</VirtualHost>
Configurações para o WAMP
No arquivo httpd-vhosts.conf inclua
# <VirtualHost *:80> ServerName guide DocumentRoot d:/www/guide/public <Directory "d:/www/guide/public/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost>
Para liberar a port para resposta do Apache, altere o arquivo port.conf
nano /etc/apache2/ports.conf
Inclua a linha:
Listen 127.0.0.1:81
Configurando Site para redirecionamento - PROXY
sudo nano /etc/apache2/sites-available/000-default.conf
- Dspace
<VirtualHost *:80> ProxyPreserveHost On ProxyPass / http://127.0.0.1:8080/jspui ProxyPassReverse / http://127.0.0.1:8080/jspui </VirtualHost>
- Dataverse
<VirtualHost *:80> ProxyPreserveHost On ProxyPass / http://127.0.0.1:8080/ ProxyPassReverse / http://127.0.0.1:8080/ </VirtualHost>
Redirecionando para outro servidor
<VirtualHost *:80>
ServerName cip.brapci.inf.br
ServerAlias 143.54.112.86
ServerAdmin renefgj@gmail.com
ProxyRequests Off
<Proxy *>
Order Allow,Deny
Allow from all
</Proxy>
ProxyPass / http://143.54.112.86:80
ProxyPassReverse / http://143.54.112.86:80
</VirtualHost>
Criando uma Alias para sub-site
ProxyPass /eventos !
Alias /eventos /data/html/Brapci3.0/public/
<Directory /data/html/Brapci3.0/public/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
sudo nano /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80> ProxyPreserveHost On ProxyPass / http://127.0.0.1:8080/jspui ProxyPassReverse / http://127.0.0.1:8080/jspui </VirtualHost>
<Location /thesa>
ProxyPass http://143.54.112.86:82/
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
</Location>
Habilitar as regras do Apache2
a2dissite 000-default a2ensite dspace
REDIRECIONAMENTO - DSPACE
/etc/apache2/000-default.conf
<VirtualHost *:80>
ServerName repositorio.rnp.br
ServerAdmin dadosdepesquisa@rnp.br
Redirect / https://repositorio.rnp.br
</VirtualHost>
<VirtualHost *:443>
Options Indexes FollowSymLinks MultiViews
ServerAdmin renefgj@gmail.com
ServerName dadosdepesquisa.rnp.br
ServerAlias www.dadosdepesquisa.rnp.br
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLEngine on
SSLCertificateFile /etc/ssl/private/repositorio.rnp.br.crt
SSLCertificateKeyFile /etc/ssl/private/repositorio.rnp.br.key
</VirtualHost>
Multi site
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName vitrinedadosabertos.rnp.br
ServerAdmin renefgj@gmail.com
DocumentRoot "/var/www/html/"
ProxyPass /s1 !
ProxyPass /dataview !
ProxyPass /dvn !
ProxyPass /Shibboleth.sso !
Alias "/s1/" "/var/www/html/s2"
Alias "/dataview/" "/var/www/DataView/public/"
Alias "/dvn/" "/var/www/dataverse/branding/"
<Directory "/var/www/DataView/public/">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
Require all granted
</Directory>
<Directory "/var/www/dataverse/branding/">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
Require all granted
</Directory>
SSLCertificateFile /etc/letsencrypt/live/vitrinedadosabertos-dev.rnp.br/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/vitrinedadosabertos-dev.rnp.br/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
# don't pass paths used by Shibboleth to Payara
ProxyPassMatch ^/Shibboleth.sso !
ProxyPassMatch ^/shibboleth-ds !
# pass everything else to Payara
ProxyPass / ajp://localhost:8009/
<Location /shib.xhtml>
AuthType shibboleth
ShibRequestSetting requireSession 1
require valid-user
</Location>
</VirtualHost>
</IfModule>
Apache2 Python
Install module wsgi
sudo apt-get update sudo apt-get install apache2 libapache2-mod-wsgi-py3
Instalar o Flask
pip install flask