Open link in a new tab

Content

Expand project menu

Deploy in path

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!

Message actions

hmm, we couldn’t use it due to this in our company either :(

Message actions

hey,

did you guys check the Apache rewrite documentation?
http://httpd.apache.org/docs/current/rewrite/

Regards
TU

Message actions

“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.

Message actions

… 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

Message actions

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:

  1. One solution would be to precompile the assets again. If you changed the rails_url_root you could run openproject run rake assets:clobber and then openproject run rake assets:precompile. But unfortunately, you would have to this every time you update OpenProject.
  1. If you just want to test it or have small traffic you could try set config.serve_static_assets = true in openproject/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

Message actions

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.

By the way:
$ openproject-ce config:get rails_relative_url_root
/openproject

Any ideas?

Thanks,
Andreas