我需要做什么才能获得 ProxyPass 指令进行注册?

我需要做什么才能获得 ProxyPass 指令进行注册?

我正在尝试通过 SSL 在 Apache 2.4.38 (Debian) 下安装 MyCollab CE。目前我发现 ProxyPass 无法识别。我有:

ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/

当我尝试加载 HTTPS 代理时,它给出 500 并且错误日志文件不存在。

我的完整...le-ssl.conf 文件内容经过了轻微的净化:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName [FQDN]
    ServerAlias [FQDN]
    DocumentRoot /home/christos/foo
    ErrorLog /var/log/apache2/foo_error.log
    CustomLog /var/log/apache2/foo_access.log combined
    ServerAdmin [email]
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /home/christos/foo/>
        Options ExecCGI Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/mycollab.error.log
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/

SSLCertificateFile /etc/letsencrypt/live/[FQDN]/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/[FQDN]/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

我已启用 ssl 和代理。

我该怎么做才能使通过 HTTPS 进行的访问在 SSL 下显示与直接通过 8080 连接相同的内容?

--更新--

我已将 LogLevel 设置为警告。在另一次(单次)尝试加载主页并指定 SSLEngine On 和 SSLProxyEngine on 后,我在日志中收到以下内容:

[Sun Aug 22 16:28:47.065003 2021] [socache_shmcb:debug] [pid 28984] mod_socache_shmcb.c(495): AH00831: socache_shmcb_store (0xb0 -> subcache 16)
[Sun Aug 22 16:28:47.065086 2021] [socache_shmcb:debug] [pid 28984] mod_socache_shmcb.c(849): AH00847: insert happened at idx=0, data=(0:32)
[Sun Aug 22 16:28:47.065091 2021] [socache_shmcb:debug] [pid 28984] mod_socache_shmcb.c(854): AH00848: finished insert, subcache: idx_pos/idx_used=0/1, data_pos/data_used=0/210
[Sun Aug 22 16:28:47.065094 2021] [socache_shmcb:debug] [pid 28984] mod_socache_shmcb.c(516): AH00834: leaving socache_shmcb_store successfully
[Sun Aug 22 16:28:47.067256 2021] [socache_shmcb:debug] [pid 28983] mod_socache_shmcb.c(495): AH00831: socache_shmcb_store (0x2e -> subcache 14)
[Sun Aug 22 16:28:47.067316 2021] [socache_shmcb:debug] [pid 28983] mod_socache_shmcb.c(849): AH00847: insert happened at idx=2, data=(412:444)
[Sun Aug 22 16:28:47.067321 2021] [socache_shmcb:debug] [pid 28983] mod_socache_shmcb.c(854): AH00848: finished insert, subcache: idx_pos/idx_used=0/3, data_pos/data_used=0/622
[Sun Aug 22 16:28:47.067325 2021] [socache_shmcb:debug] [pid 28983] mod_socache_shmcb.c(516): AH00834: leaving socache_shmcb_store successfully
[Sun Aug 22 16:28:47.165562 2021] [ssl:debug] [pid 28984] ssl_engine_kernel.c(383): [client 73.74.173.201:51057] AH02034: Initial (No.1) HTTPS request received for child 8 (server [FQDN]:443)
[Sun Aug 22 16:28:47.165668 2021] [authz_core:debug] [pid 28984] mod_authz_core.c(846): [client 73.74.173.201:51057] AH01628: authorization result: granted (no directives)
[Sun Aug 22 16:28:47.165717 2021] [proxy:debug] [pid 28984] mod_proxy.c(1249): [client 73.74.173.201:51057] AH01143: Running scheme http handler (attempt 0)
[Sun Aug 22 16:28:47.165723 2021] [proxy:warn] [pid 28984] [client 73.74.173.201:51057] AH01144: No protocol handler was valid for the URL / (scheme 'http'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
[Sun Aug 22 16:28:47.165894 2021] [ssl:debug] [pid 28984] ssl_engine_io.c(1106): [client 73.74.173.201:51057] AH02001: Connection closed to child 8 with standard shutdown (server [FQDN]:443)
[Sun Aug 22 16:28:47.379646 2021] [ssl:debug] [pid 28983] ssl_engine_kernel.c(383): [client 73.74.173.201:51058] AH02034: Initial (No.1) HTTPS request received for child 7 (server [FQDN]:443), referer: https://[FQDN]/
[Sun Aug 22 16:28:47.379784 2021] [authz_core:debug] [pid 28983] mod_authz_core.c(846): [client 73.74.173.201:51058] AH01628: authorization result: granted (no directives), referer: https://[FQDN]/
[Sun Aug 22 16:28:47.379842 2021] [proxy:debug] [pid 28983] mod_proxy.c(1249): [client 73.74.173.201:51058] AH01143: Running scheme http handler (attempt 0), referer: https://[FQDN]/
[Sun Aug 22 16:28:47.379850 2021] [proxy:warn] [pid 28983] [client 73.74.173.201:51058] AH01144: No protocol handler was valid for the URL /favicon.ico (scheme 'http'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule., referer: https://[FQDN]/
[Sun Aug 22 16:28:47.380069 2021] [ssl:debug] [pid 28983] ssl_engine_io.c(1106): [client 73.74.173.201:51058] AH02001: Connection closed to child 7 with standard shutdown (server [FQDN]:443)

答案1

从你正在编写的(或者更确切地说:没有编写的)模块proxy_http可能会丢失。

运行后就可以apache2ctl -M看到已经加载的模块了。

答案2

尝试添加以下内容。如果您的后端未使用 SSL,则可能不需要第二个。

SSLEngine 开启

SSLProxyEngine 已开启

如果您没有收到错误日志,请检查日志位置的文件权限并确保运行 apache 的用户有权限。一旦收到错误日志,故障排除就会更容易。

相关内容