Apache 与 Alias 结合作为反向代理

Apache 与 Alias 结合作为反向代理

我想为这个反向代理后面的不同计算机上运行的多个 Web 应用程序构建一个反向代理服务器。到目前为止,效果很好。

除此之外,我还想在反向代理本身上使用本地目录并将其共享到 Web。这是一个本地安装的 WebDAV 共享,具有基于 LDAP 的身份验证。因此,我在 Apache 的配置文件中定义了一个目录部分和一个别名来告诉 Apache 要使用哪个 URL。

Apache 告诉我的一切都是 404。

以下是我的配置文件中的相关部分:

    <Directory "/home/webshareuser/owncloud">
            AuthBasicProvider ldap
            AuthType Basic
            AuthName "Webshare"
            AuthLDAPURL ldap://subdomain.domain.tld:7389/dc=domain,dc=tld?uid
            AuthLDAPBindDN uid=Administrator,cn=users,dc=domain,dc=tld
            AuthLDAPBindPassword supermegasecretpassword
            Require ldap-group cn=webshareusers,cn=groups,dc=domain,dc=tld
    </Directory>

    Alias "/webshare" "/home/webshareuser/owncloud"

除此之外,还有如上所述的几个代理指令。

当我尝试获取此 URL 时,我在我的日志中发现了这一点(调试日志级别):

[Mon Jan 18 00:08:22.129300 2016] [ssl:info] [pid 9930] [client xxx.xxx.xxx.xxx:47129] AH01964: Connection to child 7 established (server subdomain.domain.tld:443)
[Mon Jan 18 00:08:22.129575 2016] [ssl:debug] [pid 9930] ssl_engine_kernel.c(1879): [client xxx.xxx.xxx.xxx:47129] AH02043: SSL virtual host for servername subdomain.domain.tld found
[Mon Jan 18 00:08:22.129631 2016] [ssl:debug] [pid 9930] ssl_util_stapling.c(578): AH01951: stapling_cb: OCSP Stapling callback called
[Mon Jan 18 00:08:22.129641 2016] [ssl:debug] [pid 9930] ssl_util_stapling.c(586): AH01952: stapling_cb: retrieved cached certificate data
[Mon Jan 18 00:08:22.129682 2016] [socache_shmcb:debug] [pid 9930] mod_socache_shmcb.c(522): AH00835: socache_shmcb_retrieve (0x32 -> subcache 2)
[Mon Jan 18 00:08:22.129696 2016] [socache_shmcb:debug] [pid 9930] mod_socache_shmcb.c(845): AH00849: match at idx=0, data=0
[Mon Jan 18 00:08:22.129702 2016] [socache_shmcb:debug] [pid 9930] mod_socache_shmcb.c(532): AH00836: leaving socache_shmcb_retrieve successfully
[Mon Jan 18 00:08:22.129750 2016] [ssl:debug] [pid 9930] ssl_util_stapling.c(278): AH01933: stapling_get_cached_response: cache hit
[Mon Jan 18 00:08:22.129756 2016] [ssl:debug] [pid 9930] ssl_util_stapling.c(600): AH01953: stapling_cb: retrieved cached response
[Mon Jan 18 00:08:22.129849 2016] [ssl:debug] [pid 9930] ssl_util_stapling.c(644): AH01956: stapling_cb: setting response
[Mon Jan 18 00:08:22.279403 2016] [socache_shmcb:debug] [pid 9930] mod_socache_shmcb.c(485): AH00831: socache_shmcb_store (0xd9 -> subcache 25)
[Mon Jan 18 00:08:22.279482 2016] [socache_shmcb:debug] [pid 9930] mod_socache_shmcb.c(810): AH00847: insert happened at idx=0, data=(0:32)
[Mon Jan 18 00:08:22.279490 2016] [socache_shmcb:debug] [pid 9930] mod_socache_shmcb.c(815): AH00848: finished insert, subcache: idx_pos/idx_used=0/1, data_pos/data_used=0/203
[Mon Jan 18 00:08:22.279496 2016] [socache_shmcb:debug] [pid 9930] mod_socache_shmcb.c(506): AH00834: leaving socache_shmcb_store successfully
[Mon Jan 18 00:08:22.279517 2016] [ssl:debug] [pid 9930] ssl_engine_kernel.c(1812): [client xxx.xxx.xxx.xxx:47129] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
[Mon Jan 18 00:08:22.321987 2016] [ssl:debug] [pid 9930] ssl_engine_kernel.c(224): [client xxx.xxx.xxx.xxx:47129] AH02034: Initial (No.1) HTTPS request received for child 7 (server subdomain.domain.tld:443)
[Mon Jan 18 00:08:22.322095 2016] [authz_core:debug] [pid 9930] mod_authz_core.c(809): [client xxx.xxx.xxx.xxx:47129] AH01626: authorization result of Require all granted: granted
[Mon Jan 18 00:08:22.322105 2016] [authz_core:debug] [pid 9930] mod_authz_core.c(809): [client xxx.xxx.xxx.xxx:47129] AH01626: authorization result of <RequireAny>: granted
[Mon Jan 18 00:08:22.322164 2016] [proxy:debug] [pid 9930] mod_proxy.c(1117): [client xxx.xxx.xxx.xxx:47129] AH01143: Running scheme http handler (attempt 0)
[Mon Jan 18 00:08:22.322172 2016] [proxy_ajp:debug] [pid 9930] mod_proxy_ajp.c(713): [client xxx.xxx.xxx.xxx:47129] AH00894: declining URL http://xxx.xxx.xxx.xxx/webshare
[Mon Jan 18 00:08:22.322178 2016] [proxy_fcgi:debug] [pid 9930] mod_proxy_fcgi.c(946): [client xxx.xxx.xxx.xxx:47129] AH01076: url: http://xxx.xxx.xxx.xxx/webshare proxyname: (null) proxyport: 0
[Mon Jan 18 00:08:22.322183 2016] [proxy_fcgi:debug] [pid 9930] mod_proxy_fcgi.c(949): [client xxx.xxx.xxx.xxx:47129] AH01077: declining URL http://xxx.xxx.xxx.xxx/webshare
[Mon Jan 18 00:08:22.322190 2016] [proxy:debug] [pid 9930] proxy_util.c(2203): AH00942: HTTP: has acquired connection for (xxx.xxx.xxx.xxx)
[Mon Jan 18 00:08:22.322211 2016] [proxy:debug] [pid 9930] proxy_util.c(2256): [client xxx.xxx.xxx.xxx:47129] AH00944: connecting http://xxx.xxx.xxx.xxx/webshare to xxx.xxx.xxx.xxx:80
[Mon Jan 18 00:08:22.322390 2016] [proxy:debug] [pid 9930] proxy_util.c(2422): [client xxx.xxx.xxx.xxx:47129] AH00947: connected /webshare to xxx.xxx.xxx.xxx:80
[Mon Jan 18 00:08:22.322985 2016] [proxy:debug] [pid 9930] proxy_util.c(2798): AH02824: HTTP: connection established with xxx.xxx.xxx.xxx:80 (xxx.xxx.xxx.xxx)
[Mon Jan 18 00:08:22.323032 2016] [proxy:debug] [pid 9930] proxy_util.c(2923): AH00962: HTTP: connection complete to xxx.xxx.xxx.xxx:80 (xxx.xxx.xxx.xxx)
[Mon Jan 18 00:08:22.324486 2016] [proxy:debug] [pid 9930] proxy_util.c(2218): AH00943: http: has released connection for (xxx.xxx.xxx.xxx)
[Mon Jan 18 00:08:22.324511 2016] [headers:debug] [pid 9930] mod_headers.c(823): AH01502: headers: ap_headers_output_filter()

答案1

解决我的问题的方法是!。

ProxyPass               /webshare !

相关内容