Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup Apache Archiva to use HTTPS instead of HTTP

Tags:

https

archiva

In default configuration, Apache Archiva 2.2 uses HTTP, and official documentation tells nothing how to change it to HTTPS.

I think that this can be done by modifying conf/jetty.xml file, but when I try to do this, as described in Jetty documentation, it only gives me errors like:

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

Is it possible to do this?

like image 372
user11153 Avatar asked Mar 17 '26 09:03

user11153


1 Answers

I used Apache as a HTTPS proxy, configuring new virtual host:

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>

Don't forget to enable two apache mods that are necessary to run this:

sudo a2enmod proxy proxy_http
like image 118
user11153 Avatar answered Mar 20 '26 16:03

user11153



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!