我正在尝试在 Apache 2.4.38 (Debian) 下通过 SSL 安装 MyCollab CE。目前我看到 ProxyPass 无法识别。我有:
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
当我尝试加载 HTTPS 代理时,它给出 500 并且错误日志文件不存在。
我完整的 ...le-ssl.conf 文件读取,mmildly sanitized:
<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)
尝试添加以下内容。如果您的后端不使用 SSL,您可能不需要第二个。
SSLEngine 开启
SSLProxyEngine 开启
如果您没有收到错误日志,请检查日志位置的文件权限并确保运行 apache 的用户具有权限。收到错误日志后,故障排除会更容易。
从你正在写的(或者更确切地说:不写)模块
proxy_http
可能会丢失。您可以运行
apache2ctl -M
以查看已加载的模块。