Content
You are here:
Deploy in path
Added by Deleted user almost 10 years ago
Hi.
I deployed the OpenProject 4.0.8 package in a Ubuntu 14.04 instance. However, due to internal restrictions, the site must be accessible via http:/host/openproject instead of http://host/.
Therefore, I set rails_relative_url_root=/openproject which works fine for pages, but static files are still served and requested from the root directory, eg http://host/assets/.
It looks like setting that option is not enough. What else do I need to do?
Thank you in advance!
Replies (6)
hmm, we couldn’t use it due to this in our company either :(
hey,
did you guys check the Apache rewrite documentation?
http://httpd.apache.org/docs/current/rewrite/
Regards
TU
“mod_rewrite provides a way to modify incoming URL requests…”
However, the problem is that OpenProject does not serve static files from the sub path, but from root.
… This allows you to map arbitrary URLs onto your internal URL structure in any way you like.
I posted the reply after a few quick reads on the web to give the tread owner a new idea, but I must admit it might be A LOT of work to get it done that way.
TU
Hi all,
I’m just writing to let you know that we read your question and are aware of that problem.
This is not a problem with OpenProject but generell with assets. When we precompile assets the root_path gets set and cannot be changed anymore.
The following solutions would be possible:
openproject run rake assets:clobber
and thenopenproject run rake assets:precompile
. But unfortunately, you would have to this every time you update OpenProject.config.serve_static_assets = true
inopenproject/config/environments/production.rb
. This way, the assets would get created on time which makes the server slower.Maybe there will be a better workaround for this at some time in the future. But for now that’s all I can think of. Does this help you?
Best,
Jonas
Jonas, thank you for your reply.
I just tried your first solution but unfortunately, it doesn’t work. The html pages still have the wrong path when referencing assets, e.g.
<script src="/assets/application-bd38ab7832e6d08d75460c0178439f9c.js"> </script>By the way:
$ openproject-ce config:get rails_relative_url_root
/openproject
Any ideas?
Thanks,
Andreas