Apache2 mod_proxy

T

tiptel170

Tripel-As
Hallo Gemeinde,

ich raff es einfach nicht. Ich habe mir den Apache2-Server als Proxy eingerichtet, damit ich mir hinter meiner Firewall über das Internet meinen Sat-Receiver verwalten kann. Allerdings bekomme ich im Webbrowser den Fehler 404 zurück, mit dem Erfolg, dass mir die Adresse im Webbrowser für den Receiver umgeschrieben wird.

Irgend was mache ich da falsch?

Hier die hhtpd.conf
Code:
LoadModule proxy_module /usr/lib/apache2/mod_proxy.so

<IfModule mod_proxy.c>
    ProxyRequests Off
    ProxyVia On
    ProxyPass /2100/ http://2100.casa.red/general/status.html
    ProxyPassReverse /2100/ http://2100.casa.red/general/status.html

</IfModule>

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

<VirtualHost *>
       ServerAdmin system@mail.casa.red
       ServerName 2100.casa.red
       SetOutputFilter proxy-html
       ProxyHTMLLogVerbose On
       ProxyHTMLExtended On
       ProxyPass /dwl2100ap http://2100.casa.red/
       ProxyHTMLURLMap http://2100.casa.red /2100

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

       <Location /2100.casa.red/>
             ProxyPassReverse /
             ProxyHTMLURLMap / /2100/
             ProxyHTMLURLMap /2100 /2100
             RequestHeader    unset  Accept-Encoding
      </Location>

Im Webbrowser erscheint der Fehler 404

In der error_log
Code:
[Tue Sep 10 13:32:29 2013] [error] [client 3x.xx.xx.xx1] File does not exist: /srv/www/htdocs/jsMain.js, referer: http://mxxxxx.de/2100

Vielleicht jemand eine Idee? Ich habe bis jetzt einige Stunden im Netz gesucht und diverse HowTos durchgelesen.

Gruß tiptel170
 
Hmm

Ich vermute dein Apache will HTML Code ausführen welchen es unter seinem htdcos nicht gibt sonder wahrscheinlich nur auf dem Sat-Teil....
Du benötigst eigentlich nur einen Reverse Proxy mit "ProxyPass" und "ProxyPassReverse". Den Proxy und Virtual Host Container kannst du eigentlich raus werfen.
 
Danke für deinen Tipp. Ich habe es nach diesem Link eingerichtet: http://www.apachetutor.org/admin/reverseproxies

Jetzt sieht die Konfiguration so aus:
Code:
Include /etc/apache2/mod_proxy_html.conf

LoadModule xml2enc_module /usr/lib/apache2/mod_xml2enc.so
LoadModule headers_module /usr/lib/apache2/mod_headers.so
LoadModule proxy_module /usr/lib/apache2/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/mod_proxy_http.so
LoadModule proxy_html_module /usr/lib/apache2/mod_proxy_html.so

ProxyPass /dwl2100ap http://dwl2100ap.casa.red/
ProxyHTMLURLMap http://2100.casa.red/ /2100

<Location /2100/>
        ProxyPassReverse /
        ProxyHTMLEnable On
        ProxyHTMLURLMap  /      /2100/
        RequestHeader    unset  Accept-Encoding
</Location>

Ich werde auch weitergeleitet auf die Seite des Gerätes, aber bekomme immernoch den 404 Fehler zurück.
 
Ich würde die Konfig noch weiter entschlacken.

Code:
Include /etc/apache2/mod_proxy_html.conf

LoadModule xml2enc_module /usr/lib/apache2/mod_xml2enc.so
LoadModule headers_module /usr/lib/apache2/mod_headers.so
LoadModule proxy_module /usr/lib/apache2/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/mod_proxy_http.so
LoadModule proxy_html_module /usr/lib/apache2/mod_proxy_html.so

ProxyPass /dwl2100ap http://dwl2100ap.casa.red/
ProxyPassReverse /dwl2100ap http://dwl2100ap.casa.red/
 
Danke für deinen Tipp. Hat leider nicht funktioniert. Jetzt habe ich was gefunden, komischer weise kann ich damit die Seite aufrufen. Aber die ist unvollständig und die Bilder fehlen.

Code:
LoadModule xml2enc_module /usr/lib/apache2/mod_xml2enc.so
LoadModule headers_module /usr/lib/apache2/mod_headers.so
LoadModule proxy_module /usr/lib/apache2/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/mod_proxy_http.so
LoadModule proxy_html_module /usr/lib/apache2/mod_proxy_html.so
LoadModule proxy_ajp_module /usr/lib/apache2/mod_proxy_ajp.so
LoadModule proxy_connect_module /usr/lib/apache2/mod_proxy_connect.so

<IfModule mod_proxy.c>
    <Proxy /dwl2100ap>
Order deny,allow
Allow from all
    </Proxy>

ProxyPass /2100 http://2100.casa.red/
ProxyPassReverse /2100 http://2100.casa.red/
ProxyPass /cgi-bin http://2100.casa.red/cgi-bin/
ProxyPassReverse /cgi-bin http://2100.casa.red/cgi-bin
ProxyPass /html http://2100.casa.red/html
ProxyPassReverse /html http://2100.casa.red/html
</IfModule>

Wenn ich dann auf eine beliebige Schaltfläche von der Weboberfläche klicke, dann erhalte ich folgenden Fehler:

Code:
File does not exist: /srv/www/htdocs/2100/Images, referer: http://192.168.0.6/html/HomeWizard.html


Jetzt weiß ich wirklich nicht mehr weiter ... :-(
 
Wenn ich es recht sehe sind doch alle Module geladen worden, beim Aufruf von:

Code:
Gateway:/etc/apache2 # apache2ctl -t -D DUMP_MODULES
[Thu Sep 12 23:58:13 2013] [warn] module ldap_module is already loaded, skipping
[Thu Sep 12 23:58:13 2013] [warn] module log_config_module is already loaded, skipping
Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 authz_host_module (shared)
 actions_module (shared)
 alias_module (shared)
 asis_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 dir_module (shared)
 include_module (shared)
 log_config_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 setenvif_module (shared)
 status_module (shared)
 userdir_module (shared)
 ssl_module (shared)
 dav_module (shared)
 dav_fs_module (shared)
 dav_lock_module (shared)
 ldap_module (shared)
 authnz_ldap_module (shared)
 rewrite_module (shared)
 auth_basic_module (shared)
 php5_module (shared)
 auth_digest_module (shared)
 wsgi_module (shared)
 headers_module (shared)
 proxy_module (shared)
 proxy_http_module (shared)
 proxy_html_module (shared)
 proxy_connect_module (shared)
 proxy_ftp_module (shared)
 proxy_ajp_module (shared)
 proxy_balancer_module (shared)
 info_module (shared)
 mono_module (shared)
 xml2enc_module (shared)
Syntax OK

Oder wie kann ich den die error_log von apache2 noch "gesprächiger" machen? Damit ich sehe woran es liegt. Denn mit dem oben angegebenen Fehler kann ich damit nicht viel anfangen. Denn es sollte laut der Dokumentationen den Inhalt von den Webseiten Umschreiben.

Gruß tiptel170
 
Danke für den Link, es funktioniert immer noch nicht. Ich habe jetzt verschiedene Geräte "hinterlegt". Aber bei jedem immer das gleiche Ergebnis.

Hier ist die httpd.conf:

Code:
LoadFile /usr/lib/libxml2.so.2

#Include /etc/apache2/mod_proxy_html.conf

LoadModule xml2enc_module /usr/lib/apache2/mod_xml2enc.so

<IfModule mod_proxy.c>
       ProxyRequests Off
       ProxyVia On
</IfModule>

<VirtualHost *>
       ServerAdmin system@mail.casa.red
       ServerName mXXXX.XX
       DocumentRoot /srv/www/htdocs/2100
       SetOutputFilter proxy-html
       ProxyHTMLLogVerbose On
       ProxyHTMLExtended On
       ProxyPass /2100 http://2100.casa.red/
       ProxyHTMLURLMap http://2100.casa.red /2100
           <Location /2100/>
              ProxyPassReverse /
              ProxyHTMLURLMap / /2100/
              ProxyHTMLURLMap /2100 /2100
              RequestHeader    unset  Accept-Encoding
           </Location>
       ProxyPass /laserjet3055 http://laserjet3055.casa.red/
       ProxyHTMLURLMap http://laserjet3055.casa.red /laserjet3055
           <Location /laserjet3055/>
              ProxyPassReverse /
              ProxyHTMLURLMap / /laserjet3055/
              ProxyHTMLURLMap /laserjet3055 /laserjet3055
              RequestHeader    unset  Accept-Encoding
           </Location>
       ProxyPass /mfcj6510 http://mfcj6510.casa.red/
       ProxyHTMLURLMap http://mfcj6510.casa.red /mfcj6510
           <Location /mfcj6510/>
              ProxyPassReverse /
              ProxyHTMLURLMap / /mfcj6510/
              ProxyHTMLURLMap /mfcj6510 /mfcj6510
              RequestHeader    unset  Accept-Encoding
           </Location>
       ProxyPass /agfeo http://server.casa.red:5080/
       ProxyHTMLURLMap http://server.casa.red:5080 /agfeo
           <Location /agfeo/>
              ProxyPassReverse /
              ProxyHTMLURLMap / /agfeo/
              ProxyHTMLURLMap /agfeo /agfeo
              RequestHeader    unset  Accept-Encoding
           </Location>
       ProxyPass /webmin http://server.casa.red:12178/
       ProxyHTMLURLMap http://server.casa.red:12178 /webmin
           <Location /webmin/>
              ProxyPassReverse /
              ProxyHTMLURLMap / /webmin/
              ProxyHTMLURLMap /webmin /webmin
              RequestHeader    unset  Accept-Encoding
           </Location>
       ProxyPass /lancom http://lancom.casa.red/
       ProxyHTMLURLMap http://lancom.casa.red:5080 /lancom
           <Location /lancom/>
              ProxyPassReverse /
              ProxyHTMLURLMap / /lancom/
              ProxyHTMLURLMap /lancom /lancom
              RequestHeader    unset  Accept-Encoding
           </Location>
</VirtualHost>

Hier nochmals der Auszug von der error_log:
Code:
[Fri Sep 13 10:55:11 2013] [error] [client 192.168.0.12] File does not exist: /srv/www/htdocs/2100/images, referer: http://gateway.casa.red/lancom

Gruß tiptel170
 
Dann liegt's wohl daran, dass die SAT Anwendung mit absoluten statt relativen Links arbeitet.

Ich sehe da 2 Möglichkeiten:
1. Anwendung umschreiben

2. Für jeden Link eine entsprechende proxypass / proxypassreverse Direktive
 

Ähnliche Themen

Nginx als Reverse Proxy für Nextcloud und Emby

Probleme mit virtual hosts

Aura for PHP Konfigurationsproblem

Proxyweiterleitung in Apache (Webmin)

Samba 4 Gast Zugang unter Ubuntu funktioniert nicht

Zurück
Oben