Apache Reverse Proxy da usare con Tomcat

Un po' di documentazione la trovate qui:

http://www.apacheweek.com/features/reverseproxies
http://httpd.apache.org/docs/2.0/mod/mod_proxy.html
http://www.tldp.org/HOWTO/MMBase-Inst-HOWTO/x968.html
http://cwiki.apache.org/GMOxDOC12/configure-apache-httpd-as-a-reverse-proxy-modproxy.html

Ecco un esempio di configurazione di un server Apache in modalità Reverse Proxy, con diversi Virtual Host (basati su nome DNS), per poter pubblicare diversi siti web con un'unico IP Pubblico.

Questo è un file httpd.conf di base della versione Apache 2.0.58 per Windows, con le opzioni necessarie allo scopo attivate/configurate:

Aggiornamento:

Ho preparato un file aggiornato semplificato:


<IfModule mod_proxy.c>

 #<Proxy *>
 # Order deny,allow
 # Allow from all
 #</Proxy>

     ProxyPreserveHost On
     #ProxyRequests Off # Gia Impostato da proxy.config in debian

    <Location /webappname>
       AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

       # Manutenzione
       #ProxyPass http://localhost/manutenzione
       #ProxyPassReverse http://localhost/manutenzione

       ProxyPass http://localhost:8080/webappname
       ProxyPassReverse http://localhost:8080/webappname
       Order deny,allow
       Allow from all
       
        <IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 days"
  ExpiresByType text/html "access plus 5 seconds"
  ExpiresByType application/pdf "access plus 1 seconds"
        </IfModule>
    </Location>

</IfModule>



Potete utilizzarlo con queste istruzioni

# abilitazione modulo reverse proxy
sudo a2enmod proxy_http

# abilitazione modulo compressione
sudo a2enmod deflate

# Inserite il testo della configurazione reverse proxy in un file specifico
sudo nano /etc/apache2/conf.d/reverse_proxy

# riavvio del servizio apache
sudo service apache2 restart


Commenti

Anonimo ha detto…
In farmacia vendono preparati che possono giovare alla sindrome da post abnorme (abomynous post syndrome), tipicamente a base di calendula o camomilla. La guarigione è oggettivamente risontrabile quando il soggetto rinvia a link opportuno. ;-) Cesco.

Post popolari in questo blog

Dirette video su Youtube con Raspberry PI

Eclipse underscore not visible

Batch Convert CSV to XLSX with LibreOffice (OpenOffice)