Rhodecode in subdirectory behind an apache proxy
This is just a copy of this post:
Hi Guys,
looks like this is general Pylons problem, but here's how to get it work with rhodecode.
For example you have a few apps you want to get working with ssl on the same port with an apache reverse proxy then you need to use subdirectories. Rhodecode shall be made available under https://server/rhodecode.
Step 1: Add prefix to rhodecode.
Edit your Pylons ini file for Rhodecode. In [app:main] make sure static_files is set to true and add
filter-with = proxy-prefix
Add the following at the end of the file
This makes the rhodecode app available at root and /rhodecode.
Step 2: Setup Apache.
Set in the general setup or in the appropiate VirtualHost the following
59542 is my port for rhodecode and the SetEnvIF line is saying rhodecode to stay with https. Remove it if you use http.
If you start now both, you will have the problem that Rhodecode generate the wrong absolute paths for CSS, images and Javascript: /images, /css/ resp. /js. It looks like there is no way to make them dynamically. If you don't want to make redirections for that stuff or copy them into the root of apache, you have to change this paths in the sources :(
Step 3: Modify sources
Go to the directory where rhodecode is installed (probably the egg directory in site-packages). Issue the following commands:
This will add /rhodecode/ to the beginning of all "/images/" "/css/" "/js/" paths.
Now start both servers. You have now cleanly separated Rhodecode into its own directory.
For me this is only a temporary solution as you probably will have to repeat Step 3 after every update of Rhodecode.
Neuen Kommentar schreiben