大网数据广告活动
服务器运维问答

Apache Archiva with ssl proxy

· 52CE 我爱测

I am quite a newbie in the field of server configuration. At work we want to setup a Maven repository with Apache Archiva, basically we want a place in which store the Maven projects we create. I am able to run Archiva on localho…

问题原文

原帖链接 · Antonio La Marra · CC BY-SA 3.0

I am quite a newbie in the field of server configuration. At work we want to setup a Maven repository with Apache Archiva, basically we want a place in which store the Maven projects we create. I am able to run Archiva on localhost and to access it via http. To be able to access to the repository via SSL, we wanted to configure Apache to act as a SSL proxy, I followed many guides (e.g. https://stackoverflow.com/questions/30871001/how-to-setup-apache-archiva-to-use-https-instead-of-http) on how to do that but the answer I get when I try to connect via https is

An error occurred during a connection to server_ip:8080. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG

My Virtual Host configuration looks like this:

Listen 8081
<VirtualHost *:8081>
    ServerName server_ip
    ProxyRequests Off
    <Proxy http://localhost:8080>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPreserveHost On
    SSLEngine On
    SSLProxyEngine On
    SSLCertificateFile /path_to_cert
    SSLCertificateKeyFile /path_to_key
    ProxyPass /http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/
</VirtualHost>

How can I solve the issue?

已采纳解答

原帖链接 · Unbeliever · CC BY-SA 3.0

Other than the missing space in the line "ProxyPass /http://localhost:8080/" which I presume to be a copy/paste error (otherwise you server would not start), you only need "SSLProxyEngine On" when proxying to https, but you are pryxing to http, so you do not need this. Remove this directive and re-try, it should work.

Also you do not need the <Proxy http://localhost:8080 > block. These sorts of blocks are (almost) exclusively for configuring forward proxies, whereas you have a reverse proxy. They are very common across various 'guides' out on the internet, but they are not needed.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-08-26)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。