Benutzer-Werkzeuge

Webseiten-Werkzeuge


tachtler:apache_http_server_centos_7_-_mod_proxy_ajp_-_apache_tomcat_kommunikation

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
tachtler:apache_http_server_centos_7_-_mod_proxy_ajp_-_apache_tomcat_kommunikation [2015/05/11 11:06] klaustachtler:apache_http_server_centos_7_-_mod_proxy_ajp_-_apache_tomcat_kommunikation [2015/05/12 14:54] (aktuell) – [/etc/httpd/conf.d/vhost.conf] klaus
Zeile 13: Zeile 13:
  
 :!: **HINWEIS** - **Eine Installation des Moduls ''mod_proxy_ajp'' ist __nicht__ erforderlich, da es sich um ein Modul handelt, welches __standardmäßig__ bei der Installation des ''rpm''-Paktes - ''httpd'' mit installiert wird!** :!: **HINWEIS** - **Eine Installation des Moduls ''mod_proxy_ajp'' ist __nicht__ erforderlich, da es sich um ein Modul handelt, welches __standardmäßig__ bei der Installation des ''rpm''-Paktes - ''httpd'' mit installiert wird!**
 +
 +Ab hier werden ''root''-Rechte zur Ausführung der nachfolgenden Befehle benötigt. Um ''root'' zu werden geben Sie bitte folgenden Befehl ein:
 +<code>
 +$ su -
 +Password: 
 +</code>
 +
 +===== Konfiguration =====
 +
 +==== /etc/httpd/conf.modules.d/00-proxy.conf ====
 +
 +Die Konfigurationsdatei ''/etc/httpd/conf.modules.d/00-proxy.conf'' beinhaltet die **Proxy**-Module des [[http://httpd.apache.org|Apache HTTP Server]]. Falls nicht alle **Proxy-Module** zum Einsatz kommen sollen, können die entsprechenden Inhalte auskommentiert werden!
 +
 +:!: **HINWEIS** - Die nachfolgenden Anpassungen sind **__individuell__** und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!
 +
 +Die Anpassungen werden mit einem vorangestellten Kommentar in der Form
 +<code>
 +# Tachtler
 +</code>
 +gekennzeichnet.
 +
 +(**komplette Konfigurationsdatei**)
 +<code apache>
 +# Tachtler
 +# Only required moduls should be loaded.
 +# This file configures all the proxy modules:
 +LoadModule proxy_module modules/mod_proxy.so
 +# LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
 +# LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
 +# LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
 +# LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
 +LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
 +# LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
 +# LoadModule proxy_connect_module modules/mod_proxy_connect.so
 +# LoadModule proxy_express_module modules/mod_proxy_express.so
 +# LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
 +# LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
 +# LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
 +# LoadModule proxy_http_module modules/mod_proxy_http.so
 +# LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
 +</code>
 +
 +Nur die Module
 +  * ''proxy_module'' --> ''modules/mod_proxy.so''
 +  * ''proxy_ajp_module'' --> ''modules/mod_proxy_ajp.so''
 +sind für die Kommunikation zwischen [[http://httpd.apache.org|Apache HTTP Server]] und dem [[http://tomcat.apache.org|Apache Tomcat Server]] über das **AJP/1.3**-Protokoll notwendig!
 +
 +==== /etc/httpd/conf.d/vhost.conf ====
 +
 +Falls kein //virtueller Host// definiert ist, können folgende Konfigurationsangaben ebenfalls in der Datei ''/etc/httpd/conf/httpd.conf'' definiert werden.
 +
 +Nachfolgend ein Beispiel für einen **//virtuellen Host//**:
 +<code apache>
 +#
 +# tomcat.tachtler.net (Apache Tomcat Applications)
 +#
 +<VirtualHost *:80>
 +        ServerAdmin webmaster@tachtler.net
 +        ServerName tomcat.tachtler.net
 +        ServerAlias www.tomcat.tachtler.net
 +        ServerPath /
 +
 +        Alias /docs /usr/share/tomcat/webapps/docs
 +        Alias /host-manager /usr/share/tomcat/webapps/host-manager
 +        Alias /manager /usr/share/tomcat/webapps/manager
 + Alias /standard /usr/share/tomcat/webapps/standard
 +
 +        DocumentRoot "/usr/share/tomcat/webapps/ROOT"
 +        <Directory "/usr/share/tomcat/webapps/ROOT">
 +                Options -Indexes +FollowSymLinks
 +                # Tachtler (enable for .htaccess file support)
 +                # AllowOverride AuthConfig
 +                AllowOverride None
 +                # Tachtler (enable for unlimited access)
 +                Require all granted
 +        </Directory>
 +
 +        # Protect META-INF-Directory
 +        <Directory "/var/lib/tomcat/webapps/ROOT/META-INF">
 +                AllowOverride None
 +                Require all denied
 +        </Directory>
 +
 +        # Protect WEB-INF-Directory
 +        <Directory "/var/lib/tomcat/webapps/ROOT/WEB-INF">
 +                AllowOverride None
 +                Require all denied
 +        </Directory>
 +
 +        ProxyRequests Off
 +
 +        ProxyPass /docs ajp://127.0.0.1:8099/docs
 +        ProxyPassReverse /docs ajp://127.0.0.1:8089/docs
 +        ProxyPass /host-manager ajp://127.0.0.1:8099/host-manager
 +        ProxyPassReverse /host-manager ajp://127.0.0.1:8099/host-manager
 +        ProxyPass /manager ajp://127.0.0.1:8099/manager
 +        ProxyPassReverse /manager ajp://127.0.0.1:8099/manager
 +        ProxyPass / ajp://127.0.0.1:8099/
 +        ProxyPassReverse / ajp://127.0.0.1:8099/
 +        ProxyPass /standard ajp://127.0.0.1:8099/standard
 +        ProxyPassReverse /standard ajp://127.0.0.1:8099/standard
 +
 +        DirectoryIndex index.htm index.jsp
 +
 +        ErrorLog logs/tomcat_error.log
 +        SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
 +        CustomLog logs/tomcat_access.log combined env=!forwarded
 +        CustomLog logs/tomcat_access.log combined_proxypass env=forwarded
 +</VirtualHost>
 +</code>
 +* //Dies ist nur eine Beispielkonfiguration.//
 +
 +Die Bedeutung der einzelnen Befehle kann in der Dokumentation [[http://httpd.apache.org/docs/2.4/mod/mod_proxy.html|Apache Module mod_proxy]] detailliert nachgelesen werden.
 +
 +<code apache>
 +ProxyRequests Off
 +</code>
 +Ermöglicht oder Deaktiviert **Standard**-Forward-Proxy Anfragen. Da hier **__eine__** typische Weiterleitung von Anfragen an eine nach gelagertes //Back-End-System// vorliegt, sollte hier die Funktionalität ausgeschaltet werden. 
 +
 +<code apache>
 +ProxyPass <URL> ajp://<Back-End-System>:<Port>
 +</code>
 +Ermöglicht das Zuordnen von URL auf Back-End-Systemen in die Zuständigkeit von Frontend-Systemen. Das Frontend-System agiert hier __nicht__ direkt als konventioneller Proxy oder konventionelles Gateway, sondern ist eher als vorgelagertes System des eigentlichen Servers mit den tatsächlichen Inhalten zu sehen.
 +
 +<code apache>
 +ProxyPassReverse <URL> ajp://<Back-End-System>:<Port>
 +</code>
 +Stellt sicher das auch die Antwort des Back-End-Systems, wie die des Frontend-Systems entsprechend im Header aussieht.
  
tachtler/apache_http_server_centos_7_-_mod_proxy_ajp_-_apache_tomcat_kommunikation.1431335180.txt.gz · Zuletzt geändert: 2015/05/11 11:06 von klaus