changing the ProxyPass URL

283 views
Skip to first unread message

Arvind

unread,
Aug 30, 2012, 1:26:19 PM8/30/12
to scmma...@googlegroups.com
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





Sebastian Sdorra

unread,
Aug 31, 2012, 2:03:15 AM8/31/12
to scmma...@googlegroups.com
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>:

Arvind

unread,
Sep 4, 2012, 10:27:16 AM9/4/12
to scmma...@googlegroups.com
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

Sebastian Sdorra

unread,
Sep 4, 2012, 1:09:51 PM9/4/12
to scmma...@googlegroups.com
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>:

Arvind

unread,
Sep 4, 2012, 2:27:57 PM9/4/12
to scmma...@googlegroups.com
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

Arvind

unread,
Sep 4, 2012, 5:59:05 PM9/4/12
to scmma...@googlegroups.com
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

Arvind

unread,
Sep 5, 2012, 9:48:10 AM9/5/12
to scmma...@googlegroups.com
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

Sebastian Sdorra

unread,
Sep 5, 2012, 10:26:43 AM9/5/12
to scmma...@googlegroups.com
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>:

Arvind

unread,
Sep 5, 2012, 10:29:38 AM9/5/12
to scmma...@googlegroups.com
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.

Sebastian Sdorra

unread,
Sep 5, 2012, 10:36:32 AM9/5/12
to scmma...@googlegroups.com
Could you try to monitor this issue with the net module of firebug?

Sebastian

2012/9/5 Arvind <arvind...@gmail.com>:

Arvind

unread,
Sep 5, 2012, 2:23:41 PM9/5/12
to scmma...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages