如何设置Apache Archiva使用HTTPS而不是HTTP

时间:2015-06-16 14:48:28

标签: https archiva

在默认配置中,Apache Archiva 2.2使用HTTP,official documentation没有告诉他们如何将其更改为HTTPS。

我认为这可以通过修改conf/jetty.xml文件来完成,但是当我尝试执行此操作时,如Jetty documentation中所述,它只会给我一些错误:

java.lang.NoSuchMethodException: class org.eclipse.jetty.util.ssl.SslContextFactory.setTrustStorePath(class java.lang.String)

是否可以这样做?

2 个答案:

答案 0 :(得分:1)

我使用Apache作为HTTPS代理,配置新的虚拟主机:

Listen 8081

<VirtualHost *:8081>
        ServerName archiva.example.com

        SSLEngine On
        SSLCertificateFile    /path/to/apache_certs/cert.pem
        SSLCertificateKeyFile /path/to/apache_certs/cert.key

        ProxyRequests     Off
        ProxyPass         /  http://localhost:8080/
        ProxyPassReverse  /  http://localhost:8080/
        <Proxy http://localhost:8080/*>
                Order allow,deny
                Allow from all
        </Proxy>
        ProxyPreserveHost on
</VirtualHost>

答案 1 :(得分:1)

我将以下内容添加到urls并且有效:

jetty.xml