nlplab / brat

brat rapid annotation tool (brat) - for all your textual annotation needs
http://brat.nlplab.org
Other
1.82k stars 509 forks source link

Brat standalone seems to start fine, but browsers download the xhtml files instead of running it #1366

Open yampeku opened 3 years ago

yampeku commented 3 years ago

Installed brat (./install.sh) in a fresh unix machine with python 2.7. When running the standalone server, no errors are displayed (Serving brat at http://127.0.0.1:8001) However, when I access the server, I get a 'Redirecting...' message and then the index.xhtml is downloaded. Seems to happen also to any other xhtml file. The troubleshooting script says

Didn't receive json data when accessing "http://127.0.0.1:8001/ajax.cgi", instead we received application/octet-stream. Have you perhaps forgotten to add a handler for CGI in your web server configuration?

But I can't find documentation for any of that in the installation manual.

Chrome error message in console is

Resource interpreted as Document but transferred with MIME type application/octet-stream: "http://machineip:8001/index.xhtml".

Which seems to imply that something is misconfigured in the standalone server, but I'm not sure what.

dogatekin commented 3 years ago

I have the exact same issue, have you made any progress?

yampeku commented 3 years ago

used the self contained version in the end

dogatekin commented 3 years ago

Thanks for the quick reply! What exactly do you mean by the self contained version? How can I use it? I couldn't find anything about that in the documentation. Do you mean you set up a CGI server?

dogatekin commented 3 years ago

For anyone reading looking for a solution, I found my solution in this issue instead: https://github.com/nlplab/brat/issues/1202

btyu commented 3 years ago

For anyone reading looking for a solution, I found my solution in this issue instead: #1202

Could you expand your solution. I am using manjaro (arch linux), and have installed mailcap. It's still not working.

dogatekin commented 3 years ago

Sorry to hear that, installing mailcap was enough for me on Oracle Linux.

btyu commented 3 years ago

Thank you for the quick reply. I'll try to find the solutions for Arch Linux.

btyu commented 3 years ago

According to my attempts, using another browser may help on Arch Linux: local browser: Chromium, brat server: running on another Ubuntu machine, result: rendered correctly. local browser: Chromium, brat server: running locally on Arch Linux, result: downloading file. local browser: Chrome or Firefox, brat server: running locally on Arch Linux, result: rendered correctly.

I guess it may be related to some rendering settings of local files on Chromium. Anyway, problem solved.