Unable to access SCM-server behind router and apache reverse proxy

Issue #669 resolved
Mike Obi
created an issue

Hi,

I have my SCM-server running behind my apache reverse proxy server behind my router. So the SCM server and the Apache reverse proxy are on a separate machine. My reverse proxy setup is working because i have some website hosted in different machines that I can access . However, I cannot access the SCM server behind my router . Please help. Below is my configuration on th reverse proxy server

<VirtualHost *:80>
        ServerName www.rentalzonesvn.linkpc.net
      ErrorLog ${APACHE_LOG_DIR}/scm.log
    CustomLog ${APACHE_LOG_DIR}/scmcustom.log combined
        ProxyRequests Off
        ProxyPreserveHost On
        <Proxy *>
                Order deny,allow
                Allow from all
        </Proxy>

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

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

        Redirect permanent / /scm

</VirtualHost>

I have also enable forward to true. in the server-config.xml file found under (opt/scm-srver/conf/server.xml). Both the machine running the apache reverse server and the SCM server are ubuntu 14 servers

http://192.168.2.29:8080/scm is my internal machine and I can view the application internally.

Am I missing something in my configuration?

Comments (7)

  1. Mike Obi reporter

    I did not see any error in the apache log. to keep things clean because I have installed other SVN managers on the machine that I installed the SCM server I had to install a new Ubuntu box and installjust the SCM manager on it

    SCM server box = (192.168.2.31) . Apache reverse proxy server (192.168.2.25)

    zentalzonesvn.linkpc.net is the public web address, that points to my home router using dynamic DNS resolution, that I want to use to access the SCM-server from machines external to my LAN network.

    From your site the configuration on the proxy is

    ProxyPass /scm http://localhost:8080/scm
    ProxyPassReverse /scm http://localhost:8080/scm
    ProxyPassReverse  /scm  http://servername:8080/scm
    <Location /scm>
      Order allow,deny
      Allow from all
    </Location>
    

    for my reverse proxy server I have

    <VirtualHost *:80>
            ServerName rentalzonesvn.linkpc.net
            ServerAlias www.rentalzonesvn.linkpc.net
          ErrorLog ${APACHE_LOG_DIR}/scm.log
        CustomLog ${APACHE_LOG_DIR}/scmcustom.log combined
            ProxyRequests Off
            ProxyPreserveHost On
    
            <Proxy *>
                    Order deny,allow
                    Allow from all
            </Proxy>
    
            ProxyPass /scm http://192.168.2.25:8080/scm
            ProxyPassReverse /scm http://192.168.2.25:8080/scm
         ProxyPassReverse /scm http://192.168.2.31:8080/scm        
    
            <Location /scm>
                    Order allow,deny
                    Allow from all
            </Location>
    
            Redirect permanent / /scm
    
    </VirtualHost>
    

    so I am using the localhost to mean the IP of the reverse proxy server (192.168.2.25) and and the servername to mean the IP address of the machine running SCM-server.(192.168.2.31). Please is this assumption correct? Also I am setting the port of virtualhost on the reverse proxy to *.80. and also the servername and the serveralias to rentalzonesvn.linkpc.net and www.rentalzonesvn.linkpc.net, I believe I need those.

    I can access in scm-manager internally using 192.168.2.31/8080/scm

    externally I tried to access it using scm manager using http://rentalzonesvn.linkpc.net and I get a cryptic chinese page and when I try http://rentalzonesvn.linkpc.net/scm I get 404 page not found. you can try to access this page . Based on the configuration whats the right url for the SCM site rentalzonesvn.linkpc.net or rentalzonesvn.linkpc.net/scm?

    the two log file ErrorLog ${APACHE_LOG_DIR}/scm.log CustomLog ${APACHE_LOG_DIR}/scmcustom.log combined does not contain any information when I checked it. In addition,I have set the base url to http://192.168.2.25:8080/scm is that correct? I changed it from the scm-server IP to the reverse proxy server IP.

    I have set the forwarded property to true.

    I dont know what other option to try.

    Thanks for the assistance.

  2. Stephan Christann

    Hello Mike Obi,

    according your decription the configuration should work with theese entries:

    <VirtualHost *:80>
            ServerName rentalzonesvn.linkpc.net
            ServerAlias www.rentalzonesvn.linkpc.net
          ErrorLog ${APACHE_LOG_DIR}/scm.log
        CustomLog ${APACHE_LOG_DIR}/scmcustom.log combined
            ProxyRequests Off
            ProxyPreserveHost On
    
            <Proxy *>
                    Order deny,allow
                    Allow from all
            </Proxy>
    
           ProxyPass /scm http://192.168.2.31:8080/scm
           ProxyPassReverse /scm http://192.168.2.31:8080/scm
    
    
            <Location /scm>
                    Order allow,deny
                    Allow from all
            </Location>
    
            Redirect permanent / /scm
    
    </VirtualHost>
    
  3. Log in to comment