2. Apache hinter DSL-Router mittels Reverse-Proxy ...

Alles, was den Apache betrifft, kann hier besprochen werden.

2. Apache hinter DSL-Router mittels Reverse-Proxy ...

Postby asgard » 10. April 2006 10:19

hallo Forenmitglieder,


ich habe folgende Situation:

Wir besitzen zwei Rechner die mittels Switch und einem DSL-Router (FritzBox) mit dem Internet verbunden sind.
Im Intranet haben beide Rechner eine feste IP.
Die Fritzbox bezieht im Internet die dynamische IP.
Also eine dynamische Internet-IP für beide Rechner.

Auf beiden Rechnern ist ein Apache eingerichtet.
Ich habe mir bei DYNDNS einen Account eingerichtet und zwei Adressen für eine dynamische DNS eingerichtet.

Ich hatte mich gefragt, welcher Apache im Internet Vorrang hatt.
Es ist nur der eine Apache, der andere zusätzlich eingerichtete Apache auf dem anderen Rechner ist nur im Intranet ereichbar.

Wo steht fest welcher Rechner für Zugriffe von Außerhalb Vorrang hatt?


Ich möchte jetzt das jedem Apache eine DYNDNS zugeteilt wird.
Da der eine Apache vorrang für Zugriffe von Außerhalb hatt,
könnte man ja auf diesem einen Reverse-Proxy für den anderen Apache
einrichten.
Macht man das über einen Virtuellen Host?

Die Zeilen würden so aussehen:

Code: Select all

NameVirtualHost zweiterApache.dyndns.tv

<VirtualHost zweiterApache.dyndns.tv>
    ServerAdmin admin@localhost
    DocumentRoot /xampp/htdocs_thomas
    ServerName zweiterApache.dyndns.tv
    ErrorLog /var/apache2/logs/error_log
    CustomLog /var/apache2/logs/access_log common
    ProxyPass         /  http://192.168.178.2              <-- 2. Apache
    ProxyPassReverse  /  http://192.168.178.2              <-- 2. Apache
</VirtualHost> 




Bevor ich diese Zeilen teste wollte ich von euch erfahren ob das so machbar ist. Ich bedanke mich im Vorraus.
...
asgard
 
Posts: 14
Joined: 28. January 2004 19:02

Postby Wiedmann » 10. April 2006 10:49

Wo steht fest welcher Rechner für Zugriffe von Außerhalb Vorrang hatt?

Das legst du beim Einrichten des Port-Mappings in der FritzBox fest.

Macht man das über einen Virtuellen Host?

Yup.

Die Zeilen würden so aussehen:

Allerdings musst du trotzdem 2 VHOsts einrichten (Beispiele im Forum). der 1. ist dann dein lokaler Server und der 2. ist für den reverse Proxy (Die Cookies würd ich noch umleiten lassen...).
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby asgard » 10. April 2006 14:06

Danke Wiedmann,


Mit folgender httpd-vhost.conf :


Code: Select all

NameVirtualHost zweiterApache.dyndns.tv

<VirtualHost zweiterApache.dyndns.tv>
    ServerAdmin admin@localhost
    DocumentRoot /xampp/htdocs_thomas
    ServerName zweiterApache.dyndns.tv
    ServerAlias zweiterApache.dyndns.tv
    ErrorLog /var/apache2/logs/error_log
    CustomLog /var/apache2/logs/access_log common
    ProxyPass         /  http://192.168.178.2
    ProxyPassReverse  /  http://192.168.178.2
</VirtualHost>



NameVirtualHost *:80


<VirtualHost *:80>
    ServerName localhost:80
    DocumentRoot /xampp/htdocs
    <Directory "/xampp/htdocs">
        Order Allow,Deny
        Allow from all
    </Directory>       
</VirtualHost>




würden alle Zugriffe vom internet und intranet mit
dem Request: http://zweiterApache.dyndns.tv oder
http://www.zweiterApache.dyndns.tv zum 2. Apache
geleitet. Alle anderen Requests ":80" zum 1. Apache.

Braucht der zweite vhochst wirklich eine directory-sektion?
Wozu braucht der erste vhoscht ein DocumentRoot,
wobei der 2. Apache doch seine eigene hatt?

Wie leite ich die Cookies um?

ErrorLog und CostumLog werde ich auch noch anpassen.

Aber Danke, ich werde diese config erst mal testen.


[/code]
...
asgard
 
Posts: 14
Joined: 28. January 2004 19:02

Postby asgard » 10. April 2006 14:18

Hallo Wiedmann,


der apache lässt sich mit dieser konfiguration nicht starten.

Verträgt diese sich nicht mit der htdocs-directory-sektion ? :


Code: Select all
<Directory "/xampp/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks Includes ExecCGI

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>



oder liegt es daran das ich noch eine Redirect auf die IP 192.168.178.2
habe?

Code: Select all
Redirect permanent /t http://192.168.178.2
...
asgard
 
Posts: 14
Joined: 28. January 2004 19:02

Postby Wiedmann » 10. April 2006 14:53

der apache lässt sich mit dieser konfiguration nicht starten.

Sorry, hab mir das jetzt noch nciht angeschaut. Allerdings sagt dir ja der Apache ja genau was in stört (in welcher Zeile)...
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby asgard » 10. April 2006 15:04

hallo,


ich hab mal in die eireignisanzeige gegangen und dort stand :


The Apache service named reported the following error:
>>> Warning: DocumentRoot [H:/xampp/htdocs_thomas] does not exist



H:/xampp/htdocs_thomas existiert aber.

wäre dankbar für weitere hilfe
...
asgard
 
Posts: 14
Joined: 28. January 2004 19:02

Postby Wiedmann » 10. April 2006 15:25

Warning: DocumentRoot [H:/xampp/htdocs_thomas] does not exist

Was ist "H:" für ein Laufwerk?

BTW:
Das ist doch nur das Document_Root für den reverse Proxy VHost, oder? Da kannst auch einfach das Selbe nehmen wie für den normalen VHost. Du leitest dann ja eh die Location / komplett um.

Wie leite ich die Cookies um?

"ProxyPassReverseCookieDomain" und "ProxyPassReverseCookiePath".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby asgard » 10. April 2006 15:34

Das Laufwerk H: ist ein Lokaler Datenträger mit NTFS-Dateisystem.

Auf dem ist mein Apache installiert auf der der Reverse-Proxy eingerichtet werden soll. "H:\xampp\"
...
asgard
 
Posts: 14
Joined: 28. January 2004 19:02

Postby asgard » 10. April 2006 16:27

Ich habe jetzt folgende Konfiguration in der httpd-vhost.conf stehen :

Code: Select all
NameVirtualHost *:80


<VirtualHost *:80>
    ServerName localhost:80
    DocumentRoot /xampp/htdocs
    <Directory "/xampp/htdocs">
        Order Allow,Deny
        Allow from all
    </Directory>       
</VirtualHost>





NameVirtualHost zweiterApache.dyndns.tv

<VirtualHost zweiterApache.dyndns.tv>
    ServerAdmin admin@localhost
    DocumentRoot /xampp/htdocs
    ServerName zweiterApache.dyndns.tv
    ServerAlias zweiterApache.dyndns.tv
    ErrorLog logs/thomaslogs/error_log
    CustomLog logs/thomaslogs/access_log common
    ProxyPass         /  http://192.168.178.2
    ProxyPassReverse  /  http://192.168.178.2
    ProxyPassReverseCookieDomain  /  http://192.168.178.2
    ProxyPassReverseCookiePath / /xamp/cookies/thomas
</VirtualHost>




in der httpd.conf ist die Raute hinter:

Include conf/extra/httpd-vhosts.conf

entfernt.

Der Server lässt sich starten, wobei das starten jetzt länger dauert.

Trotz dem bekomme ich die startseite des 1. Apache zu sehen und nicht
die des 2. Apache wenn ich http://www.zweiterApache.dyndns.tv im browser aufrufe.

woran könnte das liegen?
...
asgard
 
Posts: 14
Joined: 28. January 2004 19:02

Postby asgard » 10. April 2006 16:41

Hir: http://httpd.apache.org/docs/2.2/de/mod ... #proxypass

steht folgendes:


This directive allows remote servers to be mapped into the space of the local server; the local server does not act as a proxy in the conventional sense, but appears to be a mirror of the remote server. path is the name of a local virtual path; url is a partial URL for the remote server and cannot include a query string.


"remote servers to be mapped into the space of the local server;..."

bedeutet das, das der 1. Apache auf diesem Weg garnicht den 2. Apache
von einer DYNDNS-Adresse mappen kann?
...
asgard
 
Posts: 14
Joined: 28. January 2004 19:02


Return to Apache

Who is online

Users browsing this forum: No registered users and 27 guests