Sponsor-Board.de
RSpamd Proxy

+- Sponsor-Board.de (https://www.sponsor-board.de)
+-- Forum: Community (/forumdisplay.php?fid=56)
+--- Forum: Hilfe (/forumdisplay.php?fid=102)
+---- Forum: Linux-Server (/forumdisplay.php?fid=105)
+---- Thema: RSpamd Proxy (/showthread.php?tid=65704)


RSpamd Proxy - MB.n - 06.12.2018 14:06

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>




RE: RSpamd Proxy - MB.n - 07.12.2018 17:31

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?


pushsubject - push - 08.12.2018 00:46

pushmessage


pushlive - push - 10.12.2018 00:24

pushmessage


RE: RSpamd Proxy - Knot3n - 18.06.2019 20:38

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.