Apache Document root auf anderen lokalen Webserver umleiten
Hallo Admins!
Ich habe derzeit zwei Debian Server Zuhause laufen. Auf dem einen (192.168.0.10) ist Apache2 als Webserver installiert, auf dem anderen (192.168.0.5) läuft eine Mailcow Instanz mit SOGo als E-Mail Server. Dessen Weboberfläche wird ebenfalls über Apache2 bereitgestellt.
Ich habe meine Fritz!Box so konfiguriert, dass HTTP und HTTPS Anfragen an den Webserver weitergeleitet werden. IMAP, POP3 und SMTP Anfragen werden an den E-Mail Server weitergeleitet.
Die Weboberfläche SOGo ist über den E-Mail Server Lokal unter http://192.168.0.5/SOGo/ erreichbar.
Auf dem Webserver habe ich verschiedene Virtual Hosts, unter anderem mail.domain.de, welche aus dem Internet erreichbar sind. Mein Plan ist nun, dass wenn ich auf mail.domain.de surfe, der Inhalt des Lokalen E-Mail Servers von http://192.168.0.5/SOGo/ angezeigt wird.
Ich habe bereits mit diversen ReverseProxy Einträgen in den Virtual Host *.conf Dateien rumgespielt, jedoch ohne Erfolg.
Wie stelle ich das an?
Beste Grüße,
Daniel
Ich habe derzeit zwei Debian Server Zuhause laufen. Auf dem einen (192.168.0.10) ist Apache2 als Webserver installiert, auf dem anderen (192.168.0.5) läuft eine Mailcow Instanz mit SOGo als E-Mail Server. Dessen Weboberfläche wird ebenfalls über Apache2 bereitgestellt.
Ich habe meine Fritz!Box so konfiguriert, dass HTTP und HTTPS Anfragen an den Webserver weitergeleitet werden. IMAP, POP3 und SMTP Anfragen werden an den E-Mail Server weitergeleitet.
Die Weboberfläche SOGo ist über den E-Mail Server Lokal unter http://192.168.0.5/SOGo/ erreichbar.
Auf dem Webserver habe ich verschiedene Virtual Hosts, unter anderem mail.domain.de, welche aus dem Internet erreichbar sind. Mein Plan ist nun, dass wenn ich auf mail.domain.de surfe, der Inhalt des Lokalen E-Mail Servers von http://192.168.0.5/SOGo/ angezeigt wird.
Ich habe bereits mit diversen ReverseProxy Einträgen in den Virtual Host *.conf Dateien rumgespielt, jedoch ohne Erfolg.
Wie stelle ich das an?
Beste Grüße,
Daniel
Bitte markiere auch die Kommentare, die zur Lösung des Beitrags beigetragen haben
Content-ID: 328886
Url: https://administrator.de/forum/apache-document-root-auf-anderen-lokalen-webserver-umleiten-328886.html
Ausgedruckt am: 02.02.2025 um 12:02 Uhr
4 Kommentare
Neuester Kommentar
Moin,
Variante 1 wäre, sofern möglich, den Port der SOGo von Port 80 auf z.B. 9980 zu ändern und diesen in der FritzBox freizugeben.
Variante 2 wäre u.U. mit iFrames auf dem 0.10er zu arbeiten. ich weiss aber nicht, ob das wirklich sauber funktioniert. Das schoß mir als erstes nur in den Kopf
Vermutlich gibt es auch noch Varianten >2, aber die fallen mir spontan nicht ein
Du solltest dir aber noch überlegen,ob du den Traffic des SOGos nicht irgendwie noch mit https aufgerufen bekommst, denn das macht das ganze etwas sicherer...
Gruß
em-pie
Variante 1 wäre, sofern möglich, den Port der SOGo von Port 80 auf z.B. 9980 zu ändern und diesen in der FritzBox freizugeben.
Variante 2 wäre u.U. mit iFrames auf dem 0.10er zu arbeiten. ich weiss aber nicht, ob das wirklich sauber funktioniert. Das schoß mir als erstes nur in den Kopf
Vermutlich gibt es auch noch Varianten >2, aber die fallen mir spontan nicht ein
Du solltest dir aber noch überlegen,ob du den Traffic des SOGos nicht irgendwie noch mit https aufgerufen bekommst, denn das macht das ganze etwas sicherer...
Gruß
em-pie
Moin,
Ich lese sogo und dachte mir nun einfach mal, ich teile dir meine ganze apache2 config für Sogo mal mit ;)
Ist so tatsächlich produktiv, wenn auch etwas unübersichtlich und gefrickelt:
`cat /path/to/config/myconf.conf | sed -e 's/mydomain/example/'`
Ich denke mal, das wird dir ziemlich weiterhelfen.
Für den Let's Encrypt/Certbot Setup empfehle ich: https://www.shivering-isles.com/lets-encrypt-renew-all-your-certs-using- ...
Im Artikel einfach den letsencrypt client durch certbot ersetzen.
Edit: Mir fällt gerade auf, ich sollte dringend mal meine configs neu formatieren :D
Gruß
Chris
Ich lese sogo und dachte mir nun einfach mal, ich teile dir meine ganze apache2 config für Sogo mal mit ;)
Ist so tatsächlich produktiv, wenn auch etwas unübersichtlich und gefrickelt:
`cat /path/to/config/myconf.conf | sed -e 's/mydomain/example/'`
<VirtualHost *:80>
ServerName mail.example.com
RewriteEngine On
RewriteRule ^/.* https://mail.example.com/SOGo
#Redirect permanent / https:{{comment_single_line_double_slash:0}}
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName mail.example.com
DocumentRoot /var/www/vsites/mail.example.com
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
RewriteEngine On
RewriteRule ^/$ https://mail.example.com/SOGo
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
# A self-signed (snakeoil) certificate can be created by installing
# the ssl-cert package. See
# /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
# If both key and certificate are stored in the same file, only the
# SSLCertificateFile directive is needed.
SSLCertificateFile /etc/letsencrypt/live/mail.example.com-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mail.example.com-0001/privkey.pem
Alias /SOGo.woa/WebServerResources/ \
/usr/lib/GNUstep/SOGo/WebServerResources/
Alias /SOGo/WebServerResources/ \
/usr/lib/GNUstep/SOGo/WebServerResources/
<Directory /usr/lib/GNUstep/SOGo/>
AllowOverride None
<IfVersion < 2.4>
Order deny,allow
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
# Explicitly allow caching of static content to avoid browser specific behavior.
# A resource's URL MUST change in order to have the client load the new version.
<IfModule expires_module>
ExpiresActive On
ExpiresDefault "access plus 1 year"
</IfModule>
</Directory>
## Uncomment the following to enable proxy-side authentication, you will then
## need to set the "SOGoTrustProxyAuthentication" SOGo user default to YES and
## adjust the "x-webobjects-remote-user" proxy header in the "Proxy" section
## below.
#
## For full proxy-side authentication:
#<Location /SOGo>
# AuthType XXX
# Require valid-user
# SetEnv proxy-nokeepalive 1
# Allow from all
#</Location>
#
## For proxy-side authentication only for CardDAV and GroupDAV from external
## clients:
#<Location /SOGo/dav>
# AuthType XXX
# Require valid-user
# SetEnv proxy-nokeepalive 1
# Allow from all
#</Location>
ProxyRequests Off
SetEnv proxy-nokeepalive 1
ProxyPreserveHost On
# When using CAS, you should uncomment this and install cas-proxy-validate.py
# in /usr/lib/cgi-bin to reduce server overloading
#
# ProxyPass /SOGo/casProxy http://localhost/cgi-bin/cas-proxy-validate.py
# <Proxy http://localhost/app/cas-proxy-validate.py>
# Order deny,allow
# Allow from your-cas-host-addr
# </Proxy>
ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0
# Enable to use Microsoft ActiveSync support
# Note that you MUST have many sogod workers to use ActiveSync.
# See the SOGo Installation and Configuration guide for more details.
#
ProxyPass /Microsoft-Server-ActiveSync \
http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync \
retry=60 connectiontimeout=5 timeout=360
<Proxy http://127.0.0.1:20000/SOGo>
## adjust the following to your configuration
RequestHeader set "x-webobjects-server-port" "443"
RequestHeader set "x-webobjects-server-name" "example.com"
RequestHeader set "x-webobjects-server-url" "https://mail.example.com"
## When using proxy-side autentication, you need to uncomment and
## adjust the following line:
RequestHeader unset "x-webobjects-remote-user"
# RequestHeader set "x-webobjects-remote-user" "%{REMOTE_USER}e" env=REMOTE_USER
RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
AddDefaultCharset UTF-8
Order allow,deny
Allow from all
</Proxy>
# For Apple autoconfiguration
<IfModule rewrite_module>
RewriteEngine On
RewriteRule ^/.well-known/caldav/?$ /SOGo/dav [R=301]
RewriteRule ^/.well-known/carddav/?$ /SOGo/dav [R=301]
</IfModule>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
</IfModule>
Ich denke mal, das wird dir ziemlich weiterhelfen.
Für den Let's Encrypt/Certbot Setup empfehle ich: https://www.shivering-isles.com/lets-encrypt-renew-all-your-certs-using- ...
Im Artikel einfach den letsencrypt client durch certbot ersetzen.
Edit: Mir fällt gerade auf, ich sollte dringend mal meine configs neu formatieren :D
Gruß
Chris