SSL, Apache, mod_proxy and mod_ssl

753 views
Skip to first unread message

Dimitrios Zarras

unread,
May 11, 2012, 5:59:20 PM5/11/12
to scmma...@googlegroups.com
Hi there,

I'm new to SCM-Manager. Up until now I have successfully configured a reverse proxy for Apache (without ssl) and it works like a charm.
But how to I configure a reverse proxy that uses SSL?
I have enabled SSL support in SCM-Manager by following this guide: https://bitbucket.org/sdorra/scm-manager/wiki/scm-server-ssl but how do I configure Apache now?

Thanks in advance.

Sebastian Sdorra

unread,
May 12, 2012, 8:39:19 AM5/12/12
to scmma...@googlegroups.com
Hi,
The scm-server-ssl guide is when you are using scm-server without a
reverse proxy. You have to configure ssl for your apache.

http://httpd.apache.org/docs/2.2/ssl/
http://www.sitepoint.com/securing-apache-2-server-ssl/

Sebastian

2012/5/11 Dimitrios Zarras <zarra...@gmail.com>:

Dimitrios Zarras

unread,
May 12, 2012, 10:46:18 AM5/12/12
to scmma...@googlegroups.com
Hi Sebastian,

Can you tell me if the configuration below is correct?

<VirtualHost "IP":80>
        ServerName my.sub.com

        ProxyRequests Off
        ProxyPreserveHost On

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

        ProxyPass /scm http://localhost:8080/scm
        ProxyPassReverse /scm http://localhost:8080/scm
        ProxyPassReverseCookiePath /scm http://localhost:8080/scm

        <Location /scm>
                Order allow,deny
                Allow from all
        </Location>

        Redirect permanent / /scm

</VirtualHost>

<VirtualHost "IP":443>
        ServerName my.sub.com

        SSLEngine On
        SSLCertificateFile /etc/apache2/ssl.crt/scm.crt
        SSLCertificateKeyFile /etc/apache2/ssl.key/scm.key

        SSLProxyEngine On

        ProxyRequests Off
        ProxyPreserveHost On

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

        ProxyPass /scm https://localhost:8181/scm
        ProxyPassReverse /scm https://localhost:8181/scm
        ProxyPassReverseCookiePath /scm https://localhost:8181/scm

        <Location /scm>
                Order allow,deny
                Allow from all
        </Location>

        Redirect permanent / /scm

</VirtualHost>


I extracted scm.crt and scm.key from keystore.jks thus apache and scm use the same certificate.
Configuration wise is this correct?

Sebastian Sdorra

unread,
May 12, 2012, 11:19:00 AM5/12/12
to scmma...@googlegroups.com
Hi,
No the config is not correct. You have to disable the ssl
configuration in the server-config.xml of scm-manager, because it is
not needed. The whole ssl encryption is done by the reverse proxy
(Apache in your case) and the proxy is talking to scm-manager in plain
http. So you have to change your config of the ssl virtualhost from:

ProxyPass /scm https://localhost:8181/scm
ProxyPassReverse /scm https://localhost:8181/scm
ProxyPassReverseCookiePath /scm https://localhost:8181/scm

to:

ProxyPass /scm http://localhost:8080/scm
ProxyPassReverse /scm http://localhost:8080/scm
ProxyPassReverseCookiePath /scm http://localhost:8080/scm

Sebastian

2012/5/12 Dimitrios Zarras <zarra...@gmail.com>:

Dimitrios Zarras

unread,
May 12, 2012, 11:46:40 AM5/12/12
to scmma...@googlegroups.com
Do I keep

SSLProxyEngine On

?

Sebastian Sdorra

unread,
May 12, 2012, 11:56:30 AM5/12/12
to scmma...@googlegroups.com
No SSLProxyEngine have to be off.

Sebastian

2012/5/12 Dimitrios Zarras <zarra...@gmail.com>:

Dimitrios Zarras

unread,
May 12, 2012, 11:59:14 AM5/12/12
to scmma...@googlegroups.com
So here's a recap:

<VirtualHost "IP":443>
ServerName my.sub.com

SSLEngine On
SSLCertificateFile /etc/apache2/ssl.crt/scm.crt
SSLCertificateKeyFile /etc/apache2/ssl.key/scm.key

ProxyRequests Off
ProxyPreserveHost On

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

ProxyPass /scm http://localhost:8080/scm
ProxyPassReverse /scm http://localhost:8080/scm
ProxyPassReverseCookiePath /scm http://localhost:8080/scm

<Location /scm>
Order allow,deny
Allow from all
</Location>

Redirect permanent / /scm

</VirtualHost>

Correct?

Sebastian Sdorra

unread,
May 12, 2012, 12:07:55 PM5/12/12
to scmma...@googlegroups.com
Yes i think this could work.
Reply all
Reply to author
Forward
0 new messages