Apache2 Virtualhost

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

Apache2 Virtualhost

Postby Mexiim » 19. September 2019 10:24

Hallo, ich bin (leider) noch sehr frisch im Thema.
Vorab:
Ich habe einen Raspberry auf dem Nextcloud (cloud.domain.de) läuft und ich möchte jetzt Collabora mit einbinden.
Nextcloud ist ohne Probleme zu erreichen.
Dazu muss für Collabora ein eigener Dokumentenserver laufen mit eigener Domain (office.domain.de).

Dazu habe ich eine office.conf angelegt:
Code: Select all
<IfModule mod_ssl.c>
  <VirtualHost _default_:443>
    DocumentRoot /var/www/test
ServerName office.domain.de
    CustomLog /var/log/apache2/office-access.log combined
    ErrorLog  /var/log/apache2/office-error.log
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/office.domain.de/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/office.domain.de/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
  </VirtualHost>
  <Directory /var/www/test/>
    Options +FollowSymlinks
    AllowOverride All
    <IfModule mod_dav.c>
      Dav off
    </IfModule>
    LimitRequestBody 0
    SSLRenegBufferSize 10486000
  </Directory>
</IfModule>


Der Apache erkennt, dass er mit der office.domain.de angesprochen wird (other_vhosts_access.log)
Ich lande aber immer auf der Default-Seite vom Apache.
Habt ihr da einen Tip für mich? Habe ich was vergessen?
Mexiim
 
Posts: 5
Joined: 19. September 2019 10:03
XAMPP version: 7.1.32
Operating System: Debian

Re: Apache2 Virtualhost

Postby Mexiim » 19. September 2019 13:03

Auch wenn ich eine Standard condig für den vhost nehme, lande ich immer wieder auf der Default Seite.
Ich bin so langsam echt am verzweifeln.
Code: Select all
<VirtualHost *:80>
ServerName office.domain.de
ServerAlias office.domain.de *.office.domain.de
DocumentRoot /etc/www/test
</VirtualHost>
Mexiim
 
Posts: 5
Joined: 19. September 2019 10:03
XAMPP version: 7.1.32
Operating System: Debian

Re: Apache2 Virtualhost

Postby Nobbie » 20. September 2019 11:39

Wird denn office.conf überhaupt herangezogen? Vielleicht bekommt Apache ja gar nicht die Konfiguration mit.

Die Option "-S" auf der Kommandozeile für Apache (httpd) gibt eine Analyse aus, welche VirtuellenHosts Apache findet:

Code: Select all
httpd -S


Evtl. muss httpd mit ganzem Pfad angegeben werden (hängt von Deiner Shell Konfiguration ab), ich weiß aber nicht, wo der bei Raspian liegt. Ggf. /usr/bin/httpd oder vielleicht auch /usr/sbin/httpd oder so.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Apache2 Virtualhost

Postby Mexiim » 20. September 2019 17:48

Code: Select all
VirtualHost configuration:
*:80                   localhost (/etc/apache2/sites-enabled/000-default.conf:1)
*:4443                 localhost (/etc/apache2/sites-enabled/ncp.conf:2)
*:443                  is a NameVirtualHost
         default server cloud.distra.band (/etc/apache2/sites-enabled/nextcloud.conf:2)
         port 443 namevhost cloud.distra.band (/etc/apache2/sites-enabled/nextcloud.conf:2)
         port 443 namevhost office.distra.band (/etc/apache2/sites-enabled/office-le-ssl.conf:2)
         port 443 namevhost office.distra.band (/etc/apache2/sites-enabled/office.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33


Das sieht soweit gut aus.
Mexiim
 
Posts: 5
Joined: 19. September 2019 10:03
XAMPP version: 7.1.32
Operating System: Debian

Re: Apache2 Virtualhost

Postby Mexiim » 20. September 2019 17:59

Anbei noch die office.conf
Code: Select all
<VirtualHost *:443>
   ServerAdmin webmaster@example.org
   ServerName office.example.org

   # Encoded slashes need to be allowed
   AllowEncodedSlashes NoDecode

   # Container uses a unique non-signed certificate
   SSLProxyEngine On
   SSLProxyVerify None
   SSLProxyCheckPeerCN Off
   SSLProxyCheckPeerName Off

   # keep the host
   ProxyPreserveHost On

   # static html, js, images, etc. served from loolwsd
   # loleaflet is the client part of LibreOffice Online
   ProxyPass /loleaflet https://127.0.0.1:9980/loleaflet retry=0
   ProxyPassReverse /loleaflet https://127.0.0.1:9980/loleaflet

   # WOPI discovery URL
   ProxyPass /hosting/discovery https://127.0.0.1:9980/hosting/discovery retry=0
   ProxyPassReverse /hosting/discovery https://127.0.0.1:9980/hosting/discovery

   # Main websocket
   ProxyPassMatch "/lool/(.*)/ws$" wss://127.0.0.1:9980/lool/$1/ws nocanon

   # Admin Console websocket
   ProxyPass /lool/adminws wss://127.0.0.1:9980/lool/adminws

   # Download as, Fullscreen presentation and Image upload operations
   ProxyPass /lool https://127.0.0.1:9980/lool
   ProxyPassReverse /lool https://127.0.0.1:9980/lool
</VirtualHost>
Mexiim
 
Posts: 5
Joined: 19. September 2019 10:03
XAMPP version: 7.1.32
Operating System: Debian

Re: Apache2 Virtualhost

Postby Nobbie » 21. September 2019 12:24

Mexiim wrote:Das sieht soweit gut aus.


Das sehe ich diametral anders. Wieso findest Du es gut, dass dort weder die (richtige) office.conf noch die dort enthaltenen VirtualHosts (office.example.org) auftauchen?? Damit bestätigt sich mein Verdacht, dass diese office.conf überhaupt nicht beachtet wird von Apache. Hast Du zwei verschiedene herumfliegen? Apache findet eine office.conf, aber da steht nur der VirtualHost office.distra.band drin, in der office.conf hier steht aber

Code: Select all
ServerName office.example.org


Irgendetwas ist mächtig krumm. Sehr merkwürdig ist auch die Konfiguration von NameVirtualHost office.distra.band, welcher in drei(!) verschiedenen Dateien auftaucht. Dafür fehlt aber office.example.org als VirtualHost.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Apache2 Virtualhost

Postby Mexiim » 23. September 2019 06:39

Mein Fehler.

Da habe ich nicht richtig aufgepasst. Ich hatte hier meine richtige Domain mit office.domain.de ersetzt. Auch die office.example.org ist meine richtige Domain.
Von den Namen her passt es also.
Mexiim
 
Posts: 5
Joined: 19. September 2019 10:03
XAMPP version: 7.1.32
Operating System: Debian


Return to Apache

Who is online

Users browsing this forum: No registered users and 28 guests