Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Juvia not working properly when deployed to a sub URI #13

Open
sergiodj opened this issue Oct 18, 2012 · 7 comments · May be fixed by #47
Open

Juvia not working properly when deployed to a sub URI #13

sergiodj opened this issue Oct 18, 2012 · 7 comments · May be fixed by #47

Comments

@sergiodj
Copy link

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.

@FooBarWidget
Copy link
Member

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.

@stbuehler
Copy link
Contributor

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 :)

@FooBarWidget
Copy link
Member

Would you be interested in committing directly to the main repository and help with maintenance? I could give you write access.

@cboettig
Copy link

cboettig commented Apr 5, 2013

@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. 👍 for committing it back to the main repository (pull request maybe).

@FooBarWidget
Copy link
Member

@JangoSteve, if you have time, could you have a look at merging @stbuehler's fork?

@dirk-olmes
Copy link

Guys, please incorporate at least stbuehler 's commit 7c1ca8e from this wip rbanch. I cherry-picked it locally here and it seems to fix the sub-URI issue.

@FooBarWidget
Copy link
Member

I'm reviewing pull request #47 with the sub-URI fix.

stbuehler added a commit to stbuehler/juvia that referenced this issue Dec 14, 2013
stbuehler added a commit to stbuehler/juvia that referenced this issue Dec 15, 2013
`config.action_controller.relative_url_root` can be used to tell Rails
that you are deploying to a subdirectory. The default is
`ENV['RAILS_RELATIVE_URL_ROOT']`.

the asset pipeline doesn't like using the value from request script_name,
although this should contain the correct value and should theoretically
be possible :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants