SOGo 作为虚拟主机

SOGo 作为虚拟主机

我目前正忙于设置供个人使用的邮件/web/caldav/carddav 服务器(apache、postfix、dovecot、SOGo),此刻我被困在想要为 SOGo 服务指定子域的地方。

例如,我想在 web.example.com 上访问 SOGo,但没有它通常使用的 de /SOGo 子目录。我不确定这是否适用于 SOGo 和/或 CalDAV/CardDAV。此外,出于安全考虑,我希望 SOGo、CalDAV 和 CardDAV 仅通过 HTTP 访问。

如下所示,您将找到 apache 的默认 SOGo 配置文件。有人能帮我解决这个问题吗,或者解释一下为什么这是一个愚蠢的想法?

Alias /SOGo.woa/WebServerResources/ /usr/lib64/GNUstep/SOGo/WebServerResources/
Alias /SOGo/WebServerResources/ /usr/lib64/GNUstep/SOGo/WebServerResources/

<Directory /usr/lib64/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/lib64/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>

# # 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

ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0

<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" "yourhostname"
#   RequestHeader set "x-webobjects-server-url" "https://yourhostname"

    # 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>

答案1

您不能将 SOGo 放在文档根目录中,它总是想使用路径/SOGo(或者,更准确地说:我还不知道如何做到这一点)。

但是,可以将其放在单独的VirtualHost指令中。您需要做的就是将 SOGo 配置包装到VirtualHost,并设置重定向,这样如果有人将浏览器指向您的域,他们将被重定向到/SOGo,如下所示:

RewriteEngine On
RewriteRule ^/$ /SOGo/ [R]

VirtualHost您可以像平常一样在其中包含任何指令,这样您可以轻松地使您的 SOGo 安装只能通过 SSL 访问(无论如何这是一个好主意)。

相关内容