YouTrack在Tomcat 7上使用SSL

我有一个使用Tomcat 7部署的正在运行的YouTrack实例,它在http://example.com:8080/youtrack上正常工作

Apache已经被configuration为支持主域的SSL(我有.pem文件)。 https://example.comhttp://example.com都可以正常访问。

端口8443已被其他服务使用( https://example.com:8443显示我Pleskpipe理面板)。

现在我想设置YouTrack使用https://youtrack.example.com

我怎样才能做到这一点?

我是否需要configurationTomcat以支持SSL(生成单独的密钥等),或者只是将来自Apache的请求代理到Tomcat?

我想第一步是将YouTrackconfiguration为https://example.com:8444/youtrack ,然后使用Apache的mod_proxy代理请求。

我怎样才能做到这一点?

我的/var/lib/tomcat7/conf/server.conf是默认的,没有任何改变: http : //pastie.org/9385045

我的/usr/share/tomcat7/bin/setenv.sh包含更改YouTrack默认URL的条目: -Djetbrains.youtrack.baseUrl=http://youtrack.example.com

虚拟主机configuration:

 $ cat /etc/apache2/sites-enabled/default <VirtualHost *:80> ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/default <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/default> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 

SSL主机:

 $ cat /etc/apache2/sites-enabled/default-ssl <IfModule mod_ssl.c> <VirtualHost _default_:443> ServerAdmin [email protected] DocumentRoot /var/www/default <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/default> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined SSLEngine on SSLCertificateFile /etc/ssl/certs/mailserver.pem SSLCertificateKeyFile /etc/ssl/private/mailserver.pem #SSLVerifyClient require #SSLVerifyDepth 10 #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> BrowserMatch "MSIE [2-6]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 # MSIE 7 and newer should be able to use keepalive BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown </VirtualHost> </IfModule> 

看起来比mod_proxy更好的select是mod_jk

请参阅使用mod_jk 。

您不需要为tomcatconfigurationSSL,只需使用Apache通过mod_proxy将请求代理到http://example.com:8080/youtrack

首先为新域名youtrack.example.com生成/购买证书。 然后在你的configuration中添加这个条目。

 <VirtualHost *:443> ServerName youtrack.example.com <Proxy *> Order deny,allow Allow from all </Proxy> SSLEngine on SSLCertificateFile /your/ssl/public/path/mailserver.pem SSLCertificateKeyFile /your/ssl/private/path/mailserver.pem ProxyPass / http://example.com:8080/youtrack/ ProxyPassReverse / http://example.com:8080/youtrack/ </VirtualHost> 

更多信息: 在这里和这里