Sponsor-Board.de
Thema geschlossen  Thema schreiben 

RSpamd Proxy

Verfasser Nachricht

Beiträge: 55
Bewertung: 1
Registriert seit: Oct 2016
Status: offline


Beitrag: #1
RSpamd Proxy

Moinsen,

bin gerade einen kleinen Mailserver am aufsetzen - bleibe jedoch bei rspamd gerade hängen.

DNS Eintrag für "ox.domain.tld" sitzt, vHost sieht so aus:

Code:
<IfModule mod_ssl.c>
<VirtualHost *:443>

        ServerName ox.domain.tld
        ServerAdmin [email protected]
        DocumentRoot /var/www/ox.domain.tld/web/

        <Directory "/var/www/ox.domain.tld/web/">
                AllowOverride All
                Order allow,deny
                Allow from all
                Require all granted
                Options -Indexes
        </Directory>


        <Location /rspamd>
                Order allow,deny
                Allow from all
        </Location>

        RewriteRule ^/rspamd$ /rspamd/ [R,L]
        RewriteRule ^/rspamd/(.*) http://localhost:11334/$1 [P,L]

        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined


SSLCertificateFile /etc/letsencrypt/live/ox.domain.tld/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/ox.domain.tld/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>


Wenn ich mich nicht ganz irre, sollte normalerweise über ox.domain.tld/rspamd das ganze nun ereichbar sein, oder nicht?

Ist es nämlich nicht....Findet jemand den Fehler? ^^


Beste Grüße


//Edit Lösung:

Code:
<IfModule mod_ssl.c>
<VirtualHost *:443>

        ServerName ox.domain.tld
        ServerAdmin [email protected]
        DocumentRoot /var/www/ox.domain.tld/web/

        <Directory "/var/www/ox.domain.tld/web/">
                AllowOverride All
                Order allow,deny
                Allow from all
                Require all granted
                Options -Indexes
        </Directory>

        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined


SSLCertificateFile /etc/letsencrypt/live/oxdomain.tld/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/ox.domain.tld/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf

    ###
    ### Rspamd
    ###

    RewriteEngine on
    RewriteRule ^/rspamd$ /rspamd/ [R]
    ProxyPreserveHost On
    ProxyPass /rspamd http://localhost:11334/
    ProxyPassReverse /rspamd http://localhost:11334/

        <Location /rspamd>
                AllowOverride All
                Order allow,deny
                Options -Indexes
                Allow from all
                AuthType Basic
                AuthName "Restricted Content"
                AuthUserFile /var/www/ox.domain.tld/.htpasswd
                Require valid-user
        </Location>

</VirtualHost>
</IfModule>

Dieser Beitrag wurde zuletzt bearbeitet: 06.12.2018 14:31 von MB.n.

06.12.2018 14:06
 
Alle Beiträge dieses Benutzers finden

Beiträge: 55
Bewertung: 1
Registriert seit: Oct 2016
Status: offline


Beitrag: #2
RE: RSpamd Proxy

Und genau der macht mir jetzt Probleme ^^

---------------------

Ich habe gerade versucht neben domain.tld und mail.domain.tld eine weitere domain2.tld einzurichten.

Hier mal alle 3 vHosts:

Code:
<VirtualHost *:80>
    ServerName mail.domain.tld
    RedirectPermanent http://mail.domain.tld https://mail.domain.tld/rspamd/

</VirtualHost>


<VirtualHost *:443>
    ServerName mail.domain.tld
    RedirectPermanent https://mail.domain.tld https://mail.domain.tld/rspamd/

    ###
    ### Rspamd
    ###

    RewriteEngine on
    RewriteRule ^/rspamd$ /rspamd/ [R]

    ProxyPreserveHost On
    ProxyPass /rspamd http://localhost:11334/
    ProxyPassReverse /rspamd http://localhost:11334/

    SSLEngine on
    SSLHonorCipherOrder on
    SSLCertificateFile /etc/letsencrypt/live/domain.tld-0002/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/domain.tld-0002/privkey.pem

    Include /etc/letsencrypt/options-ssl-apache.conf

</VirtualHost>


Code:
<VirtualHost *:80>

        ServerName domain.tld
        ServerAlias www.domain.tld
        ServerAdmin [email protected]
        DocumentRoot /var/www/domain.tld/web/

        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

RewriteEngine on
RewriteCond %{SERVER_NAME} =www.domain.tld [OR]
RewriteCond %{SERVER_NAME} =domain.tld
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>

        ServerName domain.tld
        ServerAlias www.domain.tld
        ServerAdmin [email protected]
        DocumentRoot /var/www/domain.tld/web/

    Alias /phpmyadmin "/usr/share/phpmyadmin/"
    <Directory "/usr/share/phpmyadmin/">
        Order allow,deny
        Allow from all
                AuthType Basic
                AuthName "Restricted Content"
                AuthUserFile /etc/apache2/.htpasswd
                Require valid-user
    </Directory>

        <Directory "/var/www/domain.tld/web/">
                AllowOverride All
                Order allow,deny
                Allow from all
                Require all granted
                Options -Indexes
        </Directory>


        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/domain.tld-0002/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.tld-0002/privkey.pem

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

</VirtualHost>
</IfModule>


Code:
<VirtualHost *:80>

        ServerName domain2.tld
        ServerAlias www.domain2.tld
        ServerAdmin [email protected]
        DocumentRoot /var/www/domain2.tld/web/

        <Directory "/var/www/domain2.tld/web/">
                AllowOverride All
                Order allow,deny
                Allow from all
                Require all granted
                Options -Indexes
        </Directory>


    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>


Szenario:
domain.tld - Funktioniert wie gewünscht inkl. Weiterleitung von http und ohne www. wird auf https mit www redirected.

mail.domain.tld - Funktioniert fast wie gewünscht. Weiterleitung von http auf https mit rspamd Unterordner funktioniert, Weiterleitung von https auf Unterordner auch. (Wünschenswert wäre, wenn ich gar nicht den Unterordner hätte sondern es direkt auf mail.domain.tld, deswegen fast wie gewünscht, ist aber erstmal ok).

domain2.tld - Wird auf mail.domain.tld/rspamd redirected was natürlich nicht so soll, sondern wie domain.tld sein eigene Seite haben.


Erkennt zufällig jemand das Problem?

Dieser Beitrag wurde zuletzt bearbeitet: 08.12.2018 18:01 von MB.n.

07.12.2018 17:31
 
Alle Beiträge dieses Benutzers finden
- # PUSH # - 08.12.2018 - 00:46 Uhr -
- # PUSH # - 10.12.2018 - 00:24 Uhr -

Beiträge: 139
Bewertung: 8
Registriert seit: Mar 2015
Status: offline


Beitrag: #3
RE: RSpamd Proxy

Auch wenn ich mich mit Apache nicht auskenne oder allgm der Webserver Profi bin

sieht es hier nach dem Fehler aus:

RewriteRule ^/rspamd$ /rspamd/ [R]

mach mal das /rspamd/ weg
dann sollte direkt auf die hauptdomain oder subdomain was du da benutzt der rspamd direkt auflösen.

ggf. musst du die RewriteRule umschreiben.


.

18.06.2019 20:38
 
Alle Beiträge dieses Benutzers finden
Thema geschlossen  Thema schreiben 

Möglicherweise verwandte Themen...
Thema: Verfasser Antworten: Ansichten: Letzter Beitrag
  HTTP Proxy auf vServer VaL 10 2.935 12.08.2016 17:33
Letzter Beitrag: EinfachPlanlos.Net
  Reverse-Proxy Setup - SSL Zertifikat Dream-Code 2 1.450 01.10.2014 19:03
Letzter Beitrag: Dream-Code

 Druckversion anzeigen
 Thema einem Freund senden
 Thema abonnieren
 Thema zu den Favoriten hinzufügen

Sponsor-Board.de

Community
Über uns
Partner
Powered by Mybb: Copyright 2002-2024 by MyBB Group - Deutsche-Übersetzung von Mybb.de
 
© 2007-2024 Sponsor-Board.de - Hosted by OVH

Willkommen auf SB!   Sie benötigen ein Sponsoring?   1. Anmelden   2. Sponsoring-Anfrage erstellen   3. Nachrichten von Sponsoren erhalten   Kostenlos!   Jetzt registrieren