Configuration 指定JFROG_访问主页,而不是~/.JFROG_访问(Artifactory 5.5.2)

Configuration 指定JFROG_访问主页,而不是~/.JFROG_访问(Artifactory 5.5.2),configuration,artifactory,Configuration,Artifactory,我设法使用我们现有的tomcat建立了artifactory。我已设置为ARTIFACTORY\u HOME=/opt/ARTIFACTORY,该部分工作正常。但是,还有jfrogaccess.war文件,它也需要运行。我没有弄清楚使用哪个变量来指定它的主变量,因此它默认为~/.jfrog\u access,这一点我都不喜欢 我将内容移到我的$ARTIFACTORY\u HOME/access并将其符号链接,但这不是确定的方法。非常感谢您的帮助。如果有人在这个问题上绊倒并遇到同样的问题: 我的解

我设法使用我们现有的tomcat建立了artifactory。我已设置为
ARTIFACTORY\u HOME=/opt/ARTIFACTORY
,该部分工作正常。但是,还有jfrog
access.war
文件,它也需要运行。我没有弄清楚使用哪个变量来指定它的主变量,因此它默认为
~/.jfrog\u access
,这一点我都不喜欢


我将内容移到我的
$ARTIFACTORY\u HOME/access
并将其符号链接,但这不是确定的方法。非常感谢您的帮助。

如果有人在这个问题上绊倒并遇到同样的问题:

我的解决方案是将上下文文件(
access.xml
artifactory.xml
,它们位于
/misc/tomcat
下的zip文件中)提取到tomcat配置文件夹中,例如
$CATALINA_HOME/conf/CATALINA/localhost/
。之后,
$ARTIFACTORY\u HOME
env将在Access启动时被识别。

A最终让我在Amazon Linux上找到了解决此问题的正确途径

除了将
access.xml
artifactory.xml
复制到
${catalina.home}/host/MY_HOSTNAME
之外,我发现还需要进行一些其他更改

我修改了XML上下文文件中的
docBase
属性,因为我的服务器有多个主机名:

/usr/share/tomcat8/conf/Catalina/repo.mydomain.org/access.xml

<Context path="/access" docBase="${catalina.home}/host/repo.mydomain.org/access.war">
    <Parameter name="jfrog.access.bundled" value="true" override="true"/>
    <!-- enable annotations scanning of access jar files -->
    <JarScanner scanClassPath="false">
        <JarScanFilter defaultPluggabilityScan="false" pluggabilityScan="access*" defaultTldScan="false"/>
    </JarScanner>
</Context>
<Context crossContext="true" path="/artifactory" docBase="${catalina.home}/host/repo.mydomain.org/artifactory.war">
</Context>
如果忘记执行上述操作,则可能会丢失这些文件,这将中断access和artifactory web应用程序之间的通信,导致登录失败(“用户名或密码不正确”)。在这种情况下,这些错误是由于web应用程序之间缺乏通信造成的,而不是凭据本身的问题


/usr/share/tomcat8/conf/Catalina/repo.mydomain.org/manager.xml

<Context path="/access" docBase="${catalina.home}/host/repo.mydomain.org/access.war">
    <Parameter name="jfrog.access.bundled" value="true" override="true"/>
    <!-- enable annotations scanning of access jar files -->
    <JarScanner scanClassPath="false">
        <JarScanFilter defaultPluggabilityScan="false" pluggabilityScan="access*" defaultTldScan="false"/>
    </JarScanner>
</Context>
<Context crossContext="true" path="/artifactory" docBase="${catalina.home}/host/repo.mydomain.org/artifactory.war">
</Context>
这使我能够通过
https://repo.mydomain.org:8443/manager/html

<Context docBase="${catalina.home}/webapps/manager" privileged="true" antiResourceLocking="false">
</Context>
tomcat8.conf

添加(或修改)以下行:

JAVA_OPTS="-Dartifactory.home=/usr/share/artifactory -Djfrog.access.home=/usr/share/artifactory/access -Dartifactory.access.client.serverUrl.override=http://localhost:8080/access"
注意:上面指定的访问客户机URL必须使用localhost,以避免Apache及其模块覆盖
服务器
HTTP参数。例如,如果我使用:

https://repo.mydomain.org/access/api/v1/system/ping
响应中的
服务器
HTTP头值为:

Server: Apache/2.4.33 (Amazon) OpenSSL/1.0.2k-fips mod_jk/1.2.43
Access客户端会产生以下异常:

[ERROR] (o.j.a.c.AccessClientImpl:154) - Access client/server version mismatch. Client version: 4.1.5, Server version: 2.4.33 (Amazon) OpenSSL
这意味着访问客户端取决于服务器头中匹配的第一个字符串
。。。
。这似乎是Access客户端非常脆弱的一部分。他们应该使用
X-JFrog-Access-Server
或其他东西,而不是试图控制web服务器设置的值。因此,要重申,请使用
http://localhost:8080/access
直接连接到tomcat服务器


Artifactory 6.2.0依赖于Apache Derby(具体版本可在
jfrog-Artifactory-oss-6.2.0.zip\Artifactory-oss-6.2.0\tomcat\lib
中找到)。应将其作为共享库添加到Tomcat:

mkdir /usr/share/tomcat8/shared
cd /usr/share/tomcat8/shared
wget http://central.maven.org/maven2/org/apache/derby/derby/10.11.1.1/derby-10.11.1.1.jar
在catalina.properties中添加或修改以下行:

shared.loader=${catalina.home}/shared/*.jar

因为我们想要
https://repo.mydomain.org
要转到Artifactory webapp:

mkdir /usr/share/tomcat8/host/repo.mydomain.org/ROOT
echo '<html><head><meta http-equiv="refresh" content="0;URL=/artifactory"></meta></head><body></body></html>' > /usr/share/tomcat8/host/repo.mydomain.org/ROOT/index.html
sudo chkconfig httpd on
sudo chkconfig tomcat8 on