Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
设置Apache反向代理tomcat(Jenkins,Sonar)的正确方法是什么_Apache_Tomcat_Ssl_Jenkins_Proxy - Fatal编程技术网

设置Apache反向代理tomcat(Jenkins,Sonar)的正确方法是什么

设置Apache反向代理tomcat(Jenkins,Sonar)的正确方法是什么,apache,tomcat,ssl,jenkins,proxy,Apache,Tomcat,Ssl,Jenkins,Proxy,我们正在尝试为我们的软件工厂设置反向代理。我们可以设法将所有的大西洋套房置于反向代理之下,但詹金斯和声纳很难做到这一点 以下是apache配置: <VirtualHost *:443> SSLCertificateFile /etc/apache2/ssl/atoe.crt SSLCertificateKeyFile /etc/apache2/ssl/atoe.key SSLCertificateChainFil

我们正在尝试为我们的软件工厂设置反向代理。我们可以设法将所有的大西洋套房置于反向代理之下,但詹金斯和声纳很难做到这一点

以下是apache配置:

<VirtualHost *:443>
            SSLCertificateFile /etc/apache2/ssl/atoe.crt
            SSLCertificateKeyFile /etc/apache2/ssl/atoe.key
            SSLCertificateChainFile /etc/apache2/ssl/bundle.crt

            ProxyRequests Off
            ProxyPreserveHost On
            ProxyVia Off

            <Proxy *>
                    Order deny,allow
                    Require all granted
            </Proxy>
            <Proxy http://localhost:9010/jenkins*>
                Order deny,allow
                Allow from all
            </Proxy>

            ProxyPass /confluence http://localhost:8090/confluence
            ProxyPassReverse /confluence http://localhost:8090/confluence

            ProxyPass /bitbucket http://localhost:7990/bitbucket
            ProxyPassReverse /bitbucket http://localhost:7990/bitbucket

            ProxyPass / http://localhost:8095/
            ProxyPassReverse / http://localhost:8095/

            ProxyPass /sonarqube http://localhost:9000/sonarqube
            ProxyPassReverse /sonarqube http://localhost:9000/sonarqube
</VirtualHost>

SSLCertificateFile/etc/apache2/ssl/atoe.crt
SSLCertificateKeyFile/etc/apache2/ssl/atoe.key
SSLCertificateChainFile/etc/apache2/ssl/bundle.crt
代理请求关闭
代理主机
ProxyVia关闭
命令拒绝,允许
要求所有授权
命令拒绝,允许
通融
ProxyPass/汇流http://localhost:8090/confluence
ProxyPass反向/汇合http://localhost:8090/confluence
代理传递/比特桶http://localhost:7990/bitbucket
ProxyPassReverse/bitbuckethttp://localhost:7990/bitbucket
ProxyPass/http://localhost:8095/
ProxyPassReverse/http://localhost:8095/
ProxyPass/sonarqubehttp://localhost:9000/sonarqube
ProxyPassReverse/sonarqubehttp://localhost:9000/sonarqube
Sonarqube和Jenkins都在Tomcat 7.0.69下运行。我在sonar.properties和/etc/default/jenkins中更改了它们的上下文,如上图所示设置了正确的上下文。当试图通过代理连接到这些工具时,我得到了错误404

apache2的日志中没有提及任何内容

我错过什么了吗


感谢您的帮助

看来ProxyPass的顺序很重要。如果我们定义了“/”,则必须在末尾定义,否则,之后将不考虑任何内容

就我们而言,我们有:

        ProxyPass /confluence http://localhost:8090/confluence
        ProxyPassReverse /confluence http://localhost:8090/confluence

        ProxyPass /bitbucket http://localhost:7990/bitbucket
        ProxyPassReverse /bitbucket http://localhost:7990/bitbucket

        ProxyPass / http://localhost:8095/
        ProxyPassReverse / http://localhost:8095/

        ProxyPass /sonarqube http://localhost:9000/sonarqube
        ProxyPassReverse /sonarqube http://localhost:9000/sonarqube
为了让它发挥作用,我们必须颠倒最后两个:

        ProxyPass /confluence http://localhost:8090/confluence
        ProxyPassReverse /confluence http://localhost:8090/confluence

        ProxyPass /bitbucket http://localhost:7990/bitbucket
        ProxyPassReverse /bitbucket http://localhost:7990/bitbucket

        ProxyPass /sonarqube http://localhost:9000/sonarqube
        ProxyPassReverse /sonarqube http://localhost:9000/sonarqube

        ProxyPass / http://localhost:8095/
        ProxyPassReverse / http://localhost:8095/