changing the ProxyPass URL

Showing 1-11 of 11 messages
changing the ProxyPass URL Arvind 8/30/12 10:26 AM
Hello,

I could not find this question on the group, so i thought i need to ask this.

i do not want the /scm in my URL

so for all my users , i want to use http://myserver.org/hg/public/myrepo

so i configured the proxypass to be like this  (notice the / at the end of SCM ).

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

if i do not end with the / after scm, i get an error saying, it cannnot open http://myserver.org/scmscm/

But this config is giving me new issues....
the admin account does not seem to work and keep getting ..
"You do not have enough permissions to execute this action".

But it works perfectly if the ProxyPass is set this way
 ProxyPass /scm http://localhost:8080/scm

I do not want /scm ....
is there a way to fix this ?

thanks
Arvind





Re: changing the ProxyPass URL Sebastian Sdorra 8/30/12 11:03 PM
Hi,
Yes there is a way. It is not a good idea to change the context url in
the reverse proxy. A better way is to change the context path in the
conf/scm-server.xml:

- Search the following lines:

  <New id="scm-webapp" class="org.eclipse.jetty.webapp.WebAppContext">
    <Set name="contextPath">/scm</Set>
    <Set name="war"><SystemProperty name="basedir"
default="."/>/var/webapp/scm-webapp.war</Set>
  </New>

- And replace them with:

  <New id="scm-webapp" class="org.eclipse.jetty.webapp.WebAppContext">
    <Set name="contextPath">/</Set>
    <Set name="war"><SystemProperty name="basedir"
default="."/>/var/webapp/scm-webapp.war</Set>
  </New>

- Search the following lines:

  <Set name="handler">
    <New class="org.eclipse.jetty.server.handler.HandlerCollection">
      <Set name="handlers">
        <Array type="org.eclipse.jetty.server.Handler">
          <Item>
            <Ref id="scm-webapp" />
          </Item>
          <Item>
            <Ref id="docroot" />
          </Item>
        </Array>
      </Set>
    </New>
  </Set>

- and replace them with:

  <Set name="handler">
    <New class="org.eclipse.jetty.server.handler.HandlerCollection">
      <Set name="handlers">
        <Array type="org.eclipse.jetty.server.Handler">
          <Item>
            <Ref id="scm-webapp" />
          </Item>
        </Array>
      </Set>
    </New>
  </Set>

After that you could change your reverse proxy configuration to the following;

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

Sebastian

2012/8/30 Arvind <arvind...@gmail.com>:
Re: changing the ProxyPass URL Arvind 9/4/12 7:27 AM
Hi,

Thanks for that, it worked, however, now I am getting a different error.

After i login as scmadmin and try to configure users, it says
"You have not enough permissions to execute this action".

I could narrow down the problem to my virtual host.

I run apache server and the hostname is "ubserver".

and my virtual hostname is "hg.myserver" 

If i run the it like this http://ubserver:8080/  then everything works fine.

But if i run it like this http://hg.myserver/  then i get that error.
"You have not enough permissions to execute this action".

Do you think we need more config in the xml file to also allow for virtual host ?

thank you
Arvind

Re: changing the ProxyPass URL Sebastian Sdorra 9/4/12 10:09 AM
Hi,
Have you changed the "Base Url" as described in
https://bitbucket.org/sdorra/scm-manager/wiki/apache/apache-mod_proxy
?

Sebastian

2012/9/4 Arvind <arvind...@gmail.com>:
Re: changing the ProxyPass URL Arvind 9/4/12 11:27 AM
yes.. the base url was set to

http://hg.myserver/

I am sure, I am missing something in the configuration.

Do you think, some old cookie is not being erased and causing that issue ?

thanks
Arvind
Re: changing the ProxyPass URL Arvind 9/4/12 2:59 PM
Hello,

I think i found the issue.

the base url was being set as

http://hg.myserver/

i changed it to

http://hg.myserver

(mind the slash at the end. i removed it)

and now it works without any issues.

perhaps you can throw some light on this issue, explaining why the trailing / is causing the error
"you have not enough permissions to execute this action".



thanks
Arvind
Re: changing the ProxyPass URL Arvind 9/5/12 6:48 AM
Hi,

Despite changing the URL, the scmadmin login behaves weirdly.

I can get full access to admin from one machine, while from another machine, i keep getting "you have not enough permissions to execute this action".

Now, i am not even sure what is going on.

Can anybody please throw some light on this ?

thanks
Arvind
Re: changing the ProxyPass URL Sebastian Sdorra 9/5/12 7:26 AM
Hi,
It sound like the cookie host ist wrong. Could you set
ProxyPassReverseCookieDomain directive in your apache.

http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypassreversecookiedomain

Sebastian

2012/9/5 Arvind <arvind...@gmail.com>:
Re: changing the ProxyPass URL Arvind 9/5/12 7:29 AM
it also seems, that , it is allowing firefox _only_ somtimes to become admin, but other browsers always end up with a lack of permissions after logging in as scmadmin.
i am not able to pin point the exact issue.
Re: changing the ProxyPass URL Sebastian Sdorra 9/5/12 7:36 AM
Could you try to monitor this issue with the net module of firebug?

Sebastian

2012/9/5 Arvind <arvind...@gmail.com>:
Re: changing the ProxyPass URL Arvind 9/5/12 11:23 AM
Hi...

I think, i might have found the issue.

I misconfigured the  ProxyPassReverseCookiePath .

It was showing as
ProxyPassReverseCookiePath  /   http://localhost:8080/

i changed it to
ProxyPassReverseCookiePath /  /

and now, it seems to work from every browser.

how ever this ProxyPassReverseCookiePath is not found in the documentation..... at https://bitbucket.org/sdorra/scm-manager/wiki/apache/apache-mod_proxy

Perhaps,we should update it ?

Thank you very much for your time and effort. its very much appreciated.

cheers
Arvind