Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 同一台机器上代理背后的Collabora(docker)和NextCloud(snap)问题_Apache_Docker_Ssl_Reverse Proxy_Nextcloud - Fatal编程技术网

Apache 同一台机器上代理背后的Collabora(docker)和NextCloud(snap)问题

Apache 同一台机器上代理背后的Collabora(docker)和NextCloud(snap)问题,apache,docker,ssl,reverse-proxy,nextcloud,Apache,Docker,Ssl,Reverse Proxy,Nextcloud,经过几天的故障排除,我决定发布我的情况。我最近在Ubuntu18.04上安装了NextCloud作为snap,一切正常。我做了端口转发,并使用Let's Encrypt(从snap命令)为NC创建证书 然后我决定在同一台机器上安装Collabora服务器,以使用office功能。我使用了上面提到的安装的官方协作指南。但是,在本指南中,假设NC是手动安装的(不是snap)。根据指南,我必须安装Apache(或任何其他代理/web服务器)来将流量代理给NC或Collabora 我认为我的代理配置有问

经过几天的故障排除,我决定发布我的情况。我最近在Ubuntu18.04上安装了NextCloud作为snap,一切正常。我做了端口转发,并使用Let's Encrypt(从snap命令)为NC创建证书

然后我决定在同一台机器上安装Collabora服务器,以使用office功能。我使用了上面提到的安装的官方协作指南。但是,在本指南中,假设NC是手动安装的(不是snap)。根据指南,我必须安装Apache(或任何其他代理/web服务器)来将流量代理给NC或Collabora

我认为我的代理配置有问题,或者SSL证书有问题。当Apache和snap都在运行时,我可以进入Apache页面,Collabora应该在运行,但无法进入NC页面

我可以转到下面的(端口443)链接并进入页面(意味着Collabora正在响应?)

但是当访问NC域时,浏览器会显示“未连接:潜在的安全问题”,并抱怨证书不是针对我尝试连接的NC域,而是针对Collabora域。如果我停止Apache并让Snap运行,我可以访问NC域而不会出现任何问题(除非我需要再次将端口设置为443和80!这有问题吗?) 我的Apache代理配置文件(位于/etc/apache2/sites available/下)如下所示:

<VirtualHost *:444>

ServerName nextcloud.domain.com:444
ProxyPreserveHost On
ProxyPass        / https://192.168.1.50/
ProxyPassReverse / https://192.168.1.50/

SSLProxyEngine on
SSLCertificateFile /etc/letsencrypt/live/nextcloud.domain.com/cert.pem
SSLCertificateChainFile /etc/letsencrypt/live/nextcloud.domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/nextcloud.domain.com/privkey.pem

</VirtualHost>

<VirtualHost *:443>
ServerName collabora.domain.com:443

# SSL configuration, you may want to take the easy route instead and use Lets Encrypt!
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/collabora.domain.com/cert.pem
SSLCertificateChainFile /etc/letsencrypt/live/collabora.domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/collabora.domain.com/privkey.pem
SSLProtocol             all -SSLv2 -SSLv3
SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-$
SSLHonorCipherOrder     on

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

# Endpoint with information about availability of various features
ProxyPass           /hosting/capabilities https://127.0.0.1:9980/hosting/capabilities retry=0
ProxyPassReverse    /hosting/capabilities https://127.0.0.1:9980/hosting/capabilities
</VirtualHost>

ServerName nextcloud.domain.com:444
代理主机
ProxyPass/https://192.168.1.50/
ProxyPassReverse/https://192.168.1.50/
SSLProxyEngine打开
SSLCertificateFile/etc/letsencrypt/live/nextcloud.domain.com/cert.pem
SSLCertificateChainFile/etc/letsencrypt/live/nextcloud.domain.com/fullchain.pem
SSLCertificateKeyFile/etc/letsencrypt/live/nextcloud.domain.com/privkey.pem
ServerName collabora.domain.com:443
#SSL配置时,您可能希望改为采用简易路由,并使用Lets Encrypt!
斯伦金安
SSLCertificateFile/etc/letsencrypt/live/collabora.domain.com/cert.pem
SSLCertificateChainFile/etc/letsencrypt/live/collabora.domain.com/fullchain.pem
SSLCertificateKeyFile/etc/letsencrypt/live/collabora.domain.com/privkey.pem
SSLProtocol all-SSLv2-SSLv3
SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-$
SSLHonorCipherOrder开启
#需要允许使用编码的斜杠
AllowEncodeDSL节点代码
#容器使用唯一的未签名证书
SSLProxyEngine打开
SSLProxyVerify无
SSLProxyCheckPeerCN关闭
SSLProxyCheckPeerName关闭
#留住主人
代理主机
#loolwsd提供的静态html、js、图像等
#loleaflet是LibreOffice Online的客户端部分
ProxyPass/loleaflethttps://127.0.0.1:9980/loleaflet 重试=0
ProxyPassReverse/loleaflethttps://127.0.0.1:9980/loleaflet
#WOPI发现URL
代理传递/托管/发现https://127.0.0.1:9980/hosting/discovery$
ProxyPassReverse/hosting/discoveryhttps://127.0.0.1:9980/hosting/discovery
#主网箱
ProxyPassMatch“/lool/(.*)/ws$”wss://127.0.0.1:9980/lool/$1/ws诺卡农
#管理控制台websocket
ProxyPass/lool/adminwswss://127.0.0.1:9980/lool/adminws
#下载为、全屏演示和图像上载操作
ProxyPass/loolhttps://127.0.0.1:9980/lool
ProxyPassReverse/loolhttps://127.0.0.1:9980/lool
#端点,其中包含有关各种功能可用性的信息
ProxyPass/托管/功能https://127.0.0.1:9980/hosting/capabilities 重试=0
ProxyPassReverse/托管/功能https://127.0.0.1:9980/hosting/capabilities

老实说,这是我第一次设置不知道如何工作的代理服务器。我的大部分配置文件都被复制了,我想这就是问题所在:)如果有人能看一看并引导我走上正确的方向,那将为我节省很多头痛和时间。

我经历了同样的痛苦,经历了相似的时间,最终得到了一个简单的解决方案

docker的联机说明是正确的,只是它们忽略了启用WebSocket代理

a2enmod proxy
a2enmod proxy_wstunnel
a2enmod proxy_http
a2enmod ssl
我唯一需要做的其他更改是在docker start中添加--cap add MKNOD

在Nextcloud中,在为我的域创建LetsEncrypt证书之后,我只需要添加到WAPI服务器地址配置中(显然example.com不是我真正的域)