<VirtualHost *:80> ServerAdmin email@example.com DocumentRoot "/srv/www/httpd/htdocs" ServerName artifactory.yourdomain.com ErrorLog "logs/artifactory-error_log" ProxyPreserveHost on AllowEncodedSlashes On ProxyPass /artifactory ajp://<yourdomain>:8019/artifactory </VirtualHost>
When changing the Artifactory context path in Apache make sure to reset your browser's host and session cookies.
Having a stale context path value cached by cookies can lead to inconsistent issue with the user interface such as
If you are using a dedicated Tomcat rather than the one that is bundled with the Artifactory download zip file, you must configure the AJP connector located, by default, under
<Connector port="8019" protocol="AJP/1.3" maxThreads="500" minSpareThreads="20" enableLookups="false" backlog="100"/>
Please refer to for more configuration options.
You can configure Apache using the same setup as above but here the goal is to have
http://artifactory.yourdomain.com/repository/ as the root URL for Artifactory as follows:
<VirtualHost *:80> ServerAdmin firstname.lastname@example.org DocumentRoot "/srv/www/httpd/htdocs" ServerName artifactory.yourdomain.com ErrorLog "logs/artifactory-error_log" ProxyPreserveHost on AllowEncodedSlashes On ProxyPass /repository ajp://<yourdomain>:8019/artifactory ProxyPassReverse /repository http://artifactory.yourdomain.com/artifactory ProxyPassReverseCookiePath /artifactory /repository </VirtualHost>
When running Artifactory with Tomcat, we recommend that you set up Apache to proxy Artifactory via HTTP.
You must configure redirects correctly using the PassReverse directive, and also set the base URL in Artifactory itself so that the UI links show up correctly.
The sample virtual host assumes that the Tomcat HTTP connector runs on port 8081.
For HTTP redirects to work, you must set a PassReverse directive on Apache, otherwise the underlying container base URL is passed in redirects
In the example below it is set to
<VirtualHost *:80> ServerAdmin email@example.com DocumentRoot "/srv/www/httpd/htdocs" ServerName artifactory.yourdomain.com ErrorLog "logs/artifactory-error_log" ProxyPreserveHost on AllowEncodedSlashes On ProxyPass /artifactory http://<yourdomain>:8081/artifactory ProxyPassReverse /artifactory http://artifactory.yourdomain.com/artifactory </VirtualHost>
From Artifactory version 6.10, new Artifactory installations will not include the AJP connector in Artifactory’s Tomcat server.xml file (i.e. under $ARTIFACTORY_HOME/tomcat/conf/server.xml).
Upgraded Artifactory environments will be unchanged provided the server.xml file is copied over.
Notice: AJP connector support will be removed in Artifactory's next major version (7.0).
You can set up Apache with SSL (HTTPS) as a front end to Artifactory using either the HTTP or AJP protocol.
Client ----------> HTTPD ----------> Artifactory HTTPS HTTP/AJP
If you are not running Artifactory with Tomcat, then it is recommended to use AJP since it provides the servlet container with all the information about the correct base URL and requires no configuration in Artifactory.
mod_proxy_ajpInstalled and Tomcat
The Apache and Tomcat sample configuration is as described in the section on Apache HTTP Server above under Using AJP.
When using an HTTP proxy, the links produced by Artifactory, as well as certain redirects contain the wrong port and use the
http instead of
Therefore, you must configure a custom base URL as follows:
Custom URL Base
Please refer to General Configuration for more details about configuring the base URL.