使用SSL的JIRA服务器背后Apache反向代理不起作用

时间:2014-03-28 09:57:21

标签: apache ssl https proxy jira

我试图在Apache反向代理后面进行JIRA设置,其中与Apache的连接是通过SSL,然后Apache和JIRA之间的连接是http。

即。互联网/网络< = https => Apache< = http => JIRASERVER

我使用按照所述here创建的自我认证证书 Apache和JIRA都在同一台Windows 2008 R2服务器上运行。 我已经关注了instructions from Atlassian,但它似乎无法正常工作,我一直在互联网上四处寻找并找不到解决方案。

我可以在没有SSL的情况下设置Apache,而且似乎工作正常

配置1

互联网/网络< = http => Apache< = http => JIRASERVER

JIRA设置文件

server.xml中

<Service name="Catalina">
    <Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" 
    enableLookups="false" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" 
    port="8080" protocol="HTTP/1.1" redirectPort="8443" useBodyEncodingForURI="true"
    proxyName="JIRASERVERNAME" proxyPort="80"/>

Apache安装文件

的httpd.conf

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so

ServerName JIRASERVERNAME

Include conf/extra/httpd-vhosts.conf

的httpd-vhosts.conf

<VirtualHost *>
    ServerName JIRASERVERNAME

    ProxyRequests       Off
    ProxyPreserveHost   On
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass           /   http://JIRASERVERNAME:8080/
    ProxyPassReverse    /   http://JIRASERVERNAME:8080/

</VirtualHost>

在浏览器网址中键入JIRASERVERNAME,指向JIRASERVERNAME / secure / Dashboard.jspa并正常工作。

配置2

然而,当我尝试通过更改文件来启用SSL时,如下所示(即删除非SSL的设置并且只使用SSL)我得不到任何回复,并对于错误的原因感到困惑。

JIRA设置文件

server.xml中

<Service name="Catalina">
    <Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" 
    maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" port="8080"
    protocol="HTTP/1.1" redirectPort="8443" useBodyEncodingForURI="true"
    scheme="https" proxyName="JIRASERVERNAME" proxyPort="443" secure="true"/>

Apache安装文件

的httpd.conf

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule ssl_module modules/mod_ssl.so

ServerName JIRASERVERNAME

Include conf/extra/httpd-vhosts.conf

的httpd-vhosts.conf

<VirtualHost *:443>
    ServerName JIRASERVERNAME

    SSLEngine               On
    SSLCertificateFile      "C:\Program Files\Atlassian\JIRA\jre\server.crt"
    SSLCertificateKeyFile   "C:\Program Files\Atlassian\JIRA\jre\server.key"
    SSLProxyEngine      On

    ProxyRequests       Off
    ProxyPreserveHost   On
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass           /   http://JIRASERVERNAME:8080/
    ProxyPassReverse    /   http://JIRASERVERNAME:8080/

</VirtualHost>
<VirtualHost *:80>
    ServerName JIRASERVERNAME
    Redirect        /   https://JIRASERVERNAME/
</VirtualHost>

键入JIRASERVERNAME会重定向到安全网址https://JIRASERVERNAME 但是我在Chrome&#34中得到了回复;此网页不可用&#34; 任何人都可以帮助指出我做错了什么,我会非常感激

1 个答案:

答案 0 :(得分:1)

我得到了它的工作,主要是因为Apache没有在端口443上监听,我通过包含httpd-ssl.conf并在那里定义我的VirtualHost来解决这个问题。

所以这就是我最终的结果

JIRA设置文件

server.xml中

    <Service name="Catalina">
        <Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" 
        maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" port="8080"
        protocol="HTTP/1.1" redirectPort="8443" useBodyEncodingForURI="true"
        scheme="https" proxyName="JIRASERVERNAME" proxyPort="443" secure="true"/>
Apache Setup File

的httpd.conf

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule ssl_module modules/mod_ssl.so 

ServerName JIRASERVERNAME

Include conf/extra/httpd-vhosts.conf

Include conf/extra/httpd-ssl.conf

的httpd-vhosts.conf

<VirtualHost *:80>
    ServerName JIRASERVERNAME
    Redirect        /   https://JIRASERVERNAME/
</VirtualHost>

的httpd-ssl.conf中

 Listen 443 #This was already defined in here

<VirtualHost *:443>
    ServerName JIRASERVERNAME

    SSLEngine           On
    SSLCertificateFile      "C:\Program Files\Atlassian\JIRA\jre\server.crt"
    SSLCertificateKeyFile   "C:\Program Files\Atlassian\JIRA\jre\server.key"
    SSLProxyEngine      On

    ProxyRequests       Off
    ProxyPreserveHost   On

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass       /   http://JIRASERVERNAME:8080/
    ProxyPassReverse    /   http://JIRASERVERNAME:8080/

</VirtualHost>

我还注释掉了被VirtualHost配置取代的所有行。