Juvia not working properly when deployed to a sub URI
I have installed Juvia on my host, but I did not want to create a VirtualHost for it, so I decided to install it in a sub URI (e.g., http://example.com/juvia).
I could successfully run it after some struggling, but unfortunately it does not work properly, and the apparent reason is because it is on a sub URI. The problem specifically occurs when I try to submit a comment, but it also happens on other occasions. These Apache logs seem to confirm that:
[Thu Oct 18 03:04:45 2012] [error] [client 192.168.1.1] File does not exist: /var/www/html/api, referer: http://xyz.com/juvia.html
(The file juvia.html above is just a test).
As you can see, it is requesting the following URL:
http://example.com/api/FOO
instead of:
http://example.com/juvia/api/FOO
The second one would be the correct URL, since (as I explained) Juvia is running in a sub URI. I tried modifying some Ruby files from the project and recompiling the static assets, without success. It would be really great if I could deploy this application in a sub URI.
Please let me know if you need more information. Thanks.
Yes, Juvia is not at all written with sub-URI deployments in mind. It probably doesn't take too much work to get it working, but I do not want to write support for this because Juvia already works for my use cases. If anyone is willing to contribute support for sub-URI deployments, please go ahead.
My "work-in-progress" branch https://github.com/stbuehler/juvia/tree/wip should work with sub-URI deployment. I'll try to rebase my stuff onto the current master as soon as i have some time, now that it looks like upstream development continues :)
Would you be interested in committing directly to the main repository and help with maintenance? I could give you write access.
@stbuehler thanks for linking a branch that works with sub-URI deployment. Seems like a valuable use case as it would allow me to deploy without purchasing a new domain just to test out juvia. :+1: for committing it back to the main repository (pull request maybe).
@JangoSteve, if you have time, could you have a look at merging @stbuehler's fork?
Guys, please incorporate at least stbuehler 's commit 7c1ca8e08be23cb7cb2c7d6e64be1208f19c6044 from this wip rbanch. I cherry-picked it locally here and it seems to fix the sub-URI issue.
I'm reviewing pull request #47 with the sub-URI fix.