apache - 使用 Tomcat 使用 HTTPS 反向代理配置 Bitbucket Server 的问题

标签 apache tomcat bitbucket tomcat8 bitbucket-server

我正在尝试使用 HTTPS 在我的 VPS 上安装一些 Atlassian 产品(Bitbucket Server、Jira、Confluence 等)。每个产品都应该在自己的子域上可用,例如https://bitbucket.mydomain.dehttps://jira.mydomain.de 我尝试了很多东西,但现在我很困惑。它总是将我重定向到 Tomcat-GUI 而不是我安装的 Bitbucket Server 应用程序。也许管理端口对我来说太困惑了。

涉及三个配置文件——Tomcats server.xml、Apaches mydomain.conf 文件和 Bitbuckets bitbucket.properties 配置。

我曾尝试在 Tomcat 中使用自己的 Bitbucket 连接器,同时在 Apache 中使用反向代理。这是我的一些文件。

Apache mydomain.conf

<VirtualHost *:443>
    ServerName bitbucket.mydomain.de
    ServerAlias bitbucket.mydomain.de

    ProxyRequests Off

    <Proxy *>
        Require all granted
    </Proxy>

    ProxyPass / http://bitbucket.mydomain.de:7990/
    ProxyPassReverse / http://bitbucket.mydomain.de:7990/

    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/mydomain_ssl_certificate.cer
    SSLCertificateKeyFile /etc/ssl/private/mydomainprivate_key.key
    SSLCertificateChainFile /etc/ssl/certs/mydomain_ssl_certificate_intermediate.cer
</VirtualHost>

Bitbuckets bitbucket.properties

server.port=7990
server.secure=true
server.scheme=https
server.proxy-port=443
server.proxy-name=bitbucket.mydomain.de

和 Tomcats server.xml

<Server port="8005" shutdown="SHUTDOWN">
    <...>
    <Service name="Catalina">
        <!-- Default Connector -->
        <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>

        <!-- Bitbucket Connector -->
        <Connector port="7990" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" compression="on" compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript"
            secure="true" scheme="https" proxyName="bitbucket.mydomain.de" proxyPort="443" />

        <!-- SSL Connector -->
        <Connector port="8443" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false"
            disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keyAlias="tomcat"
            SSLEnabled="true" keystoreFile="keystore/mydomain-keystore.jks" keypass="mypass" keystoreType="JKS"/>
    </Service>
</Server>

实际上,它每次都在 bitbucket.mydomain.de 上显示 Tomcat GUI 而不是 Bitbucket.. 我无法解释原因。我错过了什么?我认为整个 server.xml 配置错误......

非常感谢您的帮助!

最佳答案

你可以使用比 Apache 更轻量的东西,比如 haproxy。 Haproxy 可作为标准 Linux 软件包使用。 Haproxy 将终止您的 SSL 连接。它将充当各种 Atlassian 应用程序的反向代理。有关如何设置的信息,请参阅以下链接:

https://confluence.atlassian.com/bitbucketserver/securing-bitbucket-server-behind-haproxy-using-ssl-779303273.html

您不必更改 Tomcat server.xml

关于apache - 使用 Tomcat 使用 HTTPS 反向代理配置 Bitbucket Server 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55768804/

相关文章:

java - Tomcat 中的 org.jasypt.exceptions.EncryptionOperationNotPossibleException

python - 从 Bitbucket OAuth 获取 400

php - 无法将值添加到 phpmyAdmin 中的特定表

apache - ProxyPassReverse 删除 HTTPS

java - REST 服务没有响应

docker - 用于两个并行 docker 构建的 Bitbucket docker 图像缓存

fork - 如何在 BitBucket 上 fork 自己的 repo?

php - 使用PHP搜索或插入数据到远程mysql数据库

javascript - Safari加载JSON文件响应421错误

apache - Apache httpd 背后的 Tomcat 通过 SSL(httpd 工作,tomcat 返回错误 500)