Wie leite ich einen Port um und verwende eine Subdomäne?

Wie leite ich einen Port um und verwende eine Subdomäne?

Ich weiß, dass mein Problem bereits beschrieben wurde (sieheWie leite ich Subdomains auf einen anderen Port auf demselben Server um?zum Beispiel), aber da ich es auf meiner Seite nicht zum Laufen bekomme, bitte ich noch einmal um etwas Hilfe.

Ich habe einen Apache-Server am Laufen. Über Subdomains kann ich auf alle verschiedenen Web-Programme zugreifen, die auf diesem Server laufen.
Beispiel:
https://nextcloud.my_domain.fr
https://roundcube.my_domain.fr
...

Auf der Seite meines ISP-Anbieters habe ich Folgendes:

nextcloud   A   10800   xx.xx.xx.xx
subsonic    A   10800   xx.xx.xx.xx

Ich habe „alle“ Software gesagt, aber das stimmt nicht. Ich kann das nicht für Subdomains tun, die ich auf bestimmte Ports umleiten möchte. Subsonic benötigt beispielsweise Port 4040. Ich kann auf Subsonic zugreifen mit:
https://my_domain.fr/subsonic
, aber nicht mit:
https://subsonic.my_domain.fr

Ich kann den Port 4040 im Feld entfernen, das ist besser als nichts, aber ich will mehr :)

Ich habe das gleiche Problem mit dem Dateibrowser (Port 8082), Guacamole (Port 8080), …

Um den Port im Adressfeld zu entfernen, habe ich folgende Konfigurationsdateien im Verzeichnis /etc/httpd/conf/sites.d:

Datei 00_default_vhosts.conf:

<VirtualHost *:80>
   ServerName my_domain.fr
   ServerAdmin xuo@my_domain.fr
   RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>

RewriteEngine On

Datei 00_default_ssl_vhost.conf

<VirtualHost *:443>
    # general configuration
    ServerAdmin xuo@my_domain.fr
    ServerName my_domain.fr

    # SSL configuration
    SSLEngine on
    SSLCertificateFile /etc/certificates/server.crt
    SSLCertificateKeyFile /etc/certificates/server.pem
    SSLProtocol             all -SSLv2 -SSLv3
    SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
    SSLHonorCipherOrder     on
    AllowEncodedSlashes NoDecode

    CustomLog logs/ssl_request_log \
    "%V %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    <IfModule mod_headers.c>
    Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
    </IfModule>

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^([^\.]+)\.my_domain\.fr
    RewriteCond /var/www/html/%1 -l
    RewriteRule ^(.*) /%1/$1 [L]

</VirtualHost>

Datei guacamole.conf:

<IfModule mod_proxy_http.c>
    <Location /guacamole/>
    Order allow,deny
    Allow from all
    ProxyPass http://192.168.0.14:8080/guacamole/ flushpackets=on
    ProxyPassReverse http://192.168.0.14:8080/guacamole/
    </Location>

    <Location /guacamole/websocket-tunnel>
    Order allow,deny
    Allow from all
    ProxyPass ws://192.168.0.14:8080/guacamole/websocket-tunnel
    ProxyPassReverse ws://192.168.0.14:8080/guacamole/websocket-tunnel
    </Location>
</IfModule>

Datei subsonic.conf:

<IfModule mod_proxy_http.c>
    SSLProxyEngine on
    ProxyRequests Off
    ProxyPreserveHost On
    RequestHeader unset Accept-Encoding
    <Proxy http://192.168.0.14:4040/subsonic/>
    Order allow,deny
    Allow from all
    </Proxy>
    ProxyPass /subsonic/ http://192.168.0.14:4040/subsonic/
    ProxyPassReverse /subsonic/ http://192.168.0.14:4040/subsonic/
</IfModule>

Datei nextcloud.conf (keine Portumleitung erforderlich):

Alias /nextcloud /var/www/html/nextcloud
<Directory /var/www/html/nextcloud>
    Options +FollowSymlinks
    AllowOverride All
</Directory>

Das "Beste", was ich erreichen konnte (und ich weiß nicht mehr wie), war, die Subsonic-Hauptseite sowohl auf https://subsonic.my_domain.frUNDhttps://meine_domain.fr

Weiß jemand, wie man die Subdomain- und Port-Umleitung zusammenarbeiten lässt? Beachten Sie, dass ich mehrere Subdomains habe, mein Ziel ist es also, nextcloud.my_domain.fr, subsonic.my_domain.fr, guacamole.my_domain.fr usw. verwenden zu können.

Grüße.

Hallo.

Antwort1

Tut mir leid, aber ich habe nicht gesehen, dass ich einige Antworten hatte. Ich werde mir „Wie kann ich Anfragen von meinem Webserver weiterleiten?“ ansehen.

Grüße.

Hallo.

verwandte Informationen